I would like to script my own “smart” swordfighter NPCs.
I could very easily script NPCs that just follow and attack the player, but I’d like to give them some sort of “intelligence”, like dodging attacks, jumping around, deciding when to approach or flee from the player, etc.
Here are two example games that have the kind of NPCs I want:
For this usually the strategy is to approach the side of the character that is not holding the sword like circle strafing, then you can add difficulty some bots do this while others don’t for “smartness”
I believe you can do something simple like detecting and running away from a lunge if the distance is far away then going back in to try for an attack, or instead of going straight to the enemy and attacking have a random chance to stay a radius away and wait for a chance to attack.
Also I believe you have seen this which seems to organize the if statement logic of “AI”, through a behavior tree.