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.
The pipeline will be as such:
- Download global terrain data
- Crop and resample them to the desired number of x/y mario tiles for the map size.
- Use the terrain at each tile location to decide the choice of sprite.
- Try my absolute hardest to not make it look like a glitchy mess.
The main data used were:
- Global land cover data (to inform terrain type): https://globalmaps.github.io/glcnmo.html
- Global terrain elevation data (to inform where to put mountain slabs): http://www.viewfinderpanoramas.org/dem3.html
- City locations: https://www.naturalearthdata.com/
And of course I should include the sprite map upon which this entire project is reliant.
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:
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.
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.
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.
Cool. Now to jack up the resolution.
North America
The entire ruddy world
Europe
South-east Asia
The world again but bigger
So yeah, that’s that. Bit of a fun side project. Enjoy the eye candy.
FAQ
- X map is missing Y feature
- I don’t care, I didn’t make these for navigational purposes.
- Can I use these?
- pls no rehost, and give credit where possible please
- Is this open source?
- Yes and no: this was made in a fat jupyter notebook with no prior planning or direction. It is a collection of ad hoc statements. As such, I wouldn’t recommend looking at it. But it’s on my github if you really don’t value your time.
- What’s the point in this