Tactics battle movement - progress!


Success! A basic recursive distance function is working! The monster knows it can move to these locations:


The code is a little inelegant but works . I got the logic from here: http://theliquidfire.com/2015/06/08/tactics-rpg-path-finding/

And a preview without the debug numbers;


There was an issue that it doesn't always "count" the steps in the most efficient way possible, resulting in it incorrectly shortening movement in some cases - I had to add a "checkShortestPath" function specifically for this. Felt messy but I don't think there was any other way.

Once the code is cleaned up and I'm certain it works, I'll share some code and logic behind it.

Leave a comment

Log in with itch.io to leave a comment.