- Home /
How to programmatically embed data into 2d terrain through color + heightmap data?
Hello everyone, I wasn't sure exactly how to search for current solutions to this problem, and i'm sorry if you have seen it answered before...
I was looking for algorithms/insight into how to take a terrain generated from a real world map source (in my case, open street map), and then use the color + heightmap data to generate and store gameplay variables across the terrain.
This would include things like: Terrain "difficulty" (movement speed modifier), Terrain "cover" (how difficult it is to see entities on this terrain), etc...
What would be the best way to go about this? Would the solution of subdividing the map in ~1m/1m squares, sampling the average height from the heightmap + colors from the terrain, and then storing those squares as a large array/dictionary for future reference be the way to go?
Any examples or suggestions would be very much appreciated.
To my knowledge, OS$$anonymous$$ doesn't expose height information?
It would be used alongside a heightmap pulled from the Natural Earth database.
Your answer
![](https://koobas.hobune.stream/wayback/20220612091122im_/https://answers.unity.com/themes/thub/images/avi.jpg)