Linked Objects Calculate Path Issue

Hello! I am having issues calculating multiple path distances using the linked objects pathfinding. With my current events, the path to the first object is always calculated, but after the first one it breaks and returns a distance (node count) of 0. I have got this exact block working before, but this has always been very buggy for me to work with. I feel like I am doing something very wrong. Any input would be appreciated!

Cant help you with these nested repeats/linking and creating and picking instances. As an alternative i would suggest to use pathfinding behavior.
A. Create a object with pathfinding behavior with your cellside (say 10pixels each cell)
B. For every cell in a radius around the enemy/player assign a cost value and create an object with the cost value (if the map itself doesnt hold such values in its object at the cell coordinates)
C. Let Pathfinding be calculated and If you hover over a target point you might show yourself the “total cost” of the path. Before you trigger the move command. (That way you can easily debug and later let the events do it by itself for enemies)

1 Like

Hey, thanks for the response! I completely agree this would be better as a behavior. My game uses an isometric hex grid, so unfortunately using pixel distance won’t work. This is also for an enemy AI movement, so player commands aren’t a part of the picture.

Lets just say high level, I am trying to score all the hex tiles around the enemy unit as a best tile to move to. In order to do that one of the more important things is to find out how far away a tile is so you can see if its in the enemy units attack range. How would you go about calculating the distance (as in how many linked tiles they are away, not cost) to all of the tiles around an object without doing all of this terrible creating/deleting and calculating an individual path to each tile?

Hello @Keyz!

Is the size of the tiles regular? In other words, is it a constant?

A+
Xierra

My hex grid is 192x152 pointy topped. So not mathematically perfect from what I understand? But it seems to work fine (unless this is whats causing issues?)