Implementing gameboard space highlighting

I I’m trying to build a a grid based game and I want to highlight arbitrary spaces to indicate things like legal moves, shooting range, attack AOE, etc

My question is how to best implement grid highlighting.

So far I came up with the following two solutions

  1. Make an object for each gameboard space. Then iterate over the chosen board-space objects to change their color, or layer for projection so I can indicate to the player which spaces are different.

  2. Find a way to break up each area I want to highlight into contiguous zones, then create an orthogonal projector positioned and sized so that it highlighted the area I wanted.

Implementation 1 seems like it would be easiest but I think it might cause performance issues as the board increases in size. Implementation 2 seems like a more “elegant” solution but also seems like it would be complicated to implement and I don’t know if I can change my projector shape to hexagon to potentially use on a hex based map.

Has anyone implemented board game highlighting before and if so how did they do it? Links to tutorials or code samples would be highly appreciated.

I am building a Hexagon Grid based game, the solution I choose for highlighting was similar to #1, to create a mesh in the shape I wanted for the highlight to appear and then position/color/show it as needed over top of my grid. This mesh (prefab) exists separately from my grid and is instantiated dynamically based on the number of highlighted grids I needed to display.

TY for the reply. What is the most simultaneous spaces you have tried highlighting and have you noticed any performance issues when switching between multiple highlighted regions?

Currently I’ve only had 2 at the same time, as it was just a proof of concept run at that time. currently I am working on Logic and State Machine stuff rather then “how it looks”
And since its my “hobby-time” work it has taken back burner to Work and Kids :frowning: I haven’t been able to put much time into it lately :frowning:

in the same boat brother

The reason I’m asking is I tried implementing a hex grid made out of objects and I found that when I got much bigger than say 30x30 (900 hex meshes) the grid took a really long time to initialize.

I’m shooting for web player implementation and maybe mobile devices so I can’t rely on having a lot of computing power to make up for inefficiencies. And I know that even if the game is great if it runs like crap nobody will want to play it.

update: I think I figured it out, I’m using a single cube for the base board and a projector with a transparent outlined square to make the grid lines

the highlights will be individual tiles with basic materials using a transparent rendered matching the grid positioned slightly above the battlefield cube

potentially I could use different highlight colors to indicate different information

are you using prefabs?
I have a grid created with over 7000 hexes and it takes almost no time!
My “grid lines” are created by via shader/texture

this shot shows the results a bit better