how to build INFINITE terrain?

Started by
11 comments, last by emmai 20 years ago
I''m now building terrain using ROAM,it''s 1024*1024,and I''d like to build INFINITE terrain,any ideas is appreciated..
Advertisement
You need to write some kind of function to calculate the height/other things about part of the terrain based on an X and Y value, and then only render part of it at once.

<-- that''s still a link if you didn''t notice
"Gay marriage will encourage people to be gay, in the same way that hanging around tall people will make you tall." - Grizwald
-~-The Cow of Darkness-~-
quote:
"Gay marriage will encourage people to be gay, in the same way that hanging around tall people will make you tall." - Grizwald

Huh? Being tall and being gay is night versus day, thay have nothing to do with each other.

Anyway, I think what your after is called paging. There''s a couple of different methods to doing this. Here''s a link that talks some about paging.

-UltimaX-
Ariel Productions
|Designing A Screen Shot System|

"You wished for a white christmas... Now go shovel your wishes!"
I suggest you simply create your terrain in a way, that it is able to repeat itself over and over (like, the height on the far left is the same as the on the far right, so if you were to copy the terrain and put them next to each other, the transition would be seemless).

Then you should sub divide this terrain into smaller cells, and only render the terrain cell the viewer is standing on, the cell to the upper left, left, lower left, etc:

___________
|XXX|XXX|XXX|
|___|___|___|
|XXX|VVV|XXX|
|___|___|___|
|XXX|XXX|XXX|
|___|___|___|

(V = Viewer, X=Adjacent Terrain Cell)
Lets say you divided your 1024*1024 terrain into 16*16 cells, and the Viewer is standing on terrain 10,10 then you would only render: 10,11 10,9 11,11 11,10 11,9 9,10 9,11 9,9 and 10,10

When the Viewer is on 1,10 then you would render 1,11 1,9 2,11 2,10 2,9 AND 16,9 16,10 16,11 but you would need to move these cells 1024 (in your case) units to the left.

This would create an endless terrain effect. To make it even more less obvious for the viewer, you could add some fog, so he doesn't see whats happening.

I tried it out myself ones, and it worked very well for me. Hope this helped

[edited by - m1o1d1 on April 2, 2004 12:02:18 AM]
quote:Original post by UltimaX
quote:
"Gay marriage will encourage people to be gay, in the same way that hanging around tall people will make you tall." - Grizwald

Huh? Being tall and being gay is night versus day, thay have nothing to do with each other.



OT: True, they don''t, and I think that''s what is being said. Hanging around tall people won''t make you tall, so Grizwald is saying to all the homophobic people that they should apply the same to gay marriage.
Just where would you store an infinite terrain? On an infinitely big harddrive? =)

-=[ Megahertz ]=-
-=[Megahertz]=-
You don''t store it. You have a function that creates the sections you need on the fly. It''s the same idea as procedural textures, which should be more well known.
Yes, perlin noise (or any other common procedural noise algorithm) is probably the best approach to this problem. Memory footprint is also very small using this method. The one downside is additional CPU usage to constantly generate procedural pages, but a friend of mine implemented this very thing in an excellent manner. Procedural noise to build infinite terrain. From what he''s said, the results have been pretty decent.

~Graham

----
while (your_engine >= my_engine)
my_engine++;
Hmmm, i was thinking more like a Delta Force approach, a terrain that repeats itself over and over again. :D

With noise functions, you might get the problem that you can''t design the terrain (if it is for a game) to suite your game. (Delta Force did a great job with their repeating terrain i find )

Or, maybe, for an "infinite" terrain, you could try making a huge sphere with a terrain on it (like earth ) and the viewer might never notice that it''s just a sphere (after all, everyone tought the world was flat...)
Final Fantasy did this, even tough there goal wasn''t an infinite terrain, it still looks very good.
You could use a mixed approach. Design terrain "blocks", using heightmaps, and fill the areas outside those blocks with on-demand procedural generated heigthmaps.

This topic is closed to new replies.

Advertisement