Skip to content

Stealth: guards, knife kills, hostages and the scav chop shop - #545

Merged
Jackriip merged 153 commits into
masterfrom
feature/stealth
Nov 22, 2026
Merged

Jackriip merged 153 commits into
masterfrom
feature/stealth

Conversation

@Jackriip

@Jackriip Jackriip commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

Human NPC guards that see, hear and talk to each other. A crew can sneak past them, knife them from behind, choke one out, hold one up at gunpoint or take one hostage. In this PR they man the scav chop shop, a space ruin that only admins can load for now. The outpost security in #537 is built on them.

Damage, crits, wounds, grabs, cuffs, stuns and death are all tg's own, and work the same on players and NPCs. The guards only decide what they notice and what they do about it.

Guards

Sight

  • A guard sees a cone ahead of it, much shorter in the dark, and almost nothing behind it. It can't see round corners. It sees anyone right in front of it, or at its shoulder in good light, straight away.
  • A ? over a guard means it noticed something and is coming to look. A red ! means it has seen you.
  • Guards carry flashlights. The beam is real light from the guard's hand: it stops at walls, swings ahead of a turn, sweeps while the guard searches and dies when an EMP hits it.
  • A lit light you carry in the dark makes a guard turn round, even from behind.
  • Keeping still in thick foliage hides you until a guard is close. Moving, firing or carrying a light gives you away. So does holding someone in front of you.
  • A guard notices a body if there's light to see it by. A body in a locker or crate stays hidden.
  • A guard who saw you get into a locker opens it, and breaks it open if it's locked.
  • A door opening or shutting in a guard's view brings it over to look.

Hearing

  • Gunshots carry by how loud the gun is. Suppressors cut it.
  • Running footsteps, thrown things, knocks, smashed bottles, doors, falling bodies, shouts and blasts are heard too.
  • Walls and doors muffle sound and thin air carries it less far. Nothing carries in a vacuum.
  • When a guard goes to check something and doesn't come back, the others notice.
  • Some guards wear earpieces and call trouble in. The calls are real radio, so anyone wearing one of their earpieces hears them.
  • To stop a call, down the caller before he speaks, use a jammer or an EMP, deafen him or take his earpiece off.
  • A guard that loses you searches for a while, then gives up.

Patrols

  • Guards walk routes or hold posts, and one drawn away walks back.
  • Guards in yellow and red zones see and hear better than in green. They don't hit harder.
  • Guards keep attacking someone who is down.

Disguises

  • Scav fatigues, a mask and a scav pass fool scav guards, and each piece helps.
  • Up close, a guard stops you and asks for your pass. Show it and you're waved on. Run off, or have no pass, and it attacks.
  • These give you away:
    • a weapon in hand;
    • dragging or carrying a body;
    • going somewhere off limits;
    • being seen grabbing or hitting a guard;
    • standing over a body when it's found;
    • a face the guard already knows. A mask hides it.

Taking guards out

  • Hits. A hit on a guard that hasn't seen you is more likely to crit, more so to the head. This only works on guards.

  • Head shots. A shot to the head of an unaware guard does what the round can do against his helmet, from a burst skull down to a knockout.

  • Knives. Any sharp knife from behind opens the throat of a guard that hasn't seen you, on the click. On anyone else from behind, or on someone helpless, aim at the head: there's a short hold first, and moving or turning breaks it.

  • Cut throats. The cut is tg's throat slit, so a helmet or armour plating under the skin stops it. The victim drops for a moment, clutching his throat.

  • Hand over the mouth. With an empty hand, grab a guard who hasn't seen you from behind, aimed at the mouth. He can't shout or radio, and you hold him in front of you. Then:

    • draw a gun and he's your hostage;
    • use a knife to cut his throat;
    • grab again to choke him out. He lives: the choke stops once he's out.

    A sealed helmet keeps your hand off.

For everyone, players and NPCs:

  • A held shield doesn't stop a shot that hits you in the back.
  • Nobody can speak while their cut throat bleeds.
  • A gun aimed at someone else's mouth fires as an execution if they're helpless, and as an ordinary shot if not. Shooting yourself is unchanged.

Hold-ups and hostages

  • Hold-ups. Hold a gun on a guard from up to two tiles away (tg's right-click hold-up) and he puts his hands up. He won't if he already has a weapon drawn, if his friends are close and on guard, or if he's the boss.
  • While his hands are up you can walk over and cuff him or take him hostage. Leave him alone and he goes for his weapon.
  • Hostages. Grab someone by the neck with a gun in hand and you hold them in front of you, on their feet, turning with you.
  • It takes a real gun. Toys, practice and tag guns, medbeams, and syringe and chem guns don't count.
  • Hold one of the guards' own people like that and the rest hold fire and keep back. "Drop it!" and "Back off!" each work once per guard.
  • If you hurt the hostage, set them alight or go for a guard, they open fire. They also turn on anyone else who attacks them.
  • A stranger or another player held in front of you doesn't stop them shooting.
  • A hostage mumbles under your hand and pleads at gunpoint.

Scav chop shop

A rare space ruin: a scav crew's den dug into a hollow rock. It has patrols, sweeping wall cameras and a boss who holds the vault pass.

  • A camera that spots you follows you, turns amber and then raises the alarm.
  • An EMP, wirecutters or breaking it puts a camera out.

It isn't sold or placed in rounds yet. Admins can load it on a jungle planet with Stealth: Scav Den Planet (Debug).

Admins

New Debug verbs:

  • Stealth Guards: watch a guard's sight, route and awareness, and set its awareness or skill.
  • Stealth Noise: make a noise at your feet, or see the noises on your level.
  • Stealth: Scav Den Planet: builds a jungle planet with the den and drops you outside it with a test kit.

Force Z-Level Active wakes the AI on a level with no player on it, and lets it go when the level is unloaded.

Images

The knife from behind: the grab, the cut and the blood thrown forward.

Knife execution

The scav chop shop: guard posts, patrol stops, camera sweeps and a way in from each airlock.

Scav chop shop

Upstream files touched
  • code/modules/projectiles/gun.dm: tg's slow mouth shot runs only when you shoot yourself or the shot is an execution. Marked VOIDCREW EDIT.
  • code/game/objects/items/knives.dm: a combat knife dropped from the mouth of a body being deleted doesn't try to cut it. Marked VOIDCREW EDIT.

Compiles with 0 errors and 0 warnings. The final build hasn't been playtested yet.

…n view of every guard's sight

Guards with nobody else noticed say a line, look round for a few seconds and go back to their route
after killing or downing their target. Hits from a second attacker during a fight are remembered.
Wary now fades after three minutes with nothing new. Admins can show the sight of every guard on
their level at once. The notice map moves off the blackboard, whose qdel sweep runtimed on it.
The ally check walked get_line(), which takes one turf per step. A shot at an
angle clips turfs beside that line, so a gunner fired past a guard standing
next to its target and hit him. The check now walks every turf the straight
line passes through.
…er 60 s

The ? fills as a guard notices you and only you see it. Alert is a red ! for
everyone; it drains while the guard has lost you, then turns into a yellow ?
that drains over the search. Drawn on the guard, so never through walls, and
above the lighting so it reads in the dark. Built only with a player nearby.

Wary now fades after 60 seconds with nothing new.
Standing marks sit 6 px higher and follow the head's height offset; a lying
guard's mark clears its body. No own ? shows in the moment after a search ends.
Guards walk back to their route or post after a chase instead of turning
sentry, in legs when it is far. Only being carried to another level or
map region makes a sentry; a guard that can't get back waits and retries.

The AI stays fully awake while any living player is on the level, the
scan runs from planning instead of the behaviour queue, and long walks
are no longer cancelled every step.

An alert guard still notices others and turns on someone clearly nearer
or on whoever hits it, at most once every few seconds. A glimpse while
searching is an alert. Notice is capped, and only what it sees now
decides its state. The candidate cap counts only those it can perceive.

A box that moves at its shoulder or bumps it is noticed. Blasts, fire,
gas and stuns with nobody to blame send it and nearby friends searching.
Cuffs, syringes, the strip menu and thrown items count as touches.

The head mark exists only while the scan runs, so it clears on cuffs,
stuns and player control. A player in the body gets no reactions.
…nocks, glass, doors, bodies, shouts and radios

Guards react to noise as a group. A small noise sends one guard to look, a second at the same spot two,
a third everyone; a guard that never comes back is missed. Gunfire, blasts and screams send the nearest
few running while sentries hold. Suppressed guns are heard only close by and in the open. Running is
heard and walking is not, by tg's own footstep rules, and running no longer makes you easier to see.
Guards who see or feel someone shout for help; lookouts carry an earpiece and call it in after three
seconds unless they are dropped, jammed or EMPed first. A guard that heard something shows a grey ?.
No sound ever gives a guard a target. Adds the Stealth Noise admin verb and a noise view.
…ets, a window, a locked door, carpet and plating
…sing guard, alarms, shouts, radios, and real shots, throws, knocks, falls, emotes and blasts
Guards switch a belt seclite on in the dark and whenever they are on edge;
an EMP cuts it out. A body found mid-search is called out, a quick volley
from one spot counts as one noise, and sentries keep facing their post.
…the dark, and stop flickering lights

Point-blank sight within 2 tiles in the cone is an alert on that look, with a quick look between scans;
3-4 tiles fill three times faster. The close radius behind a guard needs light that isn't its own beam.
A guard's own spot is judged without any guard seclites. No missing-friend line over a reported body.
An AI-switched light is re-laid as a turn would. Diagonal AI steps cost what a player's do.
The test room's east room gets a floor light in the middle.
… drop them, a matte knife backstabs, and their seclites can be looted
Stepping on broken glass or a dropped bulb makes a small noise guards go to look at, even at a walk. Every door a
player opens or shuts makes a small noise, and a guard who sees one move goes to look unless one of its own is beside
it; a door that keeps moving is only looked at twice in three minutes. Guard skill comes from a green, yellow or red
profile picked by the den's zone, a mapper var or an admin action; yellow is the old tuning. A gunner now steps back
two tiles to shoot open a locked locker, since a gun beside one only bashes it.
…rn, walk their patrols and don't snap-spot right after turning
tg's light setters don't rebuild a COMPLEX_LIGHT source, so the hidden lamp never emitted. Call update_light() when it switches or changes range.
…dd a back hatch, let sentries step toward small noises
…scav pass fool them by stage, they stop and ask for the pass, and weapons, running, bodies and known faces blow it
… a jungle planet there, clears the ground and loads the stealth test room, and drops the admin outside in a mortal playtest kit
Scav guards inherit combat sense against stun weapons from the trooper type, but the stealth AI's own planning list never ran it. It plans after a guard finds its target and before it arms, as in the base human NPC AI.
The test polled each guard's behaviours every tick, and a guard's open lands inside one tick, so it could count no opener while the locker was opened.
A point-blank shot at the head lands on another body part about one time in fourteen, so the d45 head-shot tests failed now and then. Their guards carry tg's designated-target trait, which turns the roll off.
- Noise reads planet air read-only, so a heard noise never gives a planetary
  turf its own gas mix.
- Thin air shortens how far noises and running steps carry, by tg's own
  pressure scaling for players.
- Explosions carry as far as tg plays them to players, by blast size.
- A door is the guards' own only when a free, standing guard works it; a guard
  merely beside it hears and sees it. Only a machinery door shutting by itself
  is excused after a guard opened it.
- Dug up or replanted foliage is no cover; someone holding a hostage in front
  of them is not hidden by cover.
- A guard's own slip makes no thud for its friends.
- Cover steps, rustles and the emote noise pre-check only run where a stealth
  group lives.
- Mobs tg plays no footsteps for make none for guards; a glass a bartender
  slides doesn't count as smashing.
- Replace a pointer to a private notes file with the reason inline.
…ove after a hold-up fights instead of deciding to surrender again
…d; standoffs react to third parties, slams and fire; tighter drop-it words; no mumble with a cut throat
- A den camera sees through a full scav disguise for the same reasons a
  guard does (a weapon out, a hostage, a fallen guard dragged or carried),
  judged through the den's own guards.
- A living den guard's red chrome eyes burn out when they are taken out.
- The chrome vault notes its den's zone once the site is on the overmap,
  so opening it elsewhere later pays the right zone.
- The scav den planet verb holds its one slot from the zone prompt until
  the build ends, so two runs can't both build a planet.
- Guard radio calls reach only earpieces on the same site as the call,
  as the spoken radio does.
- A multitool on a guard earpiece says it is stuck on one channel instead
  of an empty "tuned to".
- A level activator deleted any way drops off its level and resets that
  level's AI.
- The hearing tests' gravity goes through the test tidy-up; the d45
  ordinary-person case checks its hit; new tests for pellet grouping, a
  buckled hostage, an EMP'd camera coming back and the siren loop.
… the dark, unseen attackers

- Out-cold guards note no harm; only felt harm reaches friends, and only friends
  that see the guard or hear the spot through walls.
- Harm a standing-off guard can't name ends the standoff as a blow from the holder does.
- A stealth guard charges a stun shooter only while it has them in view.
- NPCs in cuffs or out cold are no intruders (same rule as the den cameras).
- Bodies inside the close radius need light (and eyes beyond adjacent).
- A disguise stop the guard never gets within reading range of gives up after 8 s.
- A guard fighting someone it never saw names nobody and learns no face; a dead
  guard's pass names nobody.
# Conflicts:
#	voidcrew/modules/unit_tests/_unit_tests.dm
# Conflicts:
#	voidcrew/modules/unit_tests/_unit_tests.dm
# Conflicts:
#	voidcrew/modules/unit_tests/_unit_tests.dm
@Jackriip
Jackriip marked this pull request as ready for review November 22, 2026 02:13
@Jackriip
Jackriip merged commit 30ca467 into master Nov 22, 2026
4 checks passed
@Jackriip
Jackriip deleted the feature/stealth branch November 22, 2026 02:14
MrCat15352 pushed a commit to SOLARIUM-Collective/Solarium-Voidcrew that referenced this pull request Nov 30, 2026
Stealth: guards, knife kills, hostages and the scav chop shop
(cherry picked from commit 30ca467)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant