MarioMap

Procedurally generating Super Mario World style maps from real terrain data

It was the middle of exam season, so I thought it natural to get distracted in a pointless side project. Why? Because it looks cool. Here’s the exact style that I’m trying to replicate, for those who are culturally disadvantaged.

yeet

The pipeline will be as such:

  1. Download global terrain data
  2. Crop and resample them to the desired number of x/y mario tiles for the map size.
  3. Use the terrain at each tile location to decide the choice of sprite.
  4. Try my absolute hardest to not make it look like a glitchy mess.

The main data used were:

And of course I should include the sprite map upon which this entire project is reliant.

Spritemap

Anyways, who cares about how hackily it was actually constructed, here are some results. For demonstration purposes, I’m doing North America in low resolution. The global runs at a jacked up resolution are at the end.

First, working out the basic land type and elevation. Easy. The hard bit however is resolving the hundreds of literal edge cases. Anyways:

land

Nice start. Then add cities and roads. And the background sea but that’s boring. Cities are placed in their approximate spots and filtered by proximity to other settlements and population rank. The roads are cheeky: they’re generated by finding the minimum spanning tree for all the cities, and then by drawing each connection as a separate horizontal and vertical leg.

land

Nice. City placement looks a bit dodgy still, but it resolves itself when the map is scaled up. Now to add trees. This is based on land cover again, and takes into account the underlying terrain. Where possible, a group of small trees is upgraded to a random-height big-headed tree thing. I don’t know what it’s called, I haven’t actually played SMW.

land

The final step is to haphazardly add some bridges. The criteria for bridge placement was completely heuristic, so it looks a bit strange in places, but whatever. Here’s the final output for this small map.

land

Cool. Now to jack up the resolution.

North America

usa

The entire ruddy world

world

Europe

world

South-east Asia

world

The world again but bigger

world

So yeah, that’s that. Bit of a fun side project. Enjoy the eye candy.

FAQ