Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 29 30 [31]

Author Topic: Proceedurally Generated RTS  (Read 56960 times)

Armok

  • Bay Watcher
  • God of Blood
    • View Profile
Re: Proceedurally Generated RTS
« Reply #450 on: July 28, 2011, 12:58:48 pm »

Fantastic indeed.
Logged
So says Armok, God of blood.
Sszsszssoo...
Sszsszssaaayysss...
III...

Draco18s

  • Bay Watcher
    • View Profile
Re: Proceedurally Generated RTS
« Reply #451 on: July 28, 2011, 01:16:19 pm »

The yellow/red clouds are quite stunning.  The purple and blues are more cool and muted.
Nothing wrong with that, of course, as it gives it a nice variety.
Logged

Akhier the Dragon hearted

  • Bay Watcher
  • I'm a Dragon, Roar
    • View Profile
    • My YouTube Channel
Re: Proceedurally Generated RTS
« Reply #452 on: July 28, 2011, 01:31:23 pm »

   Simply amazing!
Logged
Quote
Join us. The crazy is at a perfect temperature today.
So it seems I accidentally put my canteen in my wheelbarrow and didn't notice... and then I got really thirsty... so right before going to sleep I go to take a swig from my canteen and... end up snorting a line of low-grade meth.

Draco18s

  • Bay Watcher
    • View Profile
Re: Proceedurally Generated RTS
« Reply #453 on: July 30, 2011, 11:14:26 pm »

Horse head nebula?


Found an issue with the star-drawing.  Erf. :\  I knew this was going to happen (and tried to avoid it, but then I added the line-drawing, which increased its size), this is just the first time I've caught it actually happening.


And I now have a basic sidebar working.  You can remove individual units from it (holding down ctrl and clicking), or select an individual unit from it (just clicking).  Doesn't display health yet, but I'm working on it.

Online at the usual URL.
Logged

Akhier the Dragon hearted

  • Bay Watcher
  • I'm a Dragon, Roar
    • View Profile
    • My YouTube Channel
Re: Proceedurally Generated RTS
« Reply #454 on: July 31, 2011, 12:40:45 am »

   It actually looks more like your avatars head.
Logged
Quote
Join us. The crazy is at a perfect temperature today.
So it seems I accidentally put my canteen in my wheelbarrow and didn't notice... and then I got really thirsty... so right before going to sleep I go to take a swig from my canteen and... end up snorting a line of low-grade meth.

Draco18s

  • Bay Watcher
    • View Profile
Re: Proceedurally Generated RTS
« Reply #455 on: July 31, 2011, 09:38:51 am »

   It actually looks more like your avatars head.

Kind of does.
Logged

Draco18s

  • Bay Watcher
    • View Profile
Re: Proceedurally Generated RTS
« Reply #456 on: October 10, 2011, 04:29:39 pm »

Fiddling with rendering some more--nothing else to do at work.



Starting to look really impressive.  Working on getting a very large star (one that would be in the middle of the nebula) in.  Have to work out how to know where to place it, heh.  Here's one I hand placed*:



(it took me 7 hours to get that star looking right?  Holy fruitcakes.  And it still needs tweaking)

*I want the program to figure out that it should go there, not me looking it and going "there."  Anyone can see why I chose that spot, but I haven't figured out how I'd locate that spot, or another spot like it, with code.
Logged

Ironhand

  • Bay Watcher
  • the llama is laughing
    • View Profile
Re: Proceedurally Generated RTS
« Reply #457 on: October 11, 2011, 09:30:50 am »

This is beautiful!

I am a total procedural content fanatic, so I love following projects like this.
The nebula renderer reminds me of the one used in this "let's code" project.

Anyway, this is delightful to look at.
Can't wait to see what's next!
Logged

Armok

  • Bay Watcher
  • God of Blood
    • View Profile
Re: Proceedurally Generated RTS
« Reply #458 on: October 11, 2011, 09:34:27 am »

What spot exactly? Try to describe what exact criteria you want to use in as much detail as possible.
Logged
So says Armok, God of blood.
Sszsszssoo...
Sszsszssaaayysss...
III...

Siquo

  • Bay Watcher
  • Procedurally generated
    • View Profile
Re: Proceedurally Generated RTS
« Reply #459 on: October 11, 2011, 10:26:33 am »

this "let's code" project.
Cool that, he's run into exactly the same stuff I have! Thanks for that link.

This project is starting to look cooler and cooler as well! (this is actually a lengthy posting-to-follow ;) )
Logged

This one thread is mine. MIIIIINE!!! And it will remain a happy, friendly, encouraging place, whether you lot like it or not. 
will rena,eme sique to sique sxds-- siquo if sucessufil
(cant spel siqou a. every speling looks wroing (hate this))

Draco18s

  • Bay Watcher
    • View Profile
Re: Proceedurally Generated RTS
« Reply #460 on: October 11, 2011, 12:03:43 pm »

I am a total procedural content fanatic, so I love following projects like this.
The nebula renderer reminds me of the one used in this "let's code" project.

I've seen that article before, and I do like his results, but I'd have to restructure too much to do anything similar.
(Not to mention, finding a fast AS3 implementation of Simplex Noise, as it's not native; my AS3 Perlin noise function has been heavily optimized twice over by people way smarter than I am, and it's definitely the slowest piece of the code).

What spot exactly? Try to describe what exact criteria you want to use in as much detail as possible.

I had meant the spot I stuck the star in.
I know what you're trying to get me to do, but the problem is that I'm trying to define a pattern without understanding what the pattern is.

It's a Feature Detection problem, and not one that's been done before (faces, blobs, edges, ridges...all yes.  An area of local minima surrounded on most sides by ridges/blobs?  No) so I don't have a resource to draw upon.

In any case, I'm testing out a method that should work "fairly well" if not exactly as I'd like.  I'm getting the occasional "index out of bounds" at the moment, due to some "keep it inside the nebula" code (that is, the local minima located was not part of the cloud structure, and the "start over" code threw an invalid index as the new point to test from).
Logged

Armok

  • Bay Watcher
  • God of Blood
    • View Profile
Re: Proceedurally Generated RTS
« Reply #461 on: October 11, 2011, 01:51:34 pm »

Oh, that easy, although depending on how your noise function and what quality you want works it may unavoidably by unacceptably slow slow.

The easiest case is if getting stuck in to-local minima isn't to big a problem and/or your noise function is sufficiently low frequency:
Code: [Select]
Chose a random point
Repeat X (for example 100 or 1000) times:
    save a copy of the point the point
    move the point Y pixels in a random direction
    If the point is higher than the copies value: with Z% probability (suggesting 90%) revert the point to the copies coordinates.
put the star at the point
Logged
So says Armok, God of blood.
Sszsszssoo...
Sszsszssaaayysss...
III...

Draco18s

  • Bay Watcher
    • View Profile
Re: Proceedurally Generated RTS
« Reply #462 on: October 11, 2011, 02:06:21 pm »

Yeah, I'm doing something like that.

I already have a semi-random point that is known to be inside the cloud (P), and it's a "control" point.
Code: [Select]
If P.alpha <= 20 (7.8%), then use P.  Else:
   attempt to find a point that has lower alpha than P, but has non-zero alpha
Repeat, if changed:
   For points +/- 10 pixels in cardinal directions (up, down, left, right) if it has lower alpha, set point to that point (it always picks the lowest alpha of the four spots).
   If outside the nebula:
      Find new point inside the nebula (similar to prior attempt)
Finally, when a suitable local-low has been found, attempt to find the other side of a similar-value area (that is, continuing in the same direction as last move, find a point with a higher alpha than the current point; like taking a boat across a lake).
Average the two points (go to the middle of the lake.
Draw star.

So it'll fall into a local minimum, do a simple map of the size of that minima, and draw the star in the middle of it.

The last step isn't quite working as desired, yet, but it takes like 4 minutes per compile to see what happens, think I've got it, have it fail again, and retry.
« Last Edit: October 11, 2011, 02:16:17 pm by Draco18s »
Logged

Draco18s

  • Bay Watcher
    • View Profile
Re: Proceedurally Generated RTS
« Reply #463 on: October 11, 2011, 02:55:38 pm »

Yeah, something like this.



Fiddled with the lake-crossing code a little as while that apparent patch is very black, it's not perfectly black except in a very small region:



So I have it comparing to a spot 20 pixels "uphill" from the initial detection of local minima, which lets the lake-boat slide over small sand bars (but not islands).
The guides in that image are the points of the lake crossing on the absolute 0 alpha test (y=750 & y=768).  The above picture was centered in the middle of the top of the two there and a spot 37 pixels below the bottom one (y=750 & y=805).

I'm going to widen it up a little more, see what happens, but I think the results are sufficient now.
Logged
Pages: 1 ... 29 30 [31]