- Home /
Creating a 2d RPG terrain tilemap from earth map/imagery?
Hello all.
Simply, I would like to produce a tile-map based terrain/world-map that is directly correlated with real-life terrain from different parts of the earth.
In the game, the far-zoom image used would be a earth image that has been post-processed to fit the game's art style... at near-zoom, traditional tiles would be used for the terrain. Tiles would be created using tag information from open street maps (eg. points on a map marked as being forest would have mainly "forest" tiles and tree cover..)
I've been looking around, but have not been able to find any previous questions here on what sort of algorithms/methods might best be used to create a tile based terrain from an earth map from open street maps. The closest example I have seen thus far is this: http://8bitcity.com/map# .
Some of the challenges i'm thinking about would be how to represent height between tiles correctly, and how the transitions between different terrain types should be handled (especially slopes and such..).
Has anyone seen papers/tutorials/examples of others utilizing real world data to produce tilemap based terrain?
Thanks for your input. :)
Your best bet is to put the data into a multidimensional array with each index the height of the terrain, that way you can loop over it and render the terrain based on a heightmap. Then you just need another array which will keep data like objects and trees etc and do the same.
Answer by toddisarockstar · Jul 11, 2017 at 03:29 PM
you need to find proper "height map" images. here is one i pulled off a top google result for an example: link text
this one is from Nasa. conveniently all Nasa's images are copywrite free:)
anyways if you dont know what a height map is, its a picture that represents height by how light/dark the pixels in the picture are. So what you could do line up the pixel coordinates in a height map texture to your games tile coordinates and raise there positions based on how dark the color info in the corresponding pixel is.
Actually instead of using "tiles" more common practice would be to raise points in a mesh.
Since the design is to go with a 2d tile map, mesh wouldn't be used.. ins$$anonymous$$d, an illusion of 2d would need to be created using shading.
I understand regarding the elevation data, but I think the main thing for me is how the OS$$anonymous$$ data and it's tags could be used to produce a tile map similar to the 8 bit city example I shared. Not sure how OS$$anonymous$$ data could be traversed to produce a data structure that could be used to set up a tile map.