Search Unity

Question Performance impacts of scaling entire world?

Discussion in 'World Building' started by TzuriTeshuba, Feb 21, 2022.

  1. TzuriTeshuba

    TzuriTeshuba

    Joined:
    Aug 6, 2019
    Posts:
    185
    I have been facing a dilemma recently. My scene is large, utilizing positions within 5000 units of the world origin. Should I expect to see a boost in performance if I were to scale everything down? This would entail scaling down sizes of objects, distances between objects, speeds, forces, etc. Ive heard raycasts are more expensive over larger distances. Not sure what other factors to consider. Any tips / relevent knowledge is appreciated!
     
  2. joshuacwilde

    joshuacwilde

    Joined:
    Feb 4, 2018
    Posts:
    731
    Raycasts are expensive over large distances because they are traversing a large chunk of the scene graph (the collection of all colliders in the scene). Nothing will change by just making things smaller, as it is still traversing the same amount of scene graph.

    You need to profile and figure out exactly what is causing your performance issues. Otherwise you will waste your time guessing what could be causing the problem.
     
    TzuriTeshuba likes this.
  3. TzuriTeshuba

    TzuriTeshuba

    Joined:
    Aug 6, 2019
    Posts:
    185
    Thank you! been spending the day playing with the profiler and testing things. Also verified your raycast claim, imperically at least.
     
    joshuacwilde likes this.
  4. BrandyStarbrite

    BrandyStarbrite

    Joined:
    Aug 4, 2013
    Posts:
    2,076
  5. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    1,759
    Raycasts ARE more expensive over larger distances, as well as other factors. Im guessing you have a 5k x 5k terrain. First thing that comes to mind is, you need to chunk stream the terrain. I deal with large terrains, and its alot of work, and theres many factors involved. You also need to optimize any and all assets heavily. Example, cover that terrain with grass, and watch your fps/ms drop like a rock in water. Scaling things down will do nothing.

    I dont have much detail about your project (Unity version, whats placed on the terrain, camera settings, and tons more), but large terrains really require alot of experience, patience, and most of all, time. My current project is an open-world large scale environment, and performance is great, but the work ive had to do is insane.
     
    BrandyStarbrite likes this.
  6. TzuriTeshuba

    TzuriTeshuba

    Joined:
    Aug 6, 2019
    Posts:
    185
    I did scale down the environment, but not everything. It wasnt for optimization purposes, but gameplay/experience purposes. I did not NOTICE any performance boosts, but I was not measuring too closely (oculus forces 72 fps even if you would perform better otherwise, making it trickier to check especially at the time of post when i was less proficient).
     
  7. TzuriTeshuba

    TzuriTeshuba

    Joined:
    Aug 6, 2019
    Posts:
    185
    Thank you! The concern has become irrelevent since i scaled down for other reasons. The environment never needed to be large, it moreso was a bad convention that carried over from making a couple things large early in the game and future things needed to be proportionally sized. Thanks for the heads up though, good to know for when/before I tackle a project requiring a a large environment.
     
    warthos3399 likes this.