Moving and Shooting: A Game Design Nightmare
Added 2023-10-02 05:45:31 +0000 UTCI am in no way exaggerating when I say I have probably spent more time thinking on when the soldiers in my game are allowed to move and shoot than any other aspect of the game. Over the last 5 years how and when soldiers were allowed to shoot has changed, and as things changed the list of weird band aid fixes and very specific if else statements piled on. Recently, I hit a breaking point with the state of this code and decided I’m going to do a hard reset. A full re-coding of when soldiers can move and shoot and why. But of course, this isn’t just a question of code, it’s a question of game design.
So when does an NPC decide to move instead of attack? When do these actions intermingle? The initial thought process I had was to get away from Half-Life 2, which allowed soldiers to run and shoot basically at all times, and make it closer to Half-Life 1. In Half-Life 1, the answer was basically having the human soldiers always opt to shoot first, then consider movement goals if no enemy was on screen. Coupled with new animations that show the soldier actually raising their gun to shoot, I felt that the game was finally “fair”. Gone were the days of players awkwardly trading bullets with enemies who could arbitrarily move anywhere while firing bursts of gunfire back at them. But there were problems.
Soldiers on the approach often looked really awkward, as they’d have to come to a complete stop then raise their gun to attack. Rather than coming off as an imposing threat, they basically gave players an easy window to escape in or even possibly kill them. There was also the issue of any time a soldier went from attacking to wanting to go to cover. They’d approach the player, stop in their tracks, then turn around to get to safety. This made some sense for things like evading grenade explosions, less sense when they just wanted a new piece of cover to safely attack from.
So the issue here was one of optics vs “fairness”. Players appreciated feeling less vulnerable to “random” damage but never thought the AI felt very impressive. They also reported feeling like soldiers were overly static, not giving them much of a reaction to whatever they were doing. So I basically had three goals to fulfill:
- Soldiers needed to come off as intelligent to the player.
- Soldiers needed to have a clear rhythm and loop to their decision making that players can react to.
- Damage needed to be as fair as possible, rewarding players for learning the “loop” to soldier decision making.
Goal #1: The Illusion of Intelligence
A key part of this game is making the enemies appear intelligent. “Appear” is the core word here. Whether or not they’re really capable of making more informed and rational decisions is moot if the player isn’t noticing any of it. F.E.A.R has consistently been a big point of inspiration and reference for me, so I took to literally just watching the AI with god mode on to get some ideas.
(Twitter thread for those interested: https://twitter.com/ComfortJonez/status/1698885686253048191 )
I realized even though they were often able to attack on the move, something I thought I hated coming from Half-Life 2, they were almost always walking slowly rather than doing a full sprint. My core takeaway was their implied intelligence largely seemed sold by the simple loop of them walking and aiming to advance to cover, then either walking and aiming or running if their path to cover got broken. While they were still generally facing the player, the insistence on using cover allowed this to remain intelligent looking. Players continually misinterpret a simple “move to cover” activity as a flank when they’re naturally just taking a cover position they can shoot at you from, which means they get to look smart without actually having to be smart.

So walking and aiming, rather than running and aiming, became the standard move style for soldiers when I wanted them shooting on the move. This helped them look a bit more competent than simply running at the player, but this only solved the visual element. The next issue was figuring out when they should actually be allowed to attack on the move.
Goal #2: A Strong Decision Making Loop
Game design can essentially be boiled down to finding a good gameplay “loop” the player continually does. One could also extend this to AI design in a sense. The player or AI takes an action, the other reacts, and hopefully the resulting behavior should result in fun gameplay that repeats. This way of thinking had to extend to how my soldiers choose to move, which in turn can impact how the player reacts to them.

The breakdown for their actions is basically this:
- Engage their enemy
- Move to cover
- Advance on any missing targets
So in other words, they fire at targets or toss grenades, move to cover or near it when that fails to kill their enemy, and then advance to get closer if they can’t see their target anymore. I needed to figure out clean rules for when they should be walking and shooting, which I basically broke down like this.
- Soldiers never want to move and shoot when escaping explosions/other major dangers
- Based on their weapon, soldiers have a certain range at which they always want to be attacking
- If the soldier is at this range and wants to move, he should walk and shoot if he sees his target
- If they can’t see their target, their movement is dictated by the action type. For advancing they’ll walk, for cover they do a dedicated hunkered down running animation.
The general idea here is soldiers should consistently push you to take cover if you’re close enough for them to attack, then give you openings to shoot back at them when they retreat. This should come naturally to the player, with the rhythm of gunfire driving their decision making. That’s the hope anyway, we’ll see in playtesting how this all shakes out.
Goal #3: Keeping Damage Fair
Speaking of playtesting, the other major design element that drove my initial changes to when soldiers can shoot on the move was a strong desire for damage to feel less arbitrary. In Half-Life 2, the constant moving and shooting from soldiers combined with hitscan damage made effectively mitigating damage a challenge. The designers seemed to recognize this, as their answer in level design was to constantly give the player health and ammo scattered throughout arenas, to essentially give the player a reward for pushing towards enemies heedless of danger. In Inhuman, I’m seeking out the exact opposite kind of behavior.
So how am I hoping that damage remains fair? My hope here is that players intuit that any time enemies are aiming at them, they are in danger of being shot. This should get them to either move to cover or scramble to stun the soldier (close ranged shotgun blasts for instance). Once they take cover, the soldier should stop aiming and move, giving the player a chance to attack back. This is effectively the culmination of accomplishing my first two goals, aiming to create a game where the player can act intentionally in response to enemy behavior which seems intelligent. While I’m happy with early testing so far, I’ll still have to watch the results very carefully to make sure this is tuned properly.
Game design is a long and often very dry process. I’m hoping with articles like these I can help give people an idea for how to think through and work on their own issues with whatever game element they’re working on. Worst case, you can always just steal from F.E.A.R I suppose.