Hi,
I've started a small RTS project and had encountered some interesting problems for which I can't find solutions in the Internet and thus I've made my own algos for solving 'em but I'm not sure that I'm not inventing a wheel (and even that it's not a square wheel ).
Lets say we have a terrain built from a heightmap and with textures applied to it using splatting. There are 4 textures: sand, stone (red), grass, snow.
1. I want to allow construction of buildings only on terrain covered by stone. One of the approaches I can think of is to have a quadtree structure where sectors have boolean value saying if sector is constructible or not. The smallest size of quadtree's region is a size of smallest building's aabb. This boolean value in quadtree tree node is set according to color of region of pixels in splatting texture (if all pixels are red, mark this node as one in which building construction is allowed).
2. I have a vehicle and I want to change its speed according to terrain type (for example, on sand vehicle's speed should be reduced by 0.4, etc.). So I need to know on what terrain type vehicle is on. I thought of checking splatting map's pixel color in the current position of vehicle but I'm not sure this is a correct approach.
So guys I need your opinion, if described solutions are good or I'm inventing square wheel. Any help will be much appreciated.
Thanks in advance