Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 25 26 [27] 28 29 ... 31

Author Topic: Proceedurally Generated RTS  (Read 56993 times)

Draco18s

  • Bay Watcher
    • View Profile
Re: Proceedurally Generated RTS
« Reply #390 on: June 13, 2011, 11:25:10 am »

Did a poke around google images just to see what I could find, and ran into someone who posted a direction to explore.  Here's my preliminary results:



Blue used as a background color to show the transparency of it.

It doesn't quite have the same texture to it that this guy got, but it's way better looking than the route I was going to take.  I never thought about using perlin noise as an offset to the inputs to perlin noise.

Downside, that image (550 x 400 pixels) took 7.6 seconds to generate, as I have to call AS3.perlinNoise() twice per pixel (for grayscale) with the inefficiency of the AS3 implementation (versus the native) and the function call overhead over filling a bitmap directly (it's costing about 2.5 extra seconds to do the 220,000 extra function calls, over 1 function call to do the math three times per pixel).
Logged

Akhier the Dragon hearted

  • Bay Watcher
  • I'm a Dragon, Roar
    • View Profile
    • My YouTube Channel
Re: Proceedurally Generated RTS
« Reply #391 on: June 13, 2011, 04:05:53 pm »

   Very nicely done. It is a little slow but the first
step is always one of the harder ones. Now that
you have a base to work on you will probably be
able to get the time down enough for the game.
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 #392 on: June 13, 2011, 04:09:08 pm »

   Very nicely done. It is a little slow but the first
step is always one of the harder ones. Now that
you have a base to work on you will probably be
able to get the time down enough for the game.

I've got to work out how to break the texture rendering portion into chunks so that I spread it across multiple frame updates (so the game doesn't appear to freeze, while also getting around the 15 second "infinite loop" timelimit).  Then I can render as big of an image as I need while the game also does other things.  There's going to be a fair amount of pre-game processing, but I can deal with this.
Logged

Mephansteras

  • Bay Watcher
  • Forger of Civilizations
    • View Profile
Re: Proceedurally Generated RTS
« Reply #393 on: June 13, 2011, 04:27:03 pm »

A thought, in case you need to go with a longish map-generator. If you can, let the player do some ship design or something while the map generation is running. That way even a longish delay won't be too noticeable.
Logged
Civilization Forge Mod v2.80: Adding in new races, equipment, animals, plants, metals, etc. Now with Alchemy and Libraries! Variety to spice up DF! (For DF 0.34.10)
Come play Mafia with us!
"Let us maintain our chill composure." - Toady One

Draco18s

  • Bay Watcher
    • View Profile
Re: Proceedurally Generated RTS
« Reply #394 on: June 13, 2011, 05:22:33 pm »

A thought, in case you need to go with a longish map-generator. If you can, let the player do some ship design or something while the map generation is running. That way even a longish delay won't be too noticeable.

Oh, definitely.  It'll be behind loading screens and menus and such.
Logged

Draco18s

  • Bay Watcher
    • View Profile
Re: Proceedurally Generated RTS
« Reply #395 on: June 14, 2011, 07:38:19 pm »

Progress!
Spoiler (click to show/hide)

Generated the image in 4 parts, 24.3 total seconds.  Trying to get multiple colors into the gassy cloud, this was the best looking result (algorithmic wise) so far.

Colors right now are on a gradient of teal -> yellow -> red -> purple (-> teal) and it picks a spot, and then an identical spot 2 shifts up or down.
Logged

Akhier the Dragon hearted

  • Bay Watcher
  • I'm a Dragon, Roar
    • View Profile
    • My YouTube Channel
Re: Proceedurally Generated RTS
« Reply #396 on: June 14, 2011, 08:04:04 pm »

   The colors are nice though once again the screen
is a little to hectic. Culling a few of the cloud masses
may make it look better.
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 #397 on: June 14, 2011, 08:12:56 pm »

   The colors are nice though once again the screen
is a little to hectic. Culling a few of the cloud masses
may make it look better.

Oh, agreed.  Still working on a plan of attack for that one.
Logged

Draco18s

  • Bay Watcher
    • View Profile
Re: Proceedurally Generated RTS
« Reply #398 on: June 15, 2011, 01:31:35 pm »

OH YEAH.

Spoiler (click to show/hide)

About 25.8 seconds (work machine, which is slower than home machine, and the time is actually from the image I did after this one).
By only generating the cloud's values inside the area designated as the cloud I can cut down on hugely expensive Perlin calls.

It's possible for the cloud to be in a tiny bubble, but I haven't seen it happen yet (I have seen a map of possibility include a region that would have been all of 10 pixels in diameter, but the random selection for cloud location didn't floodfill it).

I could try and find regions that don't border more than 2 edges of the screen, but it'd be tricky.  Especially if such a region was small or non-existent.
Logged

Mephansteras

  • Bay Watcher
  • Forger of Civilizations
    • View Profile
Re: Proceedurally Generated RTS
« Reply #399 on: June 15, 2011, 01:45:32 pm »

Looking good!
Logged
Civilization Forge Mod v2.80: Adding in new races, equipment, animals, plants, metals, etc. Now with Alchemy and Libraries! Variety to spice up DF! (For DF 0.34.10)
Come play Mafia with us!
"Let us maintain our chill composure." - Toady One

Draco18s

  • Bay Watcher
    • View Profile
Re: Proceedurally Generated RTS
« Reply #400 on: June 15, 2011, 01:56:44 pm »

Or, coming back from 2 colors to 1 because it looks funny:
(and showing off a smaller gas cloud region)

Spoiler (click to show/hide)

I think it's time to work on those star clusters.  They look too uniform.
Logged

Virex

  • Bay Watcher
  • Subjects interest attracted. Annalyses pending...
    • View Profile
Re: Proceedurally Generated RTS
« Reply #401 on: June 15, 2011, 02:08:33 pm »

They look too clustery. You may want to go and see if you can get several clusters to connect to each other and form bands or something. The real night's sky doesn't have huge clusters either.
Logged

Draco18s

  • Bay Watcher
    • View Profile
Re: Proceedurally Generated RTS
« Reply #402 on: June 15, 2011, 02:17:15 pm »

They look too clustery. You may want to go and see if you can get several clusters to connect to each other and form bands or something. The real night's sky doesn't have huge clusters either.

Yeah, it's kinda spider web-y.  I'll tweak it and come up with something.
Logged

Draco18s

  • Bay Watcher
    • View Profile
Re: Proceedurally Generated RTS
« Reply #403 on: June 15, 2011, 11:42:05 pm »

Optimization, ho!

Spoiler (click to show/hide)

As you can see in the top left corner, that image too 5.2 seconds to draw.  Each of the starry background pieces took 160ms apiece on average, down from a whopping 4000.  Clouds are taking less than they used to, but it's proportional to how much cloud is in each section.  If a cloud area takes up the FULL section, it takes a good 6-8 seconds to draw (up slightly, due to function and loop overhead) but for each section that has little to no cloud (like the upper left quadrant) it takes almost no time at all: 116-141ms (just the loop and some memory access overhead) for a net gain.
« Last Edit: June 15, 2011, 11:45:19 pm by Draco18s »
Logged

breadbocks

  • Bay Watcher
  • A manacled Mentlegen. (ಠ_ృ)
    • View Profile
Re: Proceedurally Generated RTS
« Reply #404 on: June 17, 2011, 04:05:13 am »

Neat. If I may suggest toning down the overall number of stars, that would make the clusters less of a clusterfuck.
Logged
Clearly, cakes are the next form of human evolution.
Pages: 1 ... 25 26 [27] 28 29 ... 31