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.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

How to design your game for a big map simulator game in Unity? (and making it a stable)

Discussion in 'Game Design' started by AlanMattano, Aug 15, 2015.

  1. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,500
    Hi, I'm trying to make a simulator game. And I'm not reading a lot on this subject (cant find a solution link)
    I have the problem that my character and vehicle start shaking and moving in my map.
    What i was looking is that in space simulation is possible to make a planet small and large.
    I'm making a 2000km map and in my case this is not possible to make smaller the planet.

    I'm loading the maps but i can't reach then with out vibrations and shadow flickering.
    I was thinking to reset them but this means moving all my world, and fixed rigid body.
    I did not try this solution. Before starting,
    Is there a common typical solution for this?
    Same tip, info idea or link to other talks about can help.
    Thanks
     
  2. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,500
    Solutions
    • Infinite world , when the map finish you start in the opposite side.
    • Map scaling. When you go up the world is smaller
    • Making all smaller in scale. Example 1unit = 10meters.
    • Reset the player to the origin and moving the map
    • Changing the quality tolerance of the position float. Using double
    • Moving the object by custom physics code
     
    Last edited: Aug 19, 2015
  3. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,848
    Generally for a very large world you need to reset the player to the origin and shift everything around him. This is because of the limited precision of floating-point numbers. The further you get away from the origin, the less precision you will have; this is an inevitable result of how floating-point numbers are represented.
     
    Kiwasi likes this.
  4. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    It's definitely floating point precision. The problem occurs whenever you use small numbers, like the distance your character is trying to move each frame, along side large numbers, like the distance from the origin.

    The common solution is to eliminate the big numbers by restarting your character and scene at regular frequencies.

    For a more indepth discussion check out the Unite video from the Kerball guys. They deal with a physics enabled spaceship across interplanetary distances. Some of their tricks are quite clever.
     
    JoeStrout likes this.
  5. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,500
    Thank you both for your support!

    Unity Video Kerball

    If you mean often, i get it. It makes me think about fixed time, or regular frequencies instead of space distance.
    Space I 'm using is 5000 Unity units , is there a better distance?
    There reason why I put it in game design and not in code, is also because I'm looking for a more open metaphysical ideas or solution. I do not believe that in reality the world moves all for me, resetting my space. It looks like all the world moves around us but in a fix way. In general what works in reality, can fit better in game (obvious is not a constant and fixing power problem is needed). There may be a solution, something less obvious but simple. Resizing what is farther away or for example flipping the world " x,y *-1 ". And at the same time moving the world! uuufff. Or moving the decimal floating point.
    Did you try in your game to move all objects in one frame? I do not even try. :cool:

    002_SoaringSimulator_Alpha2014.jpg
     
    Last edited: Aug 16, 2015
  6. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,848
    I'll admit, I don't get most of what you're saying. Sounds like late-night metaphysical fluff to me, but perhaps that's because I've just gotten up and not had breakfast yet.

    However, as to moving all the objects in one frame: sure, why not? Assuming they're all under one GameObject ("World" or whatever you want to call it), you only have to adjust the position of that one object, and all its children are efficiently moved along with it. (Because Unity only keeps track of local positions, computing global positions on the fly as needed.)
     
  7. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,500
    Yes, I will make an experiment moving as you say. I will multiplying by -1 the player to go to the opposite side of the map. And *-10000 the "World" to move all the scene Game Objects. Or what is feasible as similar solution
     
  8. 12.3.cj

    12.3.cj

    Joined:
    Aug 18, 2015
    Posts:
    2
    i am trying to make a trucking simulator game but i don't know how to do it
     
  9. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,848
    OK, I see that you're new — welcome to the Unity community! We're a friendly bunch, but here are some tips to make the most of it:
    1. Start your own threads; don't hijack somebody else's.
    2. Start 'em in the right forum. That's likely to be the "Getting Started" forum for a while. Definitely not the Game Design forum. (This thread shouldn't really be in Game Design either, but... oh well.)
    3. Ask actual questions. Not statements that you don't know something. Unless, of course, somebody asked whether you know something, and you're just answering them!
    4. Be sure your questions include a description of what you've tried so far, what you're thinking about trying next, and what obstacles are preventing you from trying it.
    5. Capitalize the first letter of each sentence, as well as the word "I" (always), and give the punctuation keys on your keyboard a little exercise at the appropriate times. Yes, it matters.
    And be of good cheer, because you're embarking on a very rewarding journey. Follow these guidelines and you'll be sure to get plenty of help on the way!

    Cheers,
    - Joe