AI Learning: CombineSoldier

From Valve Developer Community
Revision as of 11:04, 30 July 2015 by Ihonnyboy (talk | contribs) (Added squad section.)
Jump to navigation Jump to search

Stub

This article or section is a stub. You can help by expanding it.

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).