Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Randomly Generated Worlds

Author
Message
kynian
12
Years of Service
User Offline
Joined: 1st Sep 2011
Location:
Posted: 18th Dec 2011 04:51
Hello, I was just wondering if anyone had any information on how to create a randomly generated world. For instance when someone creates a new game in my game I want them to be thrown into a random world that was just generated. Can anyone point me to some good resources for this? I've checked Google but I'm assuming that I'm not wording it correctly because all I ever find is info on doing random numbers, not whole worlds.

Thanks in advance for any help.
vitinho444
13
Years of Service
User Offline
Joined: 12th Oct 2010
Location:
Posted: 18th Dec 2011 15:52
well.. ive done a game few months ago with map controlled by files

And in that map there were numbers from 1 to 4

each number (1, 2, 3, 4) was an object.

Of course it was 2d but you can modify it for 3d,i just dont know how.
Then when you have the map controlled by numbers, you can do

int x = rand(1, 5);

PS: I dont know if random in c++ is actually rand() because im in php now and i forgoted xD

Good luck

C++ Medium 3.5/5
VB6 Advanced: 4/5
VB.NET Advanced: 4/5
Hassan
14
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 18th Dec 2011 16:51
can you be more specific? you want a world of boxes or a terrain or what exactly? this is an advanced subject though, don't start if you're not ready

kynian
12
Years of Service
User Offline
Joined: 1st Sep 2011
Location:
Posted: 18th Dec 2011 17:12
Well mainly I was looking to make a random terrain, allowing for random placement of things like trees, mountains, and other such environmental items.
Hassan
14
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 18th Dec 2011 20:12 Edited at: 18th Dec 2011 20:13
mountains are part of the terrain, honestly i have never tried but this might work (seems fine): http://freespace.virgin.net/hugo.elias/models/m_clouds.htm, you will do the perlin noise and then tile some images and merge them, then do an exponential check to eliminate unwanted noise, and then use the final result as the heightmap of a terrain, that could generate endless random terrains

now for the trees, you could use some similar technique and specify white for like, 100% chance of add tree, black 0%, grey 50% (you get the point eh? ), and just spawn trees according to the map

though, i never tried and this is just what i can think of, it could be much more random than expected though, you should add in your touches to achieve your desired results, will be somewhat tricky and could be complex, good luck with that

kynian
12
Years of Service
User Offline
Joined: 1st Sep 2011
Location:
Posted: 18th Dec 2011 20:15
Wow, thanks a bunch for the info! this was pretty much exactly what I was looking for. thanks!
Matty H
15
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 18th Dec 2011 20:43
Someone created a random island generator, you would have to search through the WIP board, it did look pretty cool.

WLGfx
16
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 18th Dec 2011 23:15
http://forum.thegamecreators.com/?m=forum_view&t=191820&b=5

A game I finished complete with the code. Uses perlin noise for the terrain and random tree placement.

There's two verions, GDK and a DBP version.

Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!

Login to post a reply

Server time is: 2024-03-28 08:16:52
Your offset time is: 2024-03-28 08:16:52