V0.0.1 The Tile Map


The Problem

One of the issues that I ran into this week is figuring out how to implement a tile system in Unreal that will work with our game design and also be versatile in the event we choose to expand on it for our game mechanics. The Tile system needs to have Nodes that can be used for Path finding algorithms like A* or more simple ones that will be implemented in our game. 

 The Solution

To start setting up our project to use tiles I had to first come up with some of the necessary things and parameters that need to be used which entailed a good amount of research and also some examples I was able to find online. In this case we need to instantiate a given amount of tiles based on the desired Row/Column amounts. Because of this I determined an Actor would be a solid choice as the parent class for both the Grid Map and the Grid Nodes.

The Grid Map will have the Amount of Rows and Columns it will have a Blueprint wrapper so that we can assign the rows and columns on blueprint which will help with the level design offering a bit more versatility. the Grid Map will also be in charge of Spawning the GridNodes and the overall Grid. I also have to add the offsets for the grid spawning in this case for simplicity we agreed to use a square grid.  I will use a nested for loop to instantiate the grid and to keep track of the index numbers for each node. 

Now for the Tile Nodes there are a couple of things that these will need. 

We need 2 meshes one that will be the default mesh and one that will be the grass mesh. The mesh will be determined by a bool value and I made a method to flip them from Default to Grass this Nodes will also have a wrapper on Blueprint to assign the tile model and it's default and grass mesh. Another thing it needs is 2 specific tiles one will be the Start and One will be the Goal (these will likely use a bool for that) the tiles will also need to be assigned index values when they are instantiated in the GridMap to help with the path finding. Depending on how the path finding goes i may need to add more functionality to the tiles like an HP value or a Cost(terrain) value.

I expect to have more challenges ahead with the grid currently the way i have envisioned the grid its a square or a rectangle shape so if we get some maps with different shapes I will likely need to implement more logic to make that work. However the current progress is promising and I hope I can get the logic fully functional in the next couple of days. 

Leave a comment

Log in with itch.io to leave a comment.