A better path by changing the direction of neighbour search?

I thought the path it found was very dull and did not feel like the enemy was moving “towards” the objective so I did this:

Change the directions array to a list:

List< Vector2Int > directions = new List < Vector2Int >
{
Vector2Int.up,
Vector2Int.right,
Vector2Int.down,
Vector2Int.left
};

Then reversed the list every time ExploreNeighbours() was called:using:

directions.reverse()

This makes for a much more interesting path which still seems to find the most efficient path to the end.

Are there any potential problems with this method?

1 Like

You post is in the wrong place (Blender section).
But if I may comment!
Both routes are predictable.
Maybe some randomness?

Have fun!

1 Like

Thanks FedPete! Noted!!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms