Open street map data + tiling in unity

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?

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.