T
trentallain
Guest
Is there a way I can get a path towards a target (such as an ally character) that is limited by how many move points (MP) the AI character has?
This is a grid turn based game, and I am trying to code some AI for it. Grid squares are 20px, and the grid size is 40x20.
Getting the paths for player controlled characters is pretty straightforward, because the player can choose a position to move to, however AI needs to plan to move towards a character even if it is outside its MP range.
One way I was thinking of doing it is getting a path to the target, not taking into account MP, and then make it follow the path to where the path point equals the MP. Would this work and be better than any other options?
Also how would I do this but also take into account the range that the AI character can attack from (a circle of grid squares around it, range is the radius in grid squares of this circle)? (no point in being a ranged character if it just walks right up next to the player)
This is a grid turn based game, and I am trying to code some AI for it. Grid squares are 20px, and the grid size is 40x20.
Getting the paths for player controlled characters is pretty straightforward, because the player can choose a position to move to, however AI needs to plan to move towards a character even if it is outside its MP range.
One way I was thinking of doing it is getting a path to the target, not taking into account MP, and then make it follow the path to where the path point equals the MP. Would this work and be better than any other options?
Also how would I do this but also take into account the range that the AI character can attack from (a circle of grid squares around it, range is the radius in grid squares of this circle)? (no point in being a ranged character if it just walks right up next to the player)