Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Feedback Open world terrain optimization statistics feedback

Discussion in 'World Building' started by stephenq80, Oct 10, 2022.

  1. stephenq80

    stephenq80

    Joined:
    Jun 20, 2018
    Posts:
    34
    Hello,

    Thanks for reading my post. I'm in the very early stages of building out the terrain for my open world game. So far, I've just sculpted the terrain, applied textures, and planted vegetation. The terrain looks as intended, so, I don't have any issues there. What I am seeking guidance on is what numerical targets I should be aiming for in regards to optimization statistics. The only one that I know of (because I'm also a gamer) is that 60 fps is desirable.

    The terrain itself is 1024 x 1024 and is split into 64 equal sized chunks. I use a culling script to render only visible chunks and vegetation. Also, the vegetation spawning is handled by GPU Instancer.

    The target platforms are mid-to-high end PCs and current gen consoles. The statistics are below.

     
  2. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    1,524
    The stats show your running at 93 fps, but one thing i notice is batches (none saved), which tells me there is no static batching, as your using GPU Instancer for your vegetation. Meaning your relying on GPU, as once you start to add buildings, water, etc. things will change. But your also using a small scale terrain (1024x1024).

    You will have to learn to balance GPU Instancing and static batching as you progress (add objects). If your targeting mid -high end PC's, i think 64 chunks is a bit too much. Again you will have to balance this out as you build.
     
  3. stephenq80

    stephenq80

    Joined:
    Jun 20, 2018
    Posts:
    34
    Thanks for the feedback. You're correct, I don't have anything tagged as static in my project. In regards to balancing things out in terms of static batching and using GPU Instancing, would this method make sense from an optimization standpoint:

    • When possible, cull everything not visible
    • Use GPU Instancing on similar meshes that number in the hundreds or thousands (e.g. vegetation)
    • Use static batching on the smaller number of meshes that have the same material (e.g. similar buildings, identical wall chunks, etc.)
    Would it make sense to also apply static batching to the terrain chunks even though only maybe one or two would be active at a time?

    Thanks for your feedback. Very good food for thought. :)
     
  4. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    1,524
    Ok,
    Point #1: yes, cull everything the camera cant see, per your set distance.
    Point #2: not always, you need to test both GPU instanced, and static batched, as ive seen times/situations when one is better than the other, performance-wise.
    Point #3: again refer to point #2.

    Every game is different, and every targeted platform is different. Take the time to test both methods of GPU instancing and static batching to get the best result/performance. You also mention static batching for terrain chunks, which tells me you are chunk streaming terrain (one of my favorite things, lol): no. Your camera is only rendering/seeing maybe 2-3 chunks, not much more you can do with that (depending on your settings).