Allegro.cc
Projects
Action252
Adventure22
Arcade216
Board Games30
Demos24
Emulators10
Other68
Puzzle139
Role Playing40
Sports25
Strategy58
Utilities46
Resource Directory
Code Gallery3
Compilers12
Help & Documents13
Libraries63
Media2
Tools8
IOTD: Random planet generation
Random planet generation
Random planet generation, by Jakub Wasilewski

Some of you may still remember (or still try to beat ;)) my speedhack entry, Starship Survivor. I consider that entry a big success, and I am concentrating my efforts on creating a full-blown sequel, this time with real graphics and much extended gameplay.

The image you see above was produced by the random planet generation code. Everything you see is generated procedurally and a total of 0 bytes of external data was used to generate those textures.

The planet generation engine is in an early stage, so not everything is perfect yet, but I made a very simple demo for your pleasure - just click this link to download an exe (it requires alleg42.dll). After running it, press any key to generate another planet, or ESC to quit.

Comments and critique appreciated :).
Animated!
Impressive results for procedural generation.
How does it work? - Jim Sinha
Holy cow! That's crazy! It's like Spore or something. I must say, that is quite impressive. - Jonny Cook
Really really great! - Nial Giacomelli
My guess that he generates a couple procedural textures, then uses sphere mapping to generate the "animation." However, I'm not sure...

Really cool though! - Carrus85
Pretty cool, ran a little slow on my computer, and the "press any key/esc" thing didn't work until it had been running/displaying the first animated planent for about a minute. Very nice tho. - Michael Jensen
its animated becasue it uses allegrogl (for those that dont remember from speedhack). it uses normal texturing though (if it was spheremaped, you wouldnt notice if the planet turned (for the types of sphere mapping i know of anyway)) - relpats eht
Really cool, maybe you could use two textures and rotate them with different speed. This could make a nice cloud/height effect.. - Pavel Hilser
Marvellous! - Dennis Busch
This is very impressive stuff--especially for a Speedhack.

Anyway, I noticed something: The planets appear to wrap, rather than rotate. What I mean is, once a point reaches the left side, it immediately appears again at the right--rather than go behind. So I suppose the width should be doubled.

To end on a good note: The double-texture effect is really nice. I don't know why Pavel didn't notice. - Gideon Weems
Gideon:

Well, it's not for Speedhack. The original was for SpeedHack, this planet generator will be featured in the extended sequel.

And yup, I know about the wrapping, I designed it that way. Most people don't notice, and the texture size is halved (512 KiB for two textures instead of 1 MiB). I'll think about changing it in the game, though. - Jakub Wasilewski
Wow! Really nice!
If you use height maps to generate that, you can do some bumpmapping to make it look even better! - ABC DEF
The key problem was appearing on my machine as well! I have a P4 2Ghz 512MB RAM and a GeForce 3 Ti200 graphics card. It started working after a while though!

Really nice! I am impressed as h--l! :)

It would be cool if you could have flashes around some (like electricity) or fire that bursts out from some. And perhaps some where the texture is a bit more different, using some other texture generation algorithm on some planets perhaps? Just suggestions! You are da'man! - Kent Larsson
The keys problem is a lurking bug in AllegroGL, something to do with the window not having focus yet when the keyboard is installed, or something.

Pavel Hilser: it already does that ;).
Kent Larsson: (I'll never get used to expanding kentl ;P). I plan to add flashes, waves and more complicated forms of animation once I have the important parts of the game done (then I'll toy with pretty stuff)

Someone asked how it works. Well, basically, I have a heightmap generator, tweaked to provide tileable terrain. I translate the values provided by it to colors in different ways, which results in rocky/earth-like/gaseous/cloudy textures. Then, one or two of those texture are mapped on a sphere (which is really done in ortho for gameplay reasons ;)) and their u coordinate is changed over time. The atmosphere is a simple gradient. - Jakub Wasilewski
It looks a bit like Populous: The Beginning. And that's not a bad thing ;) - dthompson
Don't forget gas clouds also! They do not have spherical shape so it might be harder. .. Hm, I think that there are gas clouds in space. Would be cool to have them even if they don't exist "up ther". :) (and kentl never felt like "me", you can just call me kent and you save one character also!) - Kent Larsson
I like, I like. :) - Gnatinator

I'm very very sad. The linky no clicky no worky no more.

http://behappy.boo.pl/starsurv/files/pgdemo.exe connection refused. :(

If you're around Jakub, I'd love to download this and try it out. Could I borrow the source to compile it with 4.4? I don't have any alleg42.dlls lying around.

- Edgar Reynaldo
This section is only available to registered Allegro.cc members.



The Gallery | Add your own image!
Poll
Is grammer and spelling important?
View Results