Page 1 of 1

Infinite Terrain?

Posted: Tue Mar 13, 2007 6:04 pm
by CuecaX
I want to make a infinite generated terrain...

but i have no idea how to start making this :(

Posted: Tue Mar 13, 2007 7:05 pm
by arras

Posted: Fri Mar 16, 2007 4:09 pm
by stodge
Do you have an infinite hard drive and inifinite memory?

Posted: Fri Mar 16, 2007 10:29 pm
by Katsankat
Generated procedurally... HDD = nearly 0 well just a few procedures compiled
somewhere. Memory : a two dimensions array of unsigned chars... I guess memory can handle this.

Other option, do your world as a planet ... One can travel forever... infinitely.

Posted: Sat Mar 17, 2007 7:12 am
by Baiame
^ But the point is that it can't be infinite. The values you use to seed a pseudo-random number generator with have to come from somewhere. It could be to all intents and purposes infinite (i.e., it'd take more than a lifetime to visit all locations), but never truly infinite.

Anyway, I'd suggest generating heightmaps for large areas using perlin noise, then the diamond-square algorithm for more detail closer to the player (not because I have experience with that kind of thing, but because that's what Flavian uses in Infinity.

Posted: Sat Mar 17, 2007 11:37 pm
by roxaz

Posted: Mon Mar 19, 2007 7:19 am
by pinballwizard
Or check out Klasker's demo at http://www.wc3jass.com/asger/page.php?10 and ask him for some hints :)

Posted: Mon Mar 19, 2007 9:54 am
by BlindSide
Damn I get a 404 when downloading Klaskers demo :?

Posted: Mon Mar 19, 2007 11:11 am
by Klasker
BlindSide wrote:Damn I get a 404 when downloading Klaskers demo :?
Thanks for reporting it. Fixed the link.

It is quite difficult to generate an infinite AND seamless terrain with random trees, grass, and textures. I exported CTerrainSceneNode from the source and added a method for loading the heightmap from an array of floats. Kind of silly that it didn't have it already. Whenever the player reached a certain distance to the edge of the terrain, I regenerated the terrain again centered on the player. The real trouble is no avoid any kind of "snapping" errors and textures moving around slightly after a new terrain was placed.

I suggest you start out with creating a randomly generated terrain of fixed size, and then move on to seamless terrain if you feel you got the upper hand of it.