Skip to content
Pablo Rodriguez

Player Noise System

The player noise system enables AI to detect player actions based on the volume and type of activities performed. This creates tactical gameplay where players must consider how their actions might alert nearby enemies.

Create standardized noise levels for different player actions:

  • 0%: Silent actions (no noise generated)
  • 20%: Very quiet actions (minimal detection risk)
  • 40%: Quiet actions (low detection risk)
  • 60%: Moderate actions (moderate detection risk)
  • 80%: Loud actions (high detection risk)
  • 100%: Very loud actions (maximum detection risk)

Create F_Player_Noise function to broadcast noise to nearby AI:

// Player Noise Broadcasting
F_Player_Noise(Volume) {
noise_radius = base_radius * volume_percentage;
detection_value = base_value * volume_percentage;
if (Stealth_Enabled) {
noise_radius *= 0.25; // Reduce radius in stealth
detection_value /= 4; // Reduce detection in stealth
}
SphereTraceForObjects(GetActorLocation(), GetActorLocation(), noise_radius, [Pawn]);
ForEach(detected_ai in trace_results) {
detected_ai.Interface_Detect_Player(detection_value, Self);
}
}

Connect noise system to character movement:

  • Interface_Player_Noise: Function called from animation events
  • Footstep Events: Animation notify events trigger noise
  • Volume Selection: Set appropriate noise level for movement type

Configure noise for different movement types:

  • Walk: 20% noise (very quiet movement)
  • Run: 40% noise (moderate noise level)
  • Sprint: 60% noise (significant noise generation)
  • Jump: 40% noise (moderate impact noise)

Add noise generation to player abilities:

Most combat abilities generate significant noise:

  • Melee Attacks: 100% noise (maximum detection)
  • Projectile Attacks: 100% noise (gunshots, magic casting)
  • Area Effects: 100% noise (large explosive effects)
  • Stealth Attacks: 60% noise (quieter but still detectable)
  • Dodge Roll: 20% noise (quiet evasive movement)
  • Stealth Activation: 0% noise (silent ability activation)
  • Interaction: 0% noise (silent world interaction)

AI characters accumulate detection points based on noise exposure:

Connect noise system to existing AI detection phases:

  • Phase 1 (< 33 points): Look toward noise source
  • Phase 2 (< 66 points): Walk to investigate noise location
  • Phase 3 (100+ points): Full aggro and combat engagement

Different noise levels add different detection amounts:

  • 20% Noise: +2 detection points
  • 40% Noise: +4 detection points
  • 60% Noise: +8 detection points
  • 80% Noise: +16 detection points
  • 100% Noise: +32 detection points

Stealth state provides significant noise reduction benefits:

  • Radius Reduction: Multiply noise radius by 0.25 when in stealth
  • Detection Reduction: Divide detection value by 4 when in stealth
  • State Requirement: Must be in stealth state (not combat) for benefits
  • Quiet Actions: Some actions become nearly silent in stealth
  • Movement Benefits: Stealth movement generates minimal noise
  • Combat Trade-off: Attacking breaks stealth, removing noise benefits

Prevent multiple noise applications to same AI:

  • Hit Actors Array: Track which AI received noise this activation
  • Add Unique: Only add detection points once per noise event
  • Array Clear: Reset hit actors after noise event completes
  • Detection Reset: Clear player detection values when AI resets to spawn
  • Noise Immunity: AI in reset state ignore noise events
  • Fresh Start: Reset AI returns to neutral detection state

The noise system requires careful balance adjustment:

  • Volume Values: Adjust detection ranges for gameplay feel
  • Detection Accumulation: Tune how quickly AI reach each detection phase
  • Stealth Benefits: Ensure stealth provides meaningful noise reduction
  • Gradual Detection: Low noise should trigger investigation, not immediate aggro
  • High Noise Response: Loud actions should create immediate danger
  • Stealth Effectiveness: Stealth should provide significant tactical advantage

The player noise system adds tactical depth to stealth gameplay while providing clear cause-and-effect relationships between player actions and AI responses.