wtorek, 22 kwietnia 2025

DYNAMIC Shootout with rigged AI (Half-life 2's)

How does it feel to play with F.E.A.R's historic AI?

Playing the F.E.A.R games. Which are famous for their very believable "life-like" AI can be a treat. But until you look under the hood, it's hard to see exactly how much of it is elevated by game design and detailed enemy communication. In fact, the famous complicated AI wasn't very much new. It was just put to good use.

Player feels outsmarted by coordination of AI opponents. (Drowsy TOTO, Youtube) 

F.E.A.R AI is very dynamic and aware of their surroundings. But the sad truth is, even players replaying the same levels multiple times, unless they are looking for it, they won't notice the difference. The game's rectangular and flank route heavy levels played as much of a difference as everything else. Also, a large part of its success was the fact it was a new game and very detailed for one simple reason. Developers focused on making the AI seem as smart as possible.

Inspired by its success in dynamic feeling shootouts, I tried to design one myself. Below is the result.

Enter Soviet Hospital setting.

The setting helps.

Not only because I like it, but it also comes with many benefits which I should underline. For one, the visibility. I wanted to make it as fun as possible. The flat whites are in line with the ground on which the enemy will be stomping on. Lighting is safe, always flat and highlighting from where the enemy is coming. And the ceilings are high to encourage the planned use of grenades.

Another important thing from the F.E.A.R playbook will be the versatile square rooms.

Following a readable three-lane design. This is the middle.

Angles are close together on purpose. To force quicker decisions from players and AI alike.

Here's a demonstration how it plays. I'm had fun with the result, it proved engaging and feels dynamic. Later I write about the process.

The Process - How do I force choices?

Half-life's combine can be relatively coordinated. For this, they apply an interesting slot system. In long story short, they are seemingly taking turns in action. For example, if an NPC sees a squad member is suppressing the enemy (which has already started under other conditions), they choose to go to a flank. 

This helps them not walk into each other, don't throw grenades or attack simultaneously. However, this also ensures that every attack of theirs looks similar. Furthermore, they tend to always take the shortest routes to a target and often stand in the open looking at the player, because if two of their squad mates are already attacking the player, they can't join or are slow to do anything. This, in addition to Half-life's fast gameplay, makes it seem like they lack self-preservation.

 
(purple brush is only blocking npc navigation)

Here you can see I blocked an obvious suicidal route to ensure they flanked through either the left or right entrance. They will still shoot the player while flanking because with this brush the line of sight is still unobscured. Their decision looks smart from the outside because, like I said before, they always choose the shortest route. Therefore, they choose entrances depending on the player's position in the level.

Self-preservation. And how to squeeze an NPC.

If the level maker doesn't ensure intelligent behavior by containing their decisions, they will die in an idiotic rush. This often happened in half-life 2 when fights in city 17 levels felt great until gameplay was taken to the streets, where lack of cover and alternative routes, meant enemies were acting almost suicidal. 

This is for sure a bigger subject. So on the variety of quality in Half-life 2's shootouts I will blog another time.

Here's how I taught them to move and to seem like they are considerate of advantages in the environment. At almost every step they have a decision, an orange hint node (cover), or an alternative route that is also chosen depending on proximity to the player.

You might think this will make them feel linear, but it's the contrary. This squeezes the existing slot system to show more in gameplay, by ensuring it's the main variable in how NPC's behave towards the player. Because many available decisions require more indeph knowledge of the surroundings, and we now know that this AI is lacking in this regard.

That's all. Now lets take it into a new context.

A good working layout might work well in other cases. I already included everything a simple arena would need. A Hunter NPC from Half-life 2 episode 2 is an interesting enemy, and a direct variation on the combine soldier, possessing same rushing AI but is made more directly for this purpose.

(not mine) Its a funny gif where one gets brutal LOD threatment.

Its more visible, has more health and uses a powerful attack with timed explosion to keep the player moving. Forces movement every time it attacks. Its suicidal rushing, like with the combine soldiers, also proved annoying, although here it's probably a matter of preference. The fixed layout of this arena was already made to squeeze rushing enemies, and it worked the same for a hunter.

Although I did some little adjustments to its size and timed attacks. For one, I opened further angles, therefore making this fight more interesting. Because of its timed attacks, it wasn't necessary to give player more cover, and even helped a little to avoid attacks.

Doors between both left and right lanes are opened.
Effectively rising the stakes.

With the hunter comes a couple of combine soldiers with a SMG weapons. I had a problem with this weapon in the previous variation of this area. For once, the SMG has lower damage values and is less accurate, and the NPC's don't bother to compensate for that in any way. Therefore, enemies possessing SMG's are just easier.

https://www.youtube.com/watch?v=BqyPopTX1g0

Its fitting to drop them in a more open area. Normally, it would end up letting the player fight them without cover, ending in them feeling unthreatening, but by dropping them with a powerful hunter, and looping an "avoid player" schedule, I made them feel like a diversion. Making this compilation an interesting choice of who to fight first, and making it harder for the player to focus his attacks on the hunter. Which didn't prove annoying because of how its attacks can be quickly avoided.

It ended up as a very fun and a fast-paced fight. Same but different, and more challenging. Therefore, a good iteration of the previous arena. 



Brak komentarzy:

Prześlij komentarz