Is there any Tutorial of how to set up a Grid only with Blueprints?

Hello,

iam trying to set up a grid map (hex- or squarebased) for a turn-based movement system.

But there is actually no tutorial to this. By now i watched around 100 tutorial videos and learned alot (i know how to spawn different units with different attributes, AEO dmg, destructables etc) , but i still have no idea how to set up a gird-bades map. :frowning:

The only semi-usefull thing on youtube for this are the ā€œAdvanced Turn Based Tile Toolkitā€-Videos. but they actually give no tutorial of how to set up a grid map from scratch. they just show how to use the toolkit (wich i bought).

So does anyone have an idea what would be the best way for me to learn how to set up a grid-based map?
i dont even know where to start :frowning:

greetings
VoodooDog

i just foud this unity tutorial: Civilization/Dungeon Tile Movement & Pathfinding

where he creates an actually grid map. i think that might me usefull as sort of a starter point.

if anyone has a better idea for me, please feel free to write something.

here is another, even better, tutorial from the same guy:

i think that might be helpfull to some

Hey VoodooDog, the part of my toolkit where I spawn the grid is in the construction script of BP_GridManager. How I do it is that I first populate a grid of vectors (the Vector Field Array) with the locations of all tiles in my grid. For a square grid this is pretty straightforward. I set the location of index 0 to (0,0,0), the location of index 1 to (200,0,0) (assuming a tile size of 200 cm), index 2 to (400,0,0) etc. When I get to the index that is as high as the width of my grid I reset the X distance to 0, set the Y distance to 200 and then keep increasing the X location by 200 for each index again until I reach GridSizeX * 2 and so on. For a 3*3 grid this creates an array like this:

0;1;2;3;4;5;6;7;8

it might be simpler to visualize like this:

0ā€¦1ā€¦2
3ā€¦4ā€¦5
6ā€¦7ā€¦8

Then I run a foreachloop on this array and spawn an instanced static mesh of a tile at each of these locations (Iā€™ve included the option of spawning regular static meshes or using a texture instead, but ISMs are probably what youā€™re looking for). Thatā€™s basically al there is to it. Hex maps are a bit more tricky, but it just comes down to some simple math when you add locations to the vector array.

Have you looked through all my tutorials, though? In my fifth tutorial I go through and explain every single blueprint in my toolkit (so you could theoretically rebuild the entire thing from scratch just by watching it). The video is very long, though, so I donā€™t blame you for not watching all of it. Here is a linkto the bit where I describe the construction script of BP_GridManager, which includes the code I was describing above.

I hope that helps you spawn your grid. Let me know if you run into any problems :slight_smile: