Syed Munim Raza
Syed Munim Raza

Reputation: 195

Casting Civilization V based Hex Grid on Unity Terrain and Select Certain Areas of Grid

I am looking for approach for casting hex based grid on terrain which is for now pre-made but eventually it will be procedural for my exploration game where you can scan planet and elements will be highlighted/hex grid selected. What could be the approach towards making this kind of hex grid as my terrain will be un-even.

I have seen approaches like mesh creation, using tile-map, unity projectors but eventually I feel like this should be something using shaders but what about selection?

Can someone please guide me in a right direction.enter image description here

Upvotes: 0

Views: 1728

Answers (1)

Menyus777
Menyus777

Reputation: 7027

I think this topic is more like for https://gamedev.stackexchange.com .

My tips for you:

I think the hexa grid projection can be solved with Unity built in Projector, you can use ortoghraphic projection with it, so it does not matter if your terrain is uneven, also it has a convenient way for selecting which layers are affected only (terrain, your buildings etc...) (The projector, is a shader magic tho, it blends the picture you give it to it, and the layer below it) If projector does not satisfies your needs, im pretty sure there are grid shader already written for unity.

About the selection, i think you could also solve that with projector, or give some trail effect to the grid boundaries? - i guess you gonna still store the boundaries so..

About country borders in Civ:

I think they cast a spline using the hex grid border points, then blend it on the terrain. I saw a shader that could draw lines on a terrain, so you might found it!

Keywords for search: Beziér, Catmull–Rom, Spline, terrain shader

Upvotes: 2

Related Questions