Archived

This topic is now archived and is closed to further replies.

emmai

how to build INFINITE terrain?

Recommended Posts

I''m now building terrain using ROAM,it''s 1024*1024,and I''d like to build INFINITE terrain,any ideas is appreciated..

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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!"

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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++;

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
You could use a mixed approach. Design terrain "blocks", using heightmaps, and fill the areas outside those blocks with on-demand procedural generated heigthmaps.

Share this post


Link to post
Share on other sites
i''d throw my weight behind that Perlin Noise suggestion above. essentially, create terrain according to an algorithm with random noise in it but, given a seed, that noise will always be the same. This way you can generate terrain on the fly. get far enough away from a spot that it''s destroyed, and when you return to that spot it''s randomly generated again the same way it was the first time.

Share this post


Link to post
Share on other sites
quote:
Original post by monkeyography
This way you can generate terrain on the fly. get far enough away from a spot that it''s destroyed, and when you return to that spot it''s randomly generated again the same way it was the first time.


Now there''s an oxymoron

Share this post


Link to post
Share on other sites
oxymoron yes, but random did not exist in computer, actually there is no fiable method to generate random element, it''s base on fct and fct is deterministic, that''s why if we use a random fct thanks to the seed we could have exactly the same sequence, kinda like the fct hold the memory, but every body know it

/gibberish

>>>>>>>>>>>>>>>
be good
be evil
but do it WELL
>>>>>>>>>>>>>>>

Share this post


Link to post
Share on other sites