applying a grid to game terrain

hello all

my friend and I are making a game using unity and blender and we are trying to figure out how to apply a grid over the terrain we texture paint. we are looking to have a grid based system for moving characters on a board, similar to chess or the shining force series for those who recall it; each turn, a unit may move so many spaces so displaying a grid is a critical component of the UI. so far, I have been able to apply a grid by having it as a uv mapped plain with transparency where the grid is not visible. I have not, however, worked with getting the grid to line up with terrain that is elevated, etc. so far my best guess is to have a subdivided plain w the grid uv map, subdivided with clothmode on. I suspect that this may work, but I am afraid of what this will do to the polycount, and whether adding cloth physics will gum up the processor. Please let me know if you have any idea on how I might do this most effectively. Thanks so much!


First off, you should probably post in the game forums, there your voice can be heard by the other folks, which have probably more knowledge than me.

So what you describe is not as easy as it may sound and there are several ways to do it. You will want to seperate the grid visually and programmatically perhaps. However, using nodes you can add a second alpha texture on you terrain. That way your gridd will “lay” over you terrain texture. You could also use a vertex-grid and lay it over the terrain using a shrinkwarp-modifier and shading it via the wire-shading, so it give a slightly nice 3D-effect.
Programmatically you could just give your players the “possibilty” to move x units, not more or less, so you can be use they will stay on your grid (however, you need to tweak this, for example at the border of the grid or when players are collding).

Doing some Python coding it is even possible to visually and gameplay-wise program a grid, search the game forums for it there are good examples!

And Cloth wont work in the game engine, also consider to reduce the polycount as much as possible - and if you want for whatever reason want to simulate cloth you can use the soft-body physcis.
Hope that helped,
Cheers :wink: