Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Biggest Terrain Size Unity Can Handle?

Discussion in 'Editor & General Support' started by DarkXess, Oct 23, 2016.

  1. DarkXess

    DarkXess

    Joined:
    Sep 30, 2014
    Posts:
    136
    Hey guys, just wondering what the biggest terrain size so far Unity has brought to life in a game? or can it / will it handle such sizes of maps like GTA 5's Los Santos for example?

    Is there actually any kind of cap on the size of a map you make? or you can make as big as your wild dreams desire?

    Thanks :)
     
  2. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    It's worth noting that GTA 5 can't handle a map the size of Los Santos either. Instead it's the same old smoke and mirrors trick. Load stuff that is close to the player. Use LOD systems for everything else.
     
  3. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,884
    In otherwords, use multiple terrains and then use LOD for the stuff near you, etc.

    Which can get tricky, such as in GTA 5, flying in the air you can see quite the distance. But this is where you get into learning how to do a mirage per se. It's there, but not really there, but because it's at such a long distance, you can sort of trick the illusion that it's there... I'm sure there's plenty of other ways to do it, just gotta learn to be creative and find what works for your situation.
     
    Kiwasi likes this.
  4. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,554
    Actually the good idea would be to restrict map side to about +- 8 kilometers from origin. Because of floating point errors.

    GTA does not hold the whole map at full resolution all the time, and instead loads it in chunks, while keeping very low resolution chunk for distant objects. In GTA the data is being streamed as player moves around.
     
    angrypenguin and Kiwasi like this.
  5. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,614
    I was playing around with this over the weekend for a game prototype I'm working on.

    Using MapMagic from the Asset Store it's easy to get an "infinite" terrain going. In my game the player moves fast, but I could still have a grid of terrains surrounding them for several kilometers in each direction. There's challenges there, but I'm pretty confident they can be overcome.

    That's the easy bit, though.

    This is the real challenge:
    If my game was just about flying around really fast then I could probably play with the vicinity of +- 100km without worrying about precision issues. I'd lose precision, but at high speed that's not a big deal. The catch for my game is that you also explore places of interest, which is done at low speed and needs a fair bit of detail. When doing this far from the origin standard precision floats don't provide enough precision, with noticeable effects such as physics jitter becomes.

    This necessitates recentering. I'm not aware of any built-in systems in Unity to help with this. I whipped up a prototype of a manual recentering system yesterday, which works in principle but revealed two (fairly predictable) sets of issues that then need to be worked around:
    1. Introduces glitches into anything that does calculations in world space, such as particle systems and line renderers. (Surprisingly, it didn't obviously break physics when recentering occurred, but I haven't looked closely for anything subtle.)
    2. The performance hit of doing this for every object in the loaded portion of a large world.

    The first question is how big your world needs to be. When you're answering that, consider also how you're going to fill it with content - there's little point having a universe of space if it's empty. The space that normal floating precision lets us use without issue is already pretty big - even most AAA games wouldn't go past that, so ask yourself if you really need to.
     
  6. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    I've found physics tonne surprisingly resilient to moving every object in the scene, even every frame. It's when you move some and not others that physics glitches.
     
  7. DarkXess

    DarkXess

    Joined:
    Sep 30, 2014
    Posts:
    136
    I thought all games do this, not only GTA 5, its common in open-world games right? so its understandable. So this is one way I can think of looking at :)

    You mean like the answer above^? using LOD's ? or how would you call it the method your saying so that I can look it up further and see if its possible for what I want to do. Thanks :)

    At the moment I was thinking of "World Streamer" which ive already purchased: https://www.assetstore.unity3d.com/en/#!/content/36486 but I was also interested in getting MapMagic too, just didnt know which was better. So hopefully more suggestions will come in on how both compare to what I need, basically to just run a map which is very very big and have no problems :)
     
    Last edited: Oct 24, 2016
  8. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,614
    They do different things. One is a procedural generation tool, the other is a streaming system.

    Though World Streamer claims to have solved floating point imprecision, so I might check that out.