Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Google Maps Integration for Real World Race Track

Discussion in 'Editor & General Support' started by FadedMediaEmpire, Sep 7, 2023.

  1. FadedMediaEmpire

    FadedMediaEmpire

    Joined:
    Sep 7, 2023
    Posts:
    1
    Good Evening Everyone,

    New developer here, glad to be apart of the community, is it possible to take the information from Google maps and make a race track in a car chase video game. For example like how need for speed has tracks and they are pretty close to the roads in real life. Is there a way to do that in Unity?
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    39,005
    Everything is possible.

    For a while there was a WRLD plugin for Unity but I think they don't support it anymore.

    If you want to explore the problem space, get yourself over to Google and make an account and get an API token to pull down Maps data. All of that is very well-covered in their docs.

    With that, set Unity aside and work through ALL of the NON-Unity steps necessary until you can swagger / curl / Postman against that endpoint with all the auth tokens and whatnot and stream some map data back. (see below for more)

    Now begins the interesting engineering part of how you might convert whatever is in that map data (see Google docs for more details) into something that meets your specification of "Track."

    Paste in the data that Google sends you and begin parsing it in Unity and doing whatever you think is the thing to make what you consider a "Track."

    And you're off. Easy-peasy!

    ----------------------

    Networking, UnityWebRequest, WWW, Postman, curl, WebAPI, etc:

    https://forum.unity.com/threads/using-unity-for-subscription-lists.1070663/#post-6910289

    https://forum.unity.com/threads/unity-web-request-acting-stupid.1096396/#post-7060150

    ----------------------

    If you need examples of simple procedural geometry creation, see my MakeGeo project.

    MakeGeo is presently hosted at these locations:

    https://bitbucket.org/kurtdekker/makegeo

    https://github.com/kurtdekker/makegeo

    https://gitlab.com/kurtdekker/makegeo

    https://sourceforge.net/p/makegeo
     
    Last edited: Sep 7, 2023
  3. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    6,410
    Also worth mentioning that OpenStreetMaps may have better and/or cheaper data for your purposes. There are even more map services too. OSM is what we often referred to many years back because back then Google Maps had terribly restrictive terms and/or high price point.

    Just to set expectations straight: if you use the road map data, all you get is essentially a graph of connected points, a number of connected lines, maybe with the information on how wide the road is (not sure).

    You can make those lines appear as a road but curves will require tesselation otherwise they'll look rather chunky, and there will be no tilting of the road (eg in corners where the pavement is often tilted inwards to allow for faster traveling around the curve, like in those oval racetracks).

    And of course there is little to no road pavement information. You also get no environment, the satellite map is a flat top-down texture which is of no use if you put yourself in a 3d world position. You may be able to make a terrain and some basic elements (trees, houses) out of the height information and perhaps statistics data for where houses and buildings are (which may come from a separate database) but all of that will look rather dull.

    The NFS and any likewise road racing games were made by 3d modellers working off of photographs or at best selected 3d models or scans of key areas.

    For probably a lot of money you can even buy or license actual 3D data of key places such as the Monte Carlo ring - however you'd also have to license the usage of those landmarks.

    Curious, I checked if I could find any satellite map racing game but as many years ago the landscape hasn't changed, and at best you'll get a vectorized 3d landscape or 2d topdown driving simulator like this one:
    upload_2023-9-7_9-48-9.png
     
  4. Tawilleni

    Tawilleni

    Joined:
    Apr 12, 2024
    Posts:
    1
    It's great to have you here. To answer your question, yes, it's possible to use Google Maps data to create a race track in a car chase video game, similar to Need for Speed. Unity provides tools and plugins that allow you to integrate Google Maps data into your game. You can use the Google Maps API to access real-world map data, including roads and terrain, and then use this data to create a realistic race track within your game environment.
    For more information on how to integrate maps into your CRM, you can check out crm map integration. Integrating maps into your CRM can be incredibly useful for visualizing data, tracking locations, and improving overall efficiency.
     
    Last edited: Apr 19, 2024