Skip to content

Retreating

inkoalawetrust edited this page Dec 15, 2024 · 5 revisions

Marines can detect and run away from things that endanger them, such as their own grenades, other marines aiming at them (If low on health) (And other KAI hazard zones, such as MVP attacks), dangerous enemies, when they need to reload, etc.

When retreating

Marines that are currently retreating will do so for a set amount of times (That is usually calculated based on the severity of the threat). When marines are running away, they will try to avoid any nearby obstacles in their way, and will also actively search for corners to run behind where they'll be safe, so if say a marine is running away down a street, and there's an alleyway to their left, they should begun running towards the alleyway to their left for cover. Marines will also retreat less (Or not at all) based on a very basic check of how crammed by level geometry the area around them is, which should generally prevent them from doing things like running away for 10 seconds inside a small room.

Reasons

This section lists all the major things that cause marines to try and run away.

The most common reason marines will retreat is to reload their rifle, if there is still danger around. Generally, how much they run away from their target is based on how dangerous it is, so they will run away to reload if their target a Cyberdemon far more than if they're targeting an Imp.

The overall duration of a marines retreating to reload can be configured (Or turned off) with User_RetreatFactor. And they will also not run to reload if an action restrictor in range of them is configured to stop that.

Marines that are taking cover will not run away to reload.

Marines are fairly likely to throw a smoke grenade before running away, to try and cover themselves from incoming fire, unless the target the smokescreen is intended for can see right through it. Or using them for this purpose is restricted

While the threat level of the marines' target determines how far they run off. The amount of running they'll do will also be lower based on how many NPCs and players friendly to them are around a 512 map unit radius* of the marine. And how powerful each ally is. i.e if there's 10 friendly Zombiemen around the marine, they will still run away more than if there was another marine or two around them, since the other marines are more powerful allies than the Zombie fodder

*For allies that are part of an NPC group that the marine is also in, the marine will search in a 1024MU radius instead. So squadmates will count even if they're further away than non-squadmates.

Nearby enemies

Marines will try to run away a little for enemies when they're firing, if the enemy is right up to them and they're low on health. They will also just generally avoid being within 128 map units of any nearby enemies unless they have a berserk pack.

Melee

Without a berserk pack, marines will generally try to run away from danger a little after doing most, if not all melee attacks.

Marines will run away from KAI hazard zones. This is kind of a broad definition, especially since any other KAI mod can define and create hazard zones as it sees fit, but this generally means they will run from:

  • Enemy MVP vehicle attacks being aimed at them.
  • Burning MVP vehicles that they're close to, so they won't get burnt by the flames.
  • MVP vehicles that can run over and kill them such as the MBT.
  • From any enemy operated machine gun turrets being aimed at them. Regardless of if the operator is an enemy marine, some other enemy KAI humanoid, or an enemy player.
  • Generally run away from any sufficiently dangerous KAI hazard zone, such as zones placed on the map itself.

Being aimed at by other marines

If another enemy marine is aiming at the marine, the latter will try to run away from the line of fire if low on health.

Grenades

Marines will run away from any explosive grenades that they're in the blast zone of and that are about to explode.

Thrown grenades

Marines will run away a bit after throwing any explosive grenade to stay out of the blast zone. Unless they're already taking cover.

Walking around

Marines, particularly when idle, will simply walk around hazards that are marked as HAZARD_LOW and below, unless they're down to a third of their starting health or less. In which case they'll just treat the hazard as something to run around, even if weak, since they themselves are currently weak.

Keeping distance

In addition to turning around and running away, marines will also try to back off from ranged enemies, this depends on how powerful the ranged enemy is, for example, they'll begin back off from farther if they're moving towards a Baron of Hell than a Revenant.