Board Game/TBS Game interactive grid

I’m trying to make a game prototype which uses features of many turn based strategy game. For now a good example is a chess game (ignoring AI aspects). I’m having trouble thinking of ways to create the terrain. Essentially it needs to be a 3d grid, each square of which has to be interactive (presumably ray casting or on mouse effects).

To do this, does each individual tile need to be a separate game object? And then is there an efficient way to construct all of these game objects into a seamless grid?

If anybody could point me in the direction of a relevant tutorial or try to suggest ideas themselves, I’d really appreciate it :slight_smile:

I know its quite late to answer this question for you, but just in case…

In short, there are 2 major ways to do it:

I. make every “tile” a gameobject. Will work smoothly with small-mid sized grids.

Pros: Very easy setup with raycast or even OnMouseEnter/Exit(not recommended) for the desired functionality.

Cons: During my testing the game started to slow (on my rig) when I generated more than 200 x 200 tiles (which makes 40000 gameobjects) and rotated the camera or zoomed in and so on. Only recommended for mapsizes under units 100 sidelength.

Starter Tutorial: Youtube:Turn-Based Tactical Game Tutorial


II. Have a map composed of a single mesh, a plane, several meshes or whatever. In this case you will have to convert the Vector3’s out of the raycast into your tile coordinates.

Pros: You are much more flexible once the basic setup is done, since your graphical representation is not directly coupled to your grid logic. I recommend writing a function to do the said conversion for you, because you will need that functionality a lot. This Way has also the much better performance.
Cons: You will have to setup this first.

Extensive Tutorial on Tile Maps (really very interesting):

Youtube:How to generate TileMaps, Procedural Textures and all kinds of interesting stuff.