AI Learning: CombineSoldier
Created by npc_combine_s.
Combine Soldiers
Combine Soldiers are regularily seen throughout the Half-Life 2 series, there are four variations, including the "Regular", "Elite", "Prison Guard" and "Shotgunner".
They often work in squads together and flank the player by spreading around and using frag grenades.
Squad Interactions
Combines squads have 6 primary squad slots: SQUAD_SLOT_ATTACK1, SQUAD_SLOT_ATTACK2, SQUAD_SLOT_ATTACK_OCCLUDER, SQUAD_SLOT_GRENADE1, SQUAD_SLOT_OVERWATCH, and SQUAD_SLOT_SPECIAL_ATTACK.
SQUAD_SLOT_ATTACK1 and SQUAD_SLOT_ATTACK2 are the slots soldiers must have to be able to shoot at an enemy or advance in most cases. Over longer distances soldiers will advance regardless of squad slots, and soldiers can lose their attack slot while moving and shooting. This is intended behavior, but can cause problems in expansive tight environments.
SQUAD_SLOT_ATTACK_OCCLUDER is the slot a soldier occupies when shooting out an opponent's cover. They do this to breakable objects they can see through, such as crates held by the gravity-gun or windows.
SQUAD_SLOT_OVERWATCH is a strange squad slot that rarely comes into affect. It only applies to squad leaders, and causes them to crouch and wait if they see an opponent they just found, and the other attack slots are in use.
SQUAD_SLOT_GRENADE1 and SQUAD_SLOT_SPECIAL_ATTACK are used by soldiers to throw grenades or launch energy balls. For difficulty reasons, whenever these slots are used they'll stop the entire squad from committing similar attacks for a period of time.
If a soldier is not using a squad slot they'll take cover
Worthy to note is that squad slots are handled per enemy. This means a squad could potentially split up and attack different targets, but this all depends on who each squad member is prioritizing (which is influenced by distance, relationship strength, enemy filters, and who attacked the npc last).
Squad slots can also be exchanged rapidly. For example, soldiers on an assault might exchange attack slots rapidly to keep a constant stream of fire at an opponent.
Understanding squad slots is useful to know when setting up combat encounters. For example, a level designer might want a group of soldiers on a roof to shoot and throw grenades independent of soldiers on the ground (be mindful of friendly fire).
Weapon Interactions
Combine soldiers have a variety of weapons, each filling out a certain role and having a different affects on the AI
- Accuracy cone when used by soldiers:
- 5 degrees (Episodic)/ 9 degrees (Half-Life 2)
- The AR2 has a far AI engagement range, so these soldiers tend to keep their distance.
- Accuracy cone when used by soldiers:
- 16.6 degrees
- Smg soldiers are the most inaccurate of all the combine forces, and tend to engage at a medium distance. They are used often by valve because they act almost like "meat shields" for the deadlier combine, causing the player to choose between targets of opportunity.
- Accuracy cone when used by soldiers:
- 10 degrees (the same as the player)
- The Shotgun has a really short AI engagement range, so this triggers slightly different behavior in the soldier AI. They'll charge straight at an opponent regardless of the damage they're taking. They can deal a lot of damage and fill a role similar to a melee unit.
Soldiers also have several different reactions when engaged with certain weapons. If hit by the .357, AR2, or half the pellets from the Shotgun, their AI will consider it Heavy Damage. This typically means they'll stop shooting or flanking and play a dramatic flinch animation (this is slightly different for shotgunners). This is useful to understand when considering the player's arsenal at certain points in a level.