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
  3. Dismiss Notice

Question Open street map data + tiling in unity

Discussion in 'Editor & General Support' started by kmaxi, Nov 9, 2023.

  1. kmaxi

    kmaxi

    Joined:
    Nov 14, 2022
    Posts:
    2
    Hey there!

    I am, for a scient project, creating a 2D game where the goal is the plan trips throughout a real city (Göteborg), going to have different ways of getting around (walking, bus, trams, e-scooters), but I do have some problem getting the first part of this game started, getting the real world data.

    I first of all need some tiling system to show the city map, then I need to get the street data so you can click on points close to you on a street which you can walk to and lastly it would be cool to get the bus/tram station names which are included in OMS.

    I preferably want to make this game offline so that it does not need internet connection, and for that I have downloaded the entirety of Sweden as an .osm.pbf file using the Geofabrik Downloads.

    I have no clue how to visualize this. I have tried to read up on OsmSharp but don't get how I could use it to create tiles and correctly extract the data from the .osm.pbf file. For visualization they recommend MapsUI, but that is only for some specefic non Unity platforms.

    Any good ideas of how I can get started?
     
    Last edited: Nov 9, 2023
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    39,321
    Just for the record, what you contemplate is not at all a trivial or beginner undertaking.

    The steps you need are:

    1. the data (you claim that you already have that)

    2. a way to parse the data into meaningful things that you can use to create geometry in Unity3D

    3. code to create visualization in Unity3D.

    4. some kind of walk-around character controller

    Step #2 can be accomplished by you integrating a library that does it for you, if such a thing exists, or you can roll your own decoder and reader.

    Step #3 is basic Unity3D procedural generation, and there's tons of tutorials on doing that.

    Step #4 has ten million Youtube tutorials out there, probably a million for every popular game engine.