Security System (Zone-Based, Hytale-Scalable)
TL;DR
Hollowgate security is a rules engine that scales to ~80 players.
NPCs signal authority. Systems enforce authority.
Guards detect + warn + tag + attempt detain. Doors/checkpoints/scanners + Detain → Transfer do the real enforcement.
Design Goals
- Localized response by default (one block can go hot without nuking the prison).
- Rule-abiding players aren’t punished (inconvenience only, minimal).
- Group attacks are handled (1 guard can’t chase 5+ targets).
- Riots are possible as events, but riot spam becomes self-defeating.
Core Concepts
Zones
The prison is split into Zones with hard boundaries:
- Cell Blocks:
Block A,Block B,Block C - Wings:
Yard,Workshop,Kitchen,Medbay Core/Admin(intake, control corridors) - most protected
Each Zone has:
ZoneSecurityLevel (0..7)ZoneThreatPoints(rises from incidents, decays during calm)ZoneLockState(door/checkpoint/scanner mode)
Prison-wide:
PrisonSecurityLevel (0..7)- only rises if multiple zones destabilize.
Player Security Profile (Server-Authoritative)
Short-term
- Heat: recent trouble (minutes), used for “how fast guards escalate on you”.
- Wanted (Warrant): “detain on sight” (longer than Heat).
Event flag
- Riot Participant: only set by specific actions.
Long-term
- Offender Tier: repeat violent behavior compounding consequences (hours/days). Players do not see this, internal only.
Fairness doctrine: Security escalations punish behavior, not proximity.
Enforcement: Detain → Transfer (No Escorts)
Why
“Guards escorting players around” does not scale. It becomes janky and exploitable.
Detain Flow (with a small chance to run)
Guards must land detain, and players get counterplay.
flowchart TD A[Guard decides arrestable] --> W[Warning window 1.5-3s] W -->|Comply| H[Transfer: Holding/Intake (light)] W -->|Run| P[Pursuit] P --> X{Capture move hits?} X -->|Miss| P X -->|Hit| S[Stagger 0.8-1.2s] S --> CH[Cuff channel ~2.0s] CH -->|Break distance / interrupt| P CH -->|Complete| D[Detained 2.0s] D --> T[Transfer: Holding/Cell/Seg based on severity + tier]
Capture Moves (must be dodgeable / missable)
- Tackle (telegraphed)
- Net/Bola (projectile)
- Baton stun (short range)
- Grab (very short range)
Severity scaling (escape chance without RNG)
- Minor (curfew/trespass): more warning time, easier LoS break
- Contraband: moderate
- Attack guard/riot: minimal warning, exits seal fast, checkpoints intercept aggressively
Optional stat hooks (physical)
- Stealth: line-of-sight break + detection radius
- Dexterity: dodge/counter windows vs tackle/net
- Endurance: sprint duration + slightly reduced stagger duration
- Strength (optional): rare “break free” during cuff channel (loud, costly)
Riot Participant Rules (Anti-Abuse)
A player becomes Riot Participant if they:
- Deal damage to a guard
- Interfere with an arrest (hit/stun a guard during detain/cuff channel)
- Damage security infrastructure (blast doors, scanners, control panels)
- Repeat “checkpoint blocking” while Wanted (design choice)
A player does NOT become Riot Participant for:
- Being nearby / in the same zone
- Being trapped by sealed doors
- Running from a guard for a minor infraction
- Watching
Security Levels (0-7) - Balanced + Localized
Levels are environment + rules toggles, not “spawn more guards”.
Key balance rule:
- L4 closes the affected zone hard (containment), but does NOT close the prison.
- Sector/prison-wide closures belong to L6+.
stateDiagram-v2 [*] --> L0 L0 --> L1: minor incidents L1 --> L2: repeated trouble / contraband confirmed L2 --> L3: organized trouble / sustained fights L3 --> L4: serious incident / prolonged unrest L4 --> L5: riot triggers L5 --> L6: multi-zone instability L6 --> L7: sustained prison-wide crisis L7 --> L6: long calm window L6 --> L5: calm window L5 --> L4: calm window L4 --> L3: calm window L3 --> L2: calm window L2 --> L1: calm window L1 --> L0: calm window
L0 - Normal
Intent: routine operations
Affected Zone
- Doors normal
- Checkpoints normal
Outside Zone
- No changes
L1 - Alert
Intent: “more eyes” in-zone, minimal friction
Typical triggers (any)
- 1-2 fights detected in 3 minutes
- Suspicious clustering around checkpoints
- Low-severity infractions repeating
Affected Zone
- More frequent scans at checkpoints
- Guards warn quicker (VO/UI)
Outside Zone
- No changes
Non-participants
- Inconvenience: tiny (more scans)
L2 - Checks
Intent: targeted enforcement without stopping normal life
Typical triggers (any)
- Contraband confirmed (1-2 events)
- Arrest interference (1 event)
- Group fight size threshold reached (see trigger table)
Affected Zone
- Checkpoints become Controlled (scan required to cross)
- Stop Wanted at checkpoints (intercept attempts)
- Sensitive doors permissioned (storage/admin rooms)
Outside Zone
- Unaffected zones remain normal
Non-participants
- Pass through scanners, no penalties
L3 - Restriction (Localized)
Intent: limit movement out of the hot zone, keep the rest of prison playable
Typical triggers (any)
- Multiple fights sustained
- Organized trouble group size reached
- Arrests repeatedly disrupted
Affected Zone
- Zone becomes semi-sealed
- Only 1-2 exits remain open and controlled by scanners
- Checkpoints enforce:
- Stop Wanted
- Stricter scan failure handling (warn → intercept)
- Guards prefer holding choke points (not chasing crowds)
Outside Zone
- No hard closures
- Normal operations continue
Non-participants
- Still can function in-zone
- Can exit via safe controlled checkpoint if not Wanted
L4 - Seal & Sweep (Localized Containment)
Intent: contain serious incident inside one zone without punishing others
Typical triggers (any)
- Guard KO / severe injury
- Sabotage of security devices
- Prolonged L3 (no calm for X minutes)
- High fight count sustained
Affected Zone ONLY
- Blast doors seal all exits except:
- ONE Safe Corridor Exit (scanner-controlled) for non-wanted players OR
- Comply → Return to Cell option (teleport)
- Sweep mode:
- Repeated scans inside zone
- Wanted/Riot Participants are intercepted aggressively
- Sensitive rooms locked hard
Outside Zone
- No hard closures
- Checkpoints run slightly stricter scans (optional)
Non-participants
- Must have a clean escape hatch:
- Safe exit OR comply-to-cell
- No punishments, no flags
L5 - Riot Protocol (Participant Removal)
Intent: end mass violence fast by isolating offenders (in-world)
Typical triggers (any)
- Guard death
- Riot Participant count reaches threshold
- L4 persists beyond time limit with continued violence
- Multiple guard attacks within short time window
Affected Zone
- Remains sealed
- Intercept rules:
- Any Riot Participant = detain priority
- Checkpoint intercepts go “hard” (short warning, quicker capture attempts)
Outside Zone
- Still not prison-wide locked (unless spread)
- Travel around hot zone via corridors if map supports
Non-participants
- Same escape hatch as L4
- Safe routes prioritized
L6 - Emergency Lockdown (Multi-Zone / Sector)
Intent: only when multiple zones go unstable; still protect normal players
Typical triggers
- 2 zones reach L5 within 10 minutes
- Repeated L5 loops with no calm window
- Riot spreads across checkpoints
Effects
- Inter-zone travel restricted (controlled)
- Minimal ops:
- Essential paths only (cells/medbay core/minimal canteen)
- Offender Tier escalates faster for violent actions during L6
Non-participants
- Inconvenience: moderate travel restrictions
- No punishments; access to essentials preserved
L7 - Prison Crisis (Server Protection Mode)
Intent: rare “stop the bleeding”; restore stability fast
Typical triggers
- 3+ zones at L5 within 15 minutes
- Sustained L6 beyond time threshold
- Coordinated prison-wide assault patterns
Effects
- Full lockdown rules temporarily
- Aggressive offender isolation:
- Violent players routed to Segregation / High-Sec
- Stability priority > freedom
Non-participants
- Temporary global restriction, but short-lived
- Safe hubs + essentials remain available
Trigger Values (Start Numbers - Tune Later)
These are starter values. Expect tuning. The design supports both hard triggers (counts/timers) and ThreatPoints.
Hard Trigger Table (recommended)
| Event Type | Window | Value | Notes |
|---|---|---|---|
| Fight detected (players in combat) | 30s | >= 4 | Escalate toward L2 |
| Large fight detected | 30s | >= 8 | Escalate toward L3 |
| Mass fight detected | 30s | >= 12 | Escalate toward L4 |
| Guard attacked by multiple attackers | 10s | >= 3 attackers | Immediate L3 in-zone |
| Guard attacked by many | 10s | >= 6 attackers | Immediate L4 in-zone |
| Guard KO (downed) | Instant | 1 | Immediate L4 |
| Guard death | Instant | 1 | Immediate L5 |
| Arrest interference events | 60s | >= 2 | Escalate one level |
| Security device damage (door/scanner/panel) | 60s | >= 1 | +1 level (L2+) |
| Riot Participant count | 120s | >= 6 | Escalate to L5 |
| Riot persists with no calm | - | >= 90s | L4 → L5 |
| Multi-zone L5 | 10m | >= 2 zones | Trigger L6 |
| Multi-zone L5 widespread | 15m | >= 3 zones | Trigger L7 |
”5 players hit a guard” rule (scales)
If a guard is hit by >= 3 attackers within 10s:
- Guard enters Call Alarm
- Offenders are snapshot tagged (Wanted + possible Riot flag)
- Zone containment activates (doors/checkpoints)
- Guard AI switches to Hold Choke (does not chase)
ThreatPoints (Secondary, for smoother tuning)
Event → ThreatPoints (starter)
- Inmate vs inmate fight: +5
- Large fight (>= 8): +15 (in addition to per-fight, or replace)
- Arrest interference: +10
- Contraband confirmed: +8
- Attack guard: +15
- Security device damage: +25
- Guard KO: +35
- Guard death: +80
- Active riot pressure: +2 per Riot Participant per minute
ThreatPoints → Level thresholds (starter)
- L1: 10+
- L2: 25+
- L3: 50+
- L4: 80+
- L5: 140+
- L6/L7: driven by multi-zone rules (not just points)
Calm / decay (starter)
Calm means:
- No guard attacks
- No sabotage
- No arrest interference
- No mass fights
Decay suggestions:
- L1-L2 calm: -3 pts/sec
- L3 calm: -2 pts/sec
- L4+ calm: -1 pts/sec
Any new qualifying incident resets calm timer.
Doors & Checkpoints Rules (Localized vs Outside)
Affected Zone Rules (by level)
| Level | Zone Exits | Internal Sensitive Rooms | Checkpoints | Notes |
|---|---|---|---|---|
| L0 | Open | Open | Normal | - |
| L1 | Open | Open | More scans | - |
| L2 | Controlled | Controlled | Stop Wanted | Targeted |
| L3 | 1-2 controlled exits | Locked | Stop Wanted + strict | Semi-seal |
| L4 | Sealed + 1 safe exit OR comply-to-cell | Locked hard | Sweep mode | Containment |
| L5 | Sealed | Locked hard | Aggressive intercept | Remove rioters |
| L6 | Sealed | Locked hard | Sector rules | Multi-zone |
| L7 | Sealed | Locked hard | Crisis rules | Server protection |
Unaffected Zone Rules (by level elsewhere)
- Remain L0-L2 behaviors, unless their own incidents raise them.
- Do not hard-close because another block hit L4.
- Only at L6+ do inter-zone restrictions apply broadly.
Processing Outcomes (Transfer Destinations)
Destinations
- Holding (Intake): minor, short, mostly “reset to routine”
- Cell (Standard): medium severity / repeat non-violent
- Segregation (High-Sec wing): violent / riot / repeat offenders
Mapping (starter)
- Trespass / curfew: Holding (5-15 min)
- Contraband: Cell + confiscation + job lockout
- Assault inmate: Cell (15-60 min) + increased scans
- Attack guard / arrest interference: Segregation (30-180 min)
- Guard death / sabotage: Segregation + Offender Tier increase
Offender Tier (Long-Term Anti-Grief)
Tier increase triggers
- +1 tier: attack guard / sabotage / repeated riot participation within 6-12h
- +1 tier: multiple detains for violence within a short window
- Tier decay: slow (hours/days), not minutes
Suggested behavior per tier
- Tier 0: normal
- Tier 1: more scans, sensitive job lockouts
- Tier 2: detain routes to segregation more often
- Tier 3: assigned high-sec block routines, limited movement windows
- Tier 4: effectively “living” in high-sec until long calm period
Goal:
- Griefing doesn’t ruin the server - it ruins the griefer’s routine.
Segregation / High-Sec (No Instancing)
Segregation is a real physical wing on the same server:
- Small cells, tiny yard, controlled corridors
- Minimal job options
- Frequent scans
- Movement permissions extremely limited
Used for:
- Riot participants after processing
- Repeat violent offenders
- Sabotage-heavy offenders
Guard AI (Minimal, Scalable)
Guards are not MMO police escorts. They are:
- Detectors
- Taggers
- Choke holders
States (minimum)
- Patrol → Warn → Pursue (single target) → Capture Attempt → Cuff Channel → Detain/Transfer
- If multi-attacked: Call Alarm → Hold Choke
Multi-attacker rule:
- If attacked by >= 3 offenders in 10s: do not pursue
- Tag offenders + trigger zone containment
Edge Cases (Must-Haves)
Disconnects
If player logs out while Wanted/Detained:
- On login, spawn in Holding/Cell/Seg based on severity
- Prevents logout-cheese
Death/Respawn
If player dies while Wanted/Riot Participant:
- Respawn into Holding/Cell/Seg
- Flags do not reset
”Stuck in sealed zone”
- Non-wanted must have: safe exit OR comply-to-cell
- Wanted do not get a free exit (by design)
Player Feedback (So it feels fair)
Always show why something happened:
- “Block B sealed due to Sweep Protocol.”
- “You are Wanted: Assaulting Security.”
- “Checkpoint denied: Wanted status.”
- “Compliance option available: Return to cell.”
Never silent teleports without a reason message.
Telemetry (for tuning)
Track these:
- Riot triggers per hour
- Avg time zones spend at L3+
- Riot Participants per riot
- Offender tier distribution
- False positives (players incorrectly flagged)
- How often non-participants use comply-to-cell (friction signal)
Implementation Notes (Data Model)
Zone
- id
- securityLevel (0..7)
- threatPoints
- lockState
- lastIncidentAt
- calmSeconds
PlayerSecurity
- heat
- wantedUntil
- riotFlagUntil (or per-incident log)
- offenderTier
- lastGuardAssaultAt
- lastDetainAt
Events (inputs)
- FightDetected(participants, zone)
- GuardHit(attackerId, zone)
- GuardKO(zone)
- GuardDeath(zone)
- ArrestInterference(attackerId, zone)
- SecurityDeviceDamage(zone, deviceId)
- ContrabandConfirmed(playerId, zone)
MVP Checklist
- Zones + threat points + decay
- Security levels 0-7 per zone
- Hard triggers (counts/timers) + ThreatPoints thresholds
- Wanted + Riot Participant tagging rules
- Detain flow: warning → capture → cuff channel → detained → transfer
- Checkpoint gating (Stop Wanted)
- Blast doors + safe exit OR comply-to-cell at L4+
- Segregation wing routing
- Offender Tier escalation + slow decay
Integration Points
- Reputation (external opinion; NOT a skill)
- Heat (short-term detection + enforcement bias)
- Jobs (access gates based on reputation + suspicion + offender tier)
- Needs (lockdowns change routines; stress rises in sealed zones)
Tuning Knobs (Start Values)
- Warning window: 2.0s
- Cuff channel: 2.0s
- LoS break time: 6-10s (depends on level)
- Riot threshold: guard death OR 6+ participants OR sustained L4 90s (no calm)
- L4 compliance option appears after 10-20s of seal
- Offender tier decay: 6-24 hours per tier (design choice)
Design Promise (Player-Facing)
- If you follow rules, the prison protects your play session.
- If you riot, the prison isolates you quickly and your routine gets worse.
- Griefing doesn’t ruin the server - it ruins the griefer.