Allow AI controlled soldiers the ability to move and shoot

When the AI controlled soldiers are moving to a destination (the player, a “move to” command) they might be forced into combat along the way. Their combat behavior take priority and interrupt the pathfinding behavior by abruptly stopping to shoot at their current target. This interruption sometime put the AI soldier in danger as they stop to shoot in the open and if they survive they fall further behind from their squad. Each time the combat behavior take priority they are further separated from their squad and the chance of them taking a different path is increased, the new shortest path to the player might be more dangerous.

  • Make AI controlled soldiers store their current target’s coordinates.
  • When moving to a destination the AI soldier should be able to move and shoot with a movement speed and/or accuracy penalty.
  • While moving to their destination the AI soldier should face the last known position of their current target by reading the stored coordinates.
  • If the current target disappear and is still alive the AI soldier should keep facing the latest stored coordinates for a brief moment before disengaging, clear the stored coordinates from memory and resume moving to their destination with no movement speed penalty. This simulate a player’s behavior of keeping track of their opponent and will increase the survivability of the AI soldier by granting them fast target reacquisition.

AI soldiers from Modern Warfare 2 Remastered shooting in between moving to their destination.

4 Likes

it’s truly a buzzkill seeing them ( in enlisted ) stopping to be a stationary and easy target, to shoot or return fire, and then move.

it’s like they only have one brain cell.

can’t move and shoot at the same time for whatever reason :joy:

2 Likes

Dont have high hopes, they cant code proper pathfinding. Start with little things like not be stuck at any random object