Skip to content

Combat and AI

cjcarw edited this page Jul 15, 2026 · 2 revisions

🧠 Combat & AI

How the BTR actually thinks — detection, target selection, line of sight, the firing cycle, and what makes it give up. Configuration Reference tells you what each field does; this page explains the behavior those fields plug into.


🔄 The combat state machine

stateDiagram-v2
    direction LR
    [*] --> PATROL
    PATROL --> COMBAT : 👀 enemy spotted /<br/>💥 takes damage
    COMBAT --> SUPPRESS : lost line of sight
    SUPPRESS --> COMBAT : sees target again
    SUPPRESS --> ALERT : SuppressionDuration over
    ALERT --> COMBAT : target reappears
    ALERT --> PATROL : LostSightTimeout /<br/>target beyond DisengageRadius
    COMBAT --> DEAD : 💀 health reaches 0
    DEAD --> [*] : 🔥 wreck + loot + defenders

    note right of PATROL
        Drives its route.
        Scans every PatrolScanInterval.
    end note
    note right of SUPPRESS
        Fires at last known position
        with SuppressionSpread.
    end note
Loading
State What it does
PATROL Follows its waypoints at PatrolSpeed, scanning for enemies every PatrolScanInterval within PatrolAggroRange.
COMBAT Tracks the target, runs the firing cycle. Brakes if StopToShoot, chases if ChasePlayers, orbits at OrbitRadius otherwise.
SUPPRESS Lost sight of you — hoses your last known position for up to SuppressionDuration seconds.
ALERT Stopped shooting but stays locked on. If you peek again it re-engages instantly.
PATROL (return) After LostSightTimeout seconds without seeing anyone (or you leave DisengageRadius), it shrugs and resumes its route.

🎯 How it picks a target (threat system)

The BTR doesn't just shoot the closest player — it keeps a threat score per enemy:

  • Damaging it adds threat. Anti-tank / explosive hits add a lot more — the rocket guy becomes priority #1 instantly.
  • Being close adds a baseline threat (presence), so someone sneaking near still registers.
  • Threat decays over time — stay hidden long enough and it forgets you.
  • The highest-threat enemy becomes the primary target. A new enemy must clearly out-threat the current one to steal aggro (hysteresis), so it doesn't ping-pong between two shooters.

Who is a valid target at all is decided by the Faction System — players (AttackPlayers), eAI bots (Enemies/Allies), and enemy BTRs (AttackOtherBTRs).

It will not target: unconscious players, godmode/invisible admins (IgnoreGodmodePlayers), allied factions, or its own faction.


👁️ Line of sight — bone-accurate

When checking if it can see you, the BTR raycasts to your actual skeleton: head, chest, and both hands — plus fallback body heights.

flowchart LR
    M["🔭 Turret"] -->|ray| H["🧠 Head"]
    M -->|ray| C["🫁 Chest"]
    M -->|ray| R["✋ Right hand"]
    M -->|ray| L["🤚 Left hand"]
    H & C & R & L --> V{Any ray lands?}
    V -->|Yes| SEEN(["🔴 SEEN — that spot becomes the aim point"])
    V -->|No| HID(["🟢 Hidden"])
    style SEEN fill:#8b1a1a,color:#fff
    style HID fill:#1a5c1a,color:#fff
Loading

Practical consequences:

  • Peeking is dangerous. If your head or your weapon hand pokes past cover, that's a valid aim point — it shoots at the exposed part.
  • Bushes are concealment, not cover. LOS rays pass through bushes — but the BTR still verifies the ray truly reaches you behind the bush (it won't blind-fire into a wall behind a shrub).
  • A one-frame glimpse doesn't unleash hell. It must genuinely see you for a moment before suppression fire is allowed — cresting a hill and "seeing" you through a window edge for a single tick won't trigger a blind barrage through the house.
  • Against enemy BTRs it aims at hull points (turret, mid hull, lower hull) instead of bones.
  • Short grace window: right after losing sight it keeps tracking your last visible spot briefly, so flickering in and out of cover doesn't reset its aim.

Tip

CloseRangeAutoLOS (off by default) is the one exception: if set, within that distance the BTR "sees" you even through cover — an anti-point-blank-camping option. It will shoot through walls at that range, so use with care.


🔫 The firing cycle

Cannon shot leaving the muzzle

With a target in sight, the weapons run a rhythm:

flowchart LR
    A["🔫 Coaxial MG burst"] --> B{CoaxOnly = 1?}
    B -->|Yes| R1["⏳ Reload pause"] --> A
    B -->|No| C["💥 Cannon burst"] --> R2["⏳ Reload pause"] --> A
    style A fill:#5a5a2a,color:#fff
    style C fill:#7a2020,color:#fff
Loading
  • Coaxial MG — fast, lower damage, its own accuracy/range (CoaxAccuracy, CoaxMaxRange). Great at shredding infantry in the open.
  • Cannon — slow, hard-hitting; with ExplosiveCannon each impact explodes (splash, fells trees). This is what kills vehicles and campers behind soft cover.
  • Weapon heat — sustained fire overheats the guns; the BTR goes quiet for a few seconds to cool down. That lull is your window to move.
  • Lead prediction — it aims ahead of moving targets based on projectile travel time, including the velocity of a vehicle you're driving. Straight-line sprints get you killed; erratic movement works better.
  • Grenade lob (optional, Grenade.Enabled) — indirect fire to flush out entrenched positions.

What the bullets do on the way

The shot hits… Result
🧍 A player / bot Damage, bullet stops
🚛 An enemy BTR Cannon: explosion on the hull. MG: pings off (BTRs are bullet-immune)
🌿 A bush Passes through and keeps going
🧟 A zombie / animal Damages it and passes through — a horde won't shield you
🧱 A wall / rock / terrain Stops. Cannon shells explode there (splash may still clip you near edges)

🛑 Movement during combat

  • StopToShoot: 1 — plants itself while it has line of sight. Steadier aim, easier to flank.
  • ChasePlayers: 1 — actively drives toward you; 0 = fights from where it stands.
  • Orbit — when chasing, it circles the target at OrbitRadius instead of ramming into melee range.
  • Smoke Screen — when badly hurt it pops defensive smoke; with HunkerDown it brakes inside the cloud and fires blind at reduced accuracy.
  • Roadkill — anything it drives over at CrushMinSpeed+ dies. Don't try to juke it on open ground.

📌 Reading a fight (player's-eye view)

  1. ~250 m — you enter DetectionRadius; while patrolling it aggros inside PatrolAggroRange.
  2. It stops (or orbits) and opens with the MG; tracer fire walks onto you.
  3. Cannon follows — explosions on your cover, trees coming down around you.
  4. You break line of sight → suppression rakes your last position for a few seconds.
  5. It goes quiet but stays locked — peek and it re-engages instantly.
  6. Stay hidden past LostSightTimeout → it returns to patrol. Or damage it enough and watch for the smoke screen — that means it's hurting.

Related: Faction System · Health and Damage · Smoke Screen · field-by-field docs in Configuration Reference

Clone this wiki locally