Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

How can I make extremely huge terrains in Unity? It seems like I can set width and length to large values. But the Heightmap resolution only goes up to 4097 and the Detail resolution only goes up to 4048.

Any ideas?

share|improve this question
    
I'm sorry for being a buzzkill: sol.gfxile.net/mmorpg.html –  Nailer Aug 8 '11 at 8:37
add comment

2 Answers

up vote 13 down vote accepted

Split the terrain into square "chunks", load those you care about (mostly: Those near the currently active camera) in Update() and - if you are strapped for space (you likely will be), unload the not needed ones far away.

Use pre-calculated low-poly models for far-away terrain LoD, unless you don't mind having a low view distance. Also, if you need the terrain heightmap of far away terrain for anything (like NPC movement or some other simulation), create a low-resolution or variable resolution variant of your terrain to keep in memory; don't use the full terrain data for it. This can be done automatically on game load, but generally it's a better idea to make a tool which creates this pre-generated data during the build or package.

Finally: To avoid floating point precision problems, you'll have to reposition the whole scene every time your main camera moves far away from (0.0f, 0.0f, 0.0f).

Possibly relevant question on Unity Answers http://answers.unity3d.com/questions/17225/dynamic-terrain-loading.html

share|improve this answer
    
Thank you! great answer. Just one question, when I set the neighbors of the terrains, what would happen if the terrains aren't at the same height on the edges? –  Dan the Man Aug 6 '11 at 19:03
1  
@Dan: You'll get holes in the landscape. There are different ways of dealing with this, roughly along the lines of "make sure the landscape has same height at the edges", "add skirts running vertically from the edges down for some height to mask the holes" and "add generated triangle strips to stitch the holes together." Which one you use is up to you (and the engine, in part). The second one, with the skirts, is the one I saw most often. –  Martin Sojka Aug 6 '11 at 22:05
1  
or as I said, you'd like to use a script to seam the terrains :-) –  Valmond Aug 6 '11 at 22:54
    
Thanks guys, I love this site –  Dan the Man Aug 7 '11 at 18:09
    
Does anybody have any scripts? –  Dan the Man Aug 7 '11 at 18:09
show 1 more comment

You'll need to break up the terrains in chunks, ie. several smaller terrains. Yo'll need to 'seam' those agains eachother (with a script) so there won't be 'holes' between them but otherwise you can just start doing them right away.

You might want to know too that since Unity3D ~3.0 you can't move items (read terrains and items) too far away (like +/-100000 steps IIRC) so this will influence the maximum size of your world.

I'm using this in my online RPG game anyway (with the exception that I only use Unity3D for level design, not for the actual game).

Just because I'm curious, would you like to share some info about your game (like advancement, type, graphics, style etc.)?

share|improve this answer
    
Thanks for the answer! My game is basically an RTS MMO. which is quite a crazy idea, but I'm going to see if I can do it. It is set in the middle ages. I'm trying to get the graphics to the highest quality possible. =D –  Dan the Man Aug 6 '11 at 19:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.