Garry's Mod
Garry's Mod

Common Enemy AI Behaviors

Master Garry's Mod enemy AI. Understand Combine Soldier line of sight, Antlion Guard flanking, and Hollow Soldier positioning to survive hostile encounters.

Common Enemy AI Behaviors

Understanding how hostile NPCs operate is crucial for survival and strategic engagement in Garry's Mod's sandbox environments. Most common enemy AI, such as the 'Combine Soldier' or 'Zombie', exhibit predictable patterns. Players will often observe a 'line of sight' mechanic, where enemies will only engage once they perceive a threat. This can be exploited by using cover effectively, such as the various props and structures found on maps like 'gm_construct'.

Many hostile NPCs employ a flanking maneuver when possible. If a player remains stationary for too long, enemies may attempt to move to the player's sides or rear to gain an advantage. This is particularly evident with faster enemies like the 'Antlion Guard'. Their AI is programmed to close the distance rapidly and utilize their melee attacks, often dealing sificant damage if they reach their target. Conversely, ranged enemies like the 'Hollow Soldier' will attempt to maintain a specific distance, typically around 15-20 meters, to maximize their accuracy with their projectile weapons.

Aggression levels can be manipulated via the Context Menu (default 'C' key). Setting an NPC to 'Passive' will prevent them from attacking unless directly provoked, while 'Aggressive' will make them attack any player or friendly NPC on sight. 'Assist' mode causes them to aid their allies when attacked. Some advanced AI behaviors include 'patrolling' routes, where NPCs will move along a predefined path, and 'guarding' specific points. Awareness is also a factor; enemies can be alerted by sounds, such as explosions or gunfire, even if they haven't directly seen the player. This means that a noisy approach can draw unwanted attention from multiple enemy groups.

The 'Combine Elite' is known for its more sophisticated AI, often utilizing cover more effectively and employing suppression tactics. They may also have a higher perception radius, meaning they can spot players from further distances than standard Combine Soldiers. Understanding these nuances allows for more effective combat encounters, whether you are facing a single 'Zombie' or a squad of 'Hollow Soldiers'.

Compare common enemy ai behaviors inSlime Rancher 2