Skip to content

Iw4 tu6 barrier clipping dvar - #223

Open
regenerance wants to merge 1 commit into
michaeloliverx:mainfrom
regenerance:iw4-tu6-barriers
Open

Iw4 tu6 barrier clipping dvar#223
regenerance wants to merge 1 commit into
michaeloliverx:mainfrom
regenerance:iw4-tu6-barriers

Conversation

@regenerance

Copy link
Copy Markdown

IW4 TU6: Add map barrier clipping removal

Summary

Adds an optional bg_removeBarriers dvar to IW4 TU6 that allows players to clip through map barriers.

  • bg_removeBarriers 0 — normal map barrier behavior.
  • bg_removeBarriers 1 — removes the relevant barrier collision from player movement, allowing access to areas normally blocked by map barriers, including rooftops and other restricted areas.
  • The feature is disabled by default.

This is implemented through the player movement trace mask and does not modify map collision data.

Implementation

The movement code now defines:

MASK_PLAYER_CLIP  = 0x10000
MASK_BARRIER_CLIP = 0x400

When bg_removeBarriers is enabled, PmoveSingle changes pm->tracemask to remove MASK_PLAYER_CLIP and add MASK_BARRIER_CLIP.

pm->tracemask &= ~MASK_PLAYER_CLIP;
pm->tracemask |= MASK_BARRIER_CLIP;

The normal PmoveSingle implementation is still called, so this only changes the collision mask used by player movement.

Ladder handling

Removing player clipping affects ladder checks, so PM_CheckLadderMove is handled separately and temporarily restores MASK_PLAYER_CLIP while the ladder check runs.

Ladder behavior is not 100% preserved with bg_removeBarriers enabled. There are still some limitations due to how the movement and collision system handles the modified trace mask, but the current implementation provides the best ladder behavior possible with this approach without making the change significantly more invasive.

Dvar Synchronization

Adds:

DVAR_CODINFO = 0x08

This is required for bg_removeBarriers to be handled as a CODINFO dvar and properly synchronized to clients, ensuring clients receive and use the correct dvar state.

Files Changed

src/game/iw4/mp_tu6/components/pm.cpp

  • Added bg_removeBarriers.
  • Added player/barrier collision masks.
  • Added PmoveSingle hook for barrier removal.
  • Added PM_CheckLadderMove hook for ladder handling.
  • Added detour installation and cleanup.
  • Existing movement and rocket-jump functionality remains intact.

src/game/iw4/mp_tu6/symbols.h

  • Added the TU6 symbols required for PmoveSingle and PM_CheckLadderMove hooks.

src/game/iw4/mp_tu6/structs.h

  • Added the required TU6 definitions, including DVAR_CODINFO = 0x08.

Testing

Tested in-game on IW4 TU6.

Verified:

  • Barrier removal works with bg_removeBarriers 1.
  • Normal barrier behavior is restored with bg_removeBarriers 0.
  • Players can access areas normally blocked by map barriers, including rooftops.
  • Toggling the dvar works as expected.
  • Normal player movement remains functional.
  • Ladder functionality remains usable, although it is not fully preserved while barrier removal is enabled.
  • Existing movement functionality, including rocket jumping, remains intact.

Scope

This change is limited to IW4 Multiplayer TU6 and is disabled by default.

No map assets or collision geometry are modified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant