Spec-ing out a Game Feature - Real World Maps

A game idea I'd been fleshing out this week gained a new feature - traveling to 'real-world', present day locations. These locations would be represented by stylized rendering of map data from OpenStreetMap.

One project I'll be working on for the next few weeks is a web-based tool implementing a workflow for ingesting OSM data. The tool would output a subset of this data into a custom format usable by my native client / game engine. A rough outline of the workflow will go something like this:

  • Retrieve a section of the world map (Earth) that represents the game's setting
  • Parse this data into distinct layers - land/water, roads and buildings
  • Write engine-level code to render these layers
  • Support a couple zoom levels
    • An overview level with land/water and major roadways
    • A detailed level representing a region or district containing roadways and buildings
  • Support pathfinding for travel along this road network
  • Develop a web-based editor to facilitate retrieving map sections, marking locations on the map, and exporting this data into the game engine

Obviously an ambitious plan, but something that I believe helps immerse the player into the fiction of a game that takes place in a real-world location. Fortunately most of the tools needed to retrieve and parse map data already exist. I've also chosen a web-based workflow solution as a personal project to update my own webdev skillset (it seems Angular and Node.js are old hat - but still very useful - these days...) While researching tools this weekend, I found a couple resources to help realize my idea.

  • Mapzen Vector Tile Service - Retrieve GeoJSON data from OSM sources
  • Three.js - Simplifies WebGL rendering, to be used by our browser-based custom editor to render these maps.
  • React.js - A Javascript browser library focused on the view layer of web applications.
  • A tossup between Node.js and Golang for writing the backend.

Ultimately the goal of this project is to generate data ingested by the C++ game engine, and used for pathfinding displaying the map.

I know this post briefly touched on the technologies involved. Perhaps I'll be able to go into more details as they come over the next few weeks.