Search Unity

GTA Style GPS navigation system

Discussion in 'Navigation' started by albaocram_unity, Jul 7, 2018.

  1. albaocram_unity

    albaocram_unity

    Joined:
    Apr 30, 2018
    Posts:
    1
    So I am making a uber simbulator that requires a gps system. The current size of the map I am using is roughly 650m x 450m. I tried using A* but the game would lag as there are too many nodes. I tried looking up how Grand theft auto handles its gps system as their map is incredibly large.

    Can anyone help/explain how to create a gps?
     
  2. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,770
    Which GTA? 1,2, SA, later? In 1 and 2 are small maps and easy you can use x and y (3D) coordinates. Or xyz (3D). If you consider maps bigger than 10 km squares, you got 2 options. 1. Scale down the map so 1 meter = 0.1 unit or less ( risking loosing resolution tho).
    Or, using floating origin.
    Later GTAs games (I think past GTA SA), as cities grow, they used own engine. So I don't think they need of use floating origin. They probably can handle nicely doubles. While Unity3D uses floats, for positioning GameObjects.
     
  3. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,277
    If you want to use A* for a large world, I would advise splitting the navmesh into chunks, then stitching them together during runtime. This is doable since you can save/load individual tiles of the navmesh :D

    And yeah, another issue that's sort of unrelated but also a important is the floating point origin issue. There are a few addons for that, I am not sure the solution of that.

    However I would advise not shrinking down the units, since that would break physics calculations.