Skip to content

lexicon06/l4d2-charger-steering-fox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

[L4D2] Charger Steering (Fork)

Maintained fork by Pablo Santillán (@lexicon06)


Why This Fork Exists

This fork was created after repeated server crashes were traced back to Charger movement handling during active charges in live production servers.

Multiple independent crash reports consistently pointed to the same engine function:

server_srv.so!CPlayerMove::RunPreThink(CBasePlayer*) + 0x27b

These crashes occurred during live gameplay and were reproducible under load, most commonly when Chargers were actively strafing while charging.


Observed Crash Signatures

The following crash signatures were recorded across multiple incidents:

AXJ4-VZFS-GS5A
LCG2-V3FR-H2B2
UWQE-BNSY-AGEI
MXYT-MPXQ-HZNO
PNGS-NJWM-P67F
A2ZO-JJVY-5AFO
TIDV-YU3M-34YO
FVOC-QBOI-BFVA

All resolved to the same engine location:

server_srv.so!CPlayerMove::RunPreThink(CBasePlayer*) + 0x27b

Root Cause Analysis

The original implementation applied lateral movement using TeleportEntity during OnPlayerRunCmd. While functional, this approach forcefully rewrites player origin and velocity inside the engine movement pipeline.

When executed repeatedly during CPlayerMove::RunPreThink, this can:

  • Break internal physics assumptions
  • Cause velocity stacking or invalid state transitions
  • Trigger undefined behavior inside the movement system
  • Lead to hard server crashes

Mitigation Strategy

This fork completely removes the use of TeleportEntity during active Charger charge movement.

Instead, lateral movement is applied by directly updating the Charger’s velocity using SetEntPropVector on m_vecVelocity. This keeps all movement changes within the engine’s expected physics flow and avoids forcefully relocating the entity mid-frame.

Additional runtime checks were added to ensure that:

  • The client is valid and alive
  • The Charger is actively charging
  • The player is grounded

These changes preserve the original gameplay intent while significantly improving server stability.


Summary

This fork exists to address a real-world stability issue observed in production servers. The changes are conservative, targeted, and focused on preventing engine-level crashes without altering core gameplay behavior.

Charger Steering (FOX Fork) is a maintained fork of the original [L4D2] Charger Steering plugin by SilverShot, updated and adapted by Pablo Santillán (@lexicon06).


What This Fork Changes

  • TeleportEntity usage removed
    The original strafing logic that used TeleportEntity has been completely removed. Strafing is now applied by updating m_vecVelocity directly, preventing physics corruption, desynchronization, and engine instability.
  • FOX ConVar namespace
    All ConVars use the fox_ prefix to avoid conflicts and clearly identify this fork.
  • Additional runtime validation
    Extra client and state checks were added to improve reliability during charge handling.
  • Fork actively maintained
    This repository reflects ongoing maintenance and stability-focused fixes beyond the original release.

Original Plugin

This project is based on the original [L4D2] Charger Steering plugin by SilverShot.


Features

  • Allows Chargers to turn using mouse movement while charging
  • Optional strafing support during charge
  • Configurable access for humans, bots, or both
  • Configurable hint messages (chat or hint box)
  • Game mode filtering (Coop, Versus, Survival, Scavenge)
  • Translation support

Technical Details

  • Game: Left 4 Dead 2 only
  • Language: SourcePawn
  • SourceMod: 1.8 or newer
  • Dependencies:
    • <sourcemod>
    • <sdktools>

Key Implementation Note

During strafing, this fork modifies the Charger’s velocity using SetEntPropVector instead of forcefully teleporting the entity. This keeps all movement updates inside the engine physics pipeline and avoids corrupting internal state during RunPreThink.


Installation

  1. Compile the plugin using the SourceMod compiler
  2. Copy the compiled .smx file into:
    addons/sourcemod/plugins/
  3. Restart the server or change the map

Maintainer

Pablo Santillán
GitHub: @lexicon06


Credits

  • Original author: SilverShot
  • Fork maintenance and stability fixes: Pablo Santillán

License

This project is licensed under the GNU General Public License v3.0 or later.

About

SourceMod plugin that allows Chargers to turn and strafe while charging in Left 4 Dead 2.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors