Skip to content
CVL COREEngine

Role-Aware Kinematics, Anti-Cheat Guardrails & Macro-Zones

[SPECIFICATION] Role-Aware Kinematics & Macro-Zone Invariant

The CVL CORE Role-Aware Kinematics & Macro-Zone Engine governs authoritative velocity validation, hardware-clamped monotonic sequence verification, dual-state coordinate rollbacks, hierarchical vehicle authority transfer, and cross-zone coordinate re-anchoring within the CVL CORE Spatial Micro-Kernel. By replacing legacy single-speed thresholds with role-specific movement envelopes and a circular modulo-4 generation epoch gate, the subsystem eliminates time-dilation exploits, "ghost sprint" desynchronization, and border-straddling coordinate oscillation.


[SEC 01.0] Executive Architecture & Subsystem Topology

Section titled “[SEC 01.0] Executive Architecture & Subsystem Topology”

Rather than applying a rigid, single-speed scalar across all dynamic actors, the Broadphase Spatial Computing Engine evaluates movement envelopes according to an entity’s immutable session classification and active environmental modifiers. (For the complete 11-role EntityRole specification and memory slot allocation rules, consult Universal Entity Taxonomy & Memory Allocator).

[ENVELOPES] Decoupled Horizontal & Vertical Displacement Envelopes
Section titled “[ENVELOPES] Decoupled Horizontal & Vertical Displacement Envelopes”

The legacy single-speed configuration constant (MAX_ALLOWED_SPEED) is permanently retired. During Phase 1 of every 30Hz tick, the engine decouples 2D horizontal translation (dX, dY) from 1D vertical elevation (dZ) so downward gravitational falls never falsely trip horizontal speed limits:

  • Grounded 2.5D Profile (ROLE_OPERATOR_HUMAN = 4, ROLE_MOBILE_GROUNDED = 6): Horizontal squared distance (dX^2 + dY^2) is validated against DynamicMaxDistSq = (MAX_GROUNDED_SPEED * speed_modifier * 1.35 * dt)^2. Upward vertical displacement (target_z - current_z) must remain <= MAX_JUMP_HEIGHT (5.0m), whereas downward gravitational trajectories (target_z < current_z) bypass vertical jump strikes.
  • Aerial 6-DOF Profile (ROLE_MOBILE_AERIAL = 7): Autonomous drones and aircraft are evaluated against DynamicMaxDistSq = (MAX_FLYING_SPEED * speed_modifier * 1.15 * dt)^2. Aerial actors bypass vertical jump strike counters entirely, clamping vertical elevation strictly within [0.0, MAX_FLIGHT_CEILING].
  • Environmental Volume Modifiers (Role 4 vs. ROLE_VOLUME_TRIGGER = 11): When an interactive human operator overlaps within a 3.0m bounding box of a non-blocking volume trigger during the 9-cell broadphase sweep, the engine dynamically unlocks vertical Z-axis elevation checks and scales the local velocity multiplier (0.5x), enabling vertical climbing (ladders/elevators) or hazard dampening zones without triggering anti-cheat violations.
[HIERARCHY] Hierarchical Vehicle Authority & Abandoned Asset Culling
Section titled “[HIERARCHY] Hierarchical Vehicle Authority & Abandoned Asset Culling”

When an operator boards a grounded vehicle (Role 6) or aerial platform (Role 7), the server validates seat capacity, scans active hierarchy links to prevent cyclic parent loops, and binds the passenger’s parent reference to the host vehicle’s NetID—immediately broadcasting an authoritative 32-byte OP_SET_POS frame to synchronize the hierarchy layout:

  • Spatial Authority Transfer: Mounted passengers explicitly bypass individual 30Hz distance validation and static obstacle collision sweeps. Spatial coordinates and macro-zone generation epochs are inherited directly from the host vehicle’s 64-byte memory slab.
  • Abandoned Vehicle Reclamation: During Tier 3 background maintenance sweeps (5.0-second cadence), the reaper inspects active Role 6 and Role 7 vehicles. Any unpossessed vehicle (zero mounted passengers) remaining stationary beyond IDLE_TIMEOUT (300.0s) is automatically routed to the Phase 2 teardown queue with REASON_TIMEOUT (0x01).

[SEC 02.0] Concurrency & State Ownership / Lifecycle

Section titled “[SEC 02.0] Concurrency & State Ownership / Lifecycle”

All kinematic timebase clamping, strike accumulation, coordinate rollbacks, and macro-zone transitions execute synchronously on the single-threaded Authoritative Simulation Orchestrator. The spatial engine is strictly prohibited from invoking direct entity teardowns during a physics sweep; instead, terminal anti-cheat evictions are queued into the amortized Phase 2 teardown pipeline.

Architecture: Monotonic Timebase Clamping, Rollback & Modulo-4 Zone Hysteresis
A) HARDWARE-CLAMPED MONOTONIC TIMEBASE & ANTI-CHEAT ROLLBACK (30Hz Phase 1)
[Inbound OP_TELEMETRY (16B)] ---> Extract uint16 Client Sequence Delta
|
|-- Clamp Sequence vs. Server Hardware Clock: max_ticks = int(elapsed * 30.0) + 2
|-- Compute Validated Step: dt = delta_ticks * 0.03333333333333333s
v
[Evaluate Role-Aware Displacement Envelope (2D Horizontal + 1D Vertical)]
|
+-- (Legal Move) -----> Commit to 64B Memory Slab & Flag Dirty for 15Hz Egress
|
+-- (Violation) ------> Synchronize Cached X/Y/Z with Reverted 64B Slab
|-- Dispatch Authoritative OP_SET_POS (32B Rollback)
+-- Increment Strikes ---> (> Limit: Queue REASON_SPEEDHACK)
B) MACRO-ZONE BOUNDARY HYSTERESIS & MODULO-4 EPOCH GATE
Zone A (Epoch 1) Boundary Zone B (Epoch 2)
------------------------------------+----------------+------------------------------------
|<-------------->|
| Hysteresis |
Entity [E] =====================>|================*---> Crosses Hysteresis Margin!
| | 1. Advance ZoneEpoch: (1+1)%4 = 2
| | 2. Enqueue OP_SET_POS (32B)
| | 3. Drip OP_ZONE_EVENT (22B)
[TIMEBASE] Monotonic Sequence Clamping & Time-Dilation Defense
Section titled “[TIMEBASE] Monotonic Sequence Clamping & Time-Dilation Defense”

Client telemetry frames (OP_TELEMETRY) carry an unsigned 16-bit sequence counter (uint16) to communicate elapsed simulation steps between packets. To prevent malicious clients from spoofing inflated sequence deltas to multiply their permitted dt movement window (“speedhacking via time dilation”), the engine enforces a two-step hardware timebase clamp:

  1. Wrap-Safe Sequence Extraction: The raw sequence advance is extracted via 16-bit unsigned bitmasking: raw_delta = (incoming_seq - prior_seq) & 0xFFFF.
  2. Hardware Clock Ceiling: The server calculates the maximum physically possible ticks elapsed on the host hardware clock since the previous packet: max_legal_ticks = int(server_elapsed_sec * 30.0) + 2. If raw_delta > max_legal_ticks, the sequence counter is clamped inline to (prior_seq + max_legal_ticks) & 0xFFFF, neutralizing client tick-burst and speedhack exploits.
  3. Deterministic dt Derivation: If the validated tick delta is 0 or exceeds 30 (1.0 second), dt defaults to a single 30Hz step (0.033333s); otherwise, dt = delta_ticks * 0.03333333333333333.
[ROLLBACK] Authoritative Rollback & Ghost Sprint Elimination
Section titled “[ROLLBACK] Authoritative Rollback & Ghost Sprint Elimination”

When an unmounted entity exceeds its role-aware displacement envelope, submits IEEE 754 NaN/Infinity floats, or attempts to penetrate static geometry:

  • Eliminating the “Ghost Sprint” Desynchronization Flaw: Upon a kinematic breach, the server rolls back the 64-byte contiguous memory slab slice and explicitly synchronizes the entity’s cached coordinate properties (x, y, z) to match the reverted slab coordinates prior to dispatching a 32-byte OP_SET_POS correction. Synchronizing both state layers simultaneously prevents subsequent ticks from evaluating movement deltas against an un-reverted coordinate cache (which would otherwise allow a client to “ghost sprint” through repeated violations).
  • Strike Accumulation & Phase 2 Queuing: Each violation increments the entity’s security strike counter and routes a velocity_violation diagnostic token to the security log channel (engine_security.log). Exceeding NETWORK_STRIKE_LIMIT stamps REASON_SPEEDHACK (0x02) on the entity and appends its EID to the Phase 2 teardown queue for clean, amortized eviction. Offline entities awaiting teardown automatically bypass physics sweeps to prevent frozen timestamps from generating secondary false-positive strikes.

[SEC 03.0] Macro-Zone Hysteresis & Modulo-4 Epoch Synchronization

Section titled “[SEC 03.0] Macro-Zone Hysteresis & Modulo-4 Epoch Synchronization”

In CLUSTER_GRID map topologies, the global world (WORLD_WIDTH = GRID_COLS * ZONE_SIZE, WORLD_HEIGHT = GRID_ROWS * ZONE_SIZE) is partitioned into power-of-two macro-zones (e.g., 512m x 512m sectors). Because wire broadcasts pack zone-local coordinates (0.0 to ZONE_SIZE) to maximize bitfield precision, crossing a zone boundary shifts the coordinate origin.

[HYSTERESIS] Boundary Hysteresis & Dual-Packet Transition Flow
Section titled “[HYSTERESIS] Boundary Hysteresis & Dual-Packet Transition Flow”

To prevent entities straddling a zone border from rapidly oscillating between coordinate origins, macro-zone transitions require the entity’s position to cross the boundary plus a configurable hysteresis buffer (32.0m):

  1. Immediate Epoch Increment & Re-Anchor (OP_SET_POS): The instant an entity clears the 32.0m hysteresis threshold into a new macro-zone during Phase 1, the server updates the active zone index, increments the entity’s ZoneEpoch counter modulo 4 ((epoch + 1) % 4), locks the new zone origin coordinates, and enqueues an authoritative 32-byte OP_SET_POS envelope carrying the new 1-byte ZoneEpoch tag into the Critical FIFO Buffer.
  2. Staggered Phase 3 Zone Event Drip (OP_ZONE_EVENT): During Phase 3 of the 30Hz tick, a staggered round-robin auditor inspects one entity per tick to dispatch the 22-byte OP_ZONE_EVENT notification envelope and queue dirty persistence snapshots to PostgreSQL, ensuring zone transition telemetry never spikes frame times during mass border crossings.
Algorithm: Conceptual Modulo-4 Epoch Gate & Hysteresis Evaluation
# 1. Server Stage 5 Macro-Zone Hysteresis Check (Power-of-Two Bitwise Shift)
candidate_zone_x = int(resolved_x) >> zone_shift
candidate_zone_y = int(resolved_y) >> zone_shift
# Verify entity has penetrated past the 32.0m boundary hysteresis margin
if (candidate_zone != active_zone) and (distance_past_border >= 32.0):
active_zone = candidate_zone
zone_epoch = (zone_epoch + 1) & 0x03 # Modulo-4 advance (0 -> 1 -> 2 -> 3 -> 0)
# Lock new zone origin and enqueue 32-byte OP_SET_POS to Critical FIFO Buffer
# 2. Bidirectional Modulo-4 Circular Epoch Gate (Client & Server Ingress)
delta_epoch = (incoming_packet_epoch - local_current_epoch + 4) & 0x03
if delta_epoch == 0:
# Synchronized with current macro-zone origin -> Apply kinematics normally
process_frame()
elif delta_epoch == 1:
# Packet arrived from newer zone generation ahead of transition notice -> Auto-heal
local_current_epoch = incoming_packet_epoch
process_frame()
else:
# delta_epoch in (2, 3): Stale in-flight frame from prior zone origin -> Drop silently!
discard_stale_frame()
[RECONCILIATION] Client Rollback Blending & Deadzone Thresholds
Section titled “[RECONCILIATION] Client Rollback Blending & Deadzone Thresholds”

When the CVL CORE Presentation Bridge receives an authoritative 32-byte OP_SET_POS frame—either from a macro-zone re-anchor or an anti-cheat rollback—it avoids jarring visual camera snaps through a three-tier reconciliation model in CVLPlayerController:

  • Macro-Zone Re-Anchor Deadzone (<= 2.0m): Discrete zone origin updates permanently re-anchor the client’s local coordinate math, but only force a physical transform override if spatial divergence between the local controller and the server coordinate exceeds the 2.0m deadzone threshold.
  • Sub-Threshold Visual Decay (0.15m to 2.0m): For minor physics rollbacks between ROLLBACK_BLEND_THRESHOLD (0.15m) and ROLLBACK_HARD_SNAP_THRESHOLD (2.0m), the root CharacterController snaps to the authoritative server coordinate (bleeding vertical velocity to 0.0f and invoking Physics.SyncTransforms() strictly for the local player), while the child VisualPivot accumulates the positional delta (rollbackVisualOffset) and decays it smoothly to zero at render framerate (Time.deltaTime * 15.0f).
  • Hard Teleport Snap (> 2.0m): Divergences exceeding 2.0m (such as initial spawn anchoring or severe anti-cheat rollbacks) snap both the physical capsule and visual pivot immediately.

[SEC 04.0] Architectural Invariants & Guardrails

Section titled “[SEC 04.0] Architectural Invariants & Guardrails”

Maintaining deterministic agreement between the client controller and the server’s role-aware kinematics engine requires strict adherence to initialization, mounting, and prefab validation rules.

[GUARDRAIL] Boot-Time Schema Validation & Loopback Exemptions
Section titled “[GUARDRAIL] Boot-Time Schema Validation & Loopback Exemptions”

At engine bootstrap, the configuration validator enforces strict positive bounds across all role-aware parameters (MAX_GROUNDED_SPEED > 0.0, MAX_FLYING_SPEED > 0.0, MAX_JUMP_HEIGHT >= 0.0, and MAX_FLIGHT_CEILING >= 0.0), raising an immediate fatal ValueError if any boundary is violated or omitted. Hardware anti-cheat bypasses are restricted exclusively to local loopback development endpoints (127.0.0.1, ::1, localhost) and server-driven synthetic bots (ROLE_OPERATOR_SYNTHETIC = 5).

[GUARDRAIL] Initial Spawn Telemetry Gate & Fixed-Step Clamping
Section titled “[GUARDRAIL] Initial Spawn Telemetry Gate & Fixed-Step Clamping”

To prevent newly connected clients from transmitting uninitialized (0, 0, 0) coordinates prior to receiving their Stage 4 spawn anchor (OP_SET_POS)—which would register as an instantaneous cross-map teleport and trigger a false-positive REASON_SPEEDHACK (0x02) strike—CVLPlayerController gates all 30Hz OP_TELEMETRY dispatch behind hasReceivedInitialServerPos == true. Furthermore, the client fixed-step telemetry accumulator clamps elapsed frame time to a maximum of 3 ticks (tickInterval * 3.0f) to prevent client render hitches from flushing a sudden burst of catch-up movement steps.

[GUARDRAIL] Hierarchical Mount Socket & Local Input Suspension
Section titled “[GUARDRAIL] Hierarchical Mount Socket & Local Input Suspension”

When an entity mounts a Role 6 or Role 7 vehicle (ParentNetID > 0), the client Presentation Bridge parents the passenger transform to the vehicle’s "Passenger Socket" child transform, zeroes local position/rotation offsets, disables the local CharacterController, and sets CVLEngineAPI.IsInputSuspended = true (which locks physical WASD translation while keeping the mandatory 30Hz OP_TELEMETRY heartbeat active). To guarantee mount compatibility, the CVLPrefabValidator editor tool enforces a hard GUI lock that rejects any Role 6 or Role 7 vehicle prefab missing a "Passenger Socket" child transform.

[CHECKLIST // INVARIANTS] KINEMATICS, ROLLBACK & MOUNTING GUARDRAILS

1. Mandatory Config Keys: Always define MAX_GROUNDED_SPEED, MAX_FLYING_SPEED, MAX_JUMP_HEIGHT, and MAX_FLIGHT_CEILING in cvlcore_engine_config.json.
2. Dual-State Rollback Parity: Server rollbacks must synchronize cached x, y, z properties with the reverted 64-byte memory slab before dispatching OP_SET_POS to prevent "ghost sprinting."
3. Vehicle Passenger Socket: Every Role 6 (ROLE_MOBILE_GROUNDED) and Role 7 (ROLE_MOBILE_AERIAL) prefab must include a child Transform named "Passenger Socket".
4. Kinetic Bleed & Spawn Gate: Zero verticalVelocity (0.0f) on OP_SET_POS rollbacks, and never transmit OP_TELEMETRY until hasReceivedInitialServerPos == true.


[SEC 05.0] Configuration Schema & Client Kinematics Integration

Section titled “[SEC 05.0] Configuration Schema & Client Kinematics Integration”

Server operators configure role-aware speed limits and macro-zone dimensions in cvlcore_engine_config.json (which hydrate automatically into the Unity CVLEngineConfig ScriptableObject via CVLServerConfigBridge), while client scripts bind to zone transitions and camera/input suspension hooks through CVLEngineAPI.

[CONFIG] Role-Aware Kinematics & Macro-Zone Configuration (cvlcore_engine_config.json)
Section titled “[CONFIG] Role-Aware Kinematics & Macro-Zone Configuration (cvlcore_engine_config.json)”
config/cvlcore_engine_config.json
{
"MAP_MODE": "CLUSTER_GRID",
"ZONE_SIZE": 512,
"GRID_COLS": 2,
"GRID_ROWS": 2,
"Z_AXIS_BIAS": 100.0,
"MAX_GROUNDED_SPEED": 8.0,
"MAX_FLYING_SPEED": 20.0,
"MAX_JUMP_HEIGHT": 5.0,
"MAX_FLIGHT_CEILING": 250.0,
"NETWORK_STRIKE_LIMIT": 15,
"IDLE_TIMEOUT": 300.0
}
[IMPLEMENTATION] Client Mount Inspection, Input Lock & Zone Event Integration (CVLEngineAPI.cs)
Section titled “[IMPLEMENTATION] Client Mount Inspection, Input Lock & Zone Event Integration (CVLEngineAPI.cs)”

The following C# integration pattern demonstrates reading hydrated kinematic limits from CVLEngineConfig, toggling CVLEngineAPI.IsInputSuspended during UI or camera mode switches without interrupting the 30Hz telemetry heartbeat, and listening for macro-zone boundary events:

Assets/CVL_CORE_SDK/API/KinematicsAndZoneIntegration.cs
using UnityEngine;
using CVLCore.SDK;
public class KinematicsAndZoneIntegration : MonoBehaviour
{
[SerializeField] private CVLEngineConfig engineConfig;
private void Start()
{
// Kinematic boundaries are hydrated directly from cvlcore_engine_config.json
Debug.Log($"Hydrated Grounded Speed Ceiling: {engineConfig.maxGroundedSpeed} m/s | " +
$"Aerial Ceiling: {engineConfig.maxFlyingSpeed} m/s (Max Alt: {engineConfig.maxFlightCeiling}m)");
}
private void OnEnable()
{
CVLEngineAPI.OnZoneEventTriggered += HandleZoneTransition;
CVLEngineAPI.OnEntityDespawned += HandleEntityDespawned;
}
private void OnDisable()
{
CVLEngineAPI.OnZoneEventTriggered -= HandleZoneTransition;
CVLEngineAPI.OnEntityDespawned -= HandleEntityDespawned;
}
public void SetOverlayMenuOpen(bool isMenuOpen)
{
// Suspends physical WASD / mouse translation while preserving the 30Hz OP_TELEMETRY heartbeat
CVLEngineAPI.IsInputSuspended = isMenuOpen;
}
private void HandleZoneTransition(string eid, int newZoneId)
{
// Dispatched upon receipt of 22-byte OP_ZONE_EVENT after clearing +32.0m border hysteresis
Debug.Log($"Entity {eid} anchored to Macro-Zone {newZoneId} (Modulo-4 Epoch Synchronized).");
}
private void HandleEntityDespawned(string eid, byte reasonCode)
{
if (reasonCode == ProtocolConstants.REASON_SPEEDHACK)
{
Debug.LogError($"Entity {eid} evicted by Role-Aware Kinematics Guardrail (0x02).");
}
}
}
Section titled “[RELATED SPECS] Cross-Category Subsystem Links”