Skip to content
Pablo Rodriguez

Stealth Coverage System

Stealth coverage represents environmental elements that hide the player from enemy detection. Unlike ability-based stealth, coverage stealth is location-dependent and provides concealment when players position themselves within designated areas.

Create stealth coverage tracking system:

  • Stealth Coverage Array: Array of boolean values to track multiple coverage areas
  • Coverage State Logic: Automatically enter stealth when in coverage and not in combat

Create interface functions for stealth coverage communication:

  • Interface_Stealth_Coverage_Add: Called when entering coverage area
  • Interface_Stealth_Coverage_Remove: Called when exiting coverage area

When player enters stealth coverage area:

Event_Stealth_Coverage_Add() {
add_value_to_stealth_coverage_array;
if (not_in_combat) {
turn_stealth_on;
}
// If in combat, do nothing but track coverage
}

When player exits stealth coverage area:

Event_Stealth_Coverage_Remove() {
remove_index_0_from_coverage_array;
if (coverage_array_has_no_entries) {
if (in_combat) {
turn_stealth_off;
}
// If not in combat, maintain stealth
}
}

Modify stealth deactivation to check for coverage:

F_Stealth_Off() {
if (stealth_coverage_array_has_entries) {
if (in_combat) {
proceed_to_turn_stealth_off;
return_mesh_to_normal_appearance;
} else {
do_nothing; // Stay in stealth due to coverage
}
} else {
proceed_to_turn_stealth_off;
return_mesh_to_normal_appearance;
}
}

When combat state ends, check for automatic stealth activation:

F_Combat_State_Off() {
set_combat_to_false;
if (stealth_coverage_array_has_entries) {
turn_stealth_on; // Auto-enter stealth if in coverage
}
}

This ensures players automatically return to stealth when combat ends if they’re still in coverage areas.

Create environmental stealth coverage areas:

  • Box Collision: Defines coverage area boundaries
  • Static Mesh Cube: Visual reference for level designers (hidden in game)
  • Collision Settings: Box collision set to overlap pawns only
  • Box Extent: 50x50x50 units (matching cube size)
  • Collision Type: Custom collision
  • Collision Response: Ignore all, overlap pawn only
  • Generate Overlap Events: Enabled
  • Cube Mesh: No collision, no overlap events, hidden in game
  • Cube Material: Translucent blue material (30% opacity) for designer visibility

Create visual material for designers:

  • Blend Mode: Translucent
  • Base Color: Light blue vector constant
  • Opacity: 0.3 constant value
  • Dynamic Material: Allow runtime color changes for different coverage types

Implement collision detection:

// Box Collision Begin Overlap
OnBeginOverlap(OtherActor) {
OtherActor.Stealth_Coverage_Add();
}
// Box Collision End Overlap
OnEndOverlap(OtherActor) {
OtherActor.Stealth_Coverage_Remove();
}

Position stealth coverage actors around environmental features:

  • Shrubbery Areas: Natural concealment locations
  • Shadow Regions: Areas with logical concealment
  • Environmental Cover: Behind walls, under structures, in dense vegetation
  • Resize box collision to match environmental features
  • Create multiple coverage areas for large concealment zones
  • Ensure coverage areas don’t overlap in confusing ways

Test coverage system interactions:

  • Enter coverage while not in combat (should enter stealth)
  • Attack while in coverage (should enter combat, break stealth)
  • End combat while still in coverage (should return to stealth)
  • Move between multiple coverage areas (should maintain stealth)
  • Attack outside coverage (enter combat, no stealth return)
  • Attack inside coverage (enter combat, auto-return to stealth after 5 seconds)
  • Use abilities that trigger combat state while in coverage

The stealth coverage system provides tactical positioning gameplay and creates clear risk/reward decisions for players choosing between safety and mobility.