Skip to content

fix(draw): Recover tread debris effects for W3DTankTruckDraw#2251

Open
xezon wants to merge 2 commits intoTheSuperHackers:mainfrom
xezon:xezon/fix-tanktruckdraw-tank-debris-3
Open

fix(draw): Recover tread debris effects for W3DTankTruckDraw#2251
xezon wants to merge 2 commits intoTheSuperHackers:mainfrom
xezon:xezon/fix-tanktruckdraw-tank-debris-3

Conversation

@xezon
Copy link

@xezon xezon commented Feb 3, 2026

Merge with Rebase

W3DTankTruckDraw has tank debris effects which are compiled out and not fully working when enabled. This is now fixed up. W3DTankTruckDraw (GLA Quad Cannon) can now use wheel effects and tread effects, because it does have both. The tread effects are effectively disabled with Retail INI files (as per the original).

The change has 2 commits:

The first commit is a refactor that streamlines function names for clarity and fixes a bunch of errors in code comments.

The second commit unlocks and fixes the tread effects for W3DTankTruckDraw.

Tread debris can be enabled in W3DTankTruckDraw INI modules by setting

TreadDebrisLeft = TrackDebrisDirtLeft
TreadDebrisRight = TrackDebrisDirtRight

GLA Quad Cannon with Tank Debris + Wheel Dust (Mod only)

shot_20260201_233646_3

@xezon xezon added Enhancement Is new feature or request Minor Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ZH Relates to Zero Hour Fix Is fixing something, but is not user facing Mod Relates to Mods or modding labels Feb 3, 2026
@xezon xezon force-pushed the xezon/fix-tanktruckdraw-tank-debris-3 branch from 92a4ebc to 222a664 Compare February 3, 2026 21:25
@greptile-apps
Copy link

greptile-apps bot commented Feb 3, 2026

Greptile Overview

Greptile Summary

This PR recovers and enables tread debris particle effects for W3DTankTruckDraw (GLA Quad Cannon), which has both wheels and treads. The changes involve two commits: a refactoring commit that clarifies function names and fixes comment errors, and a feature commit that unlocks the previously disabled tread effects.

Key Changes:

  • Refactored emitter function names across W3DTankDraw, W3DTankTruckDraw, and W3DTruckDraw to distinguish between tread emitters (createTreadEmitters/tossTreadEmitters) and wheel emitters (createWheelEmitters/tossWheelEmitters/enableWheelEmitters)
  • Removed #ifdef SHOW_TANK_DEBRIS preprocessor guards and replaced with runtime-configurable SHOW_DEFAULT_TANK_DEBRIS macro (set to 0 for W3DTankTruckDraw, maintaining retail INI compatibility)
  • Removed DEBUG_CRASH guard from tread emitter creation that would have crashed in some build configurations
  • Properly separated tread and wheel particle system lifecycle management in W3DTankTruckDraw
  • Tread debris can now be enabled via INI by setting TreadDebrisLeft/TreadDebrisRight parameters
  • Enhanced comments and documentation throughout

Previous Review Items:
All issues from previous review threads have been addressed:

  • The DEBUG_CRASH macro has been removed (line 202 issue resolved)
  • The SHOW_DEFAULT_TANK_DEBRIS comment now correctly states "disabled by default" with value (0) (line 50 issue resolved)
  • The author-tag comment on line 42 of W3DTankTruckDraw.h violates prologue rule c1850c23 but was already flagged

The refactoring is clean and improves code clarity by making it explicit which particle systems are being managed (treads vs wheels). The feature unlock is backward-compatible since tread debris defaults to disabled.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The refactoring improves code clarity and maintainability by giving functions more descriptive names. The feature unlock is well-implemented with proper particle system lifecycle management, removes problematic debug code, and maintains backward compatibility by defaulting tread debris to disabled. All previously identified issues have been resolved.
  • No files require special attention

Important Files Changed

Filename Overview
Core/GameEngineDevice/Include/W3DDevice/GameClient/Module/W3DTankTruckDraw.h Added author comment (violates prologue rules), split wheel/tread emitter functions for clarity, improved documentation
Core/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DTankTruckDraw.cpp Unlocked tread debris functionality by removing #ifdef SHOW_TANK_DEBRIS guards, separated tread/wheel emitter management, removed DEBUG_CRASH, properly initializes and manages tread particle systems

Sequence Diagram

sequenceDiagram
    participant Constructor as W3DTankTruckDraw
    participant CreateTread as createTreadEmitters
    participant PSM as ParticleSystemManager
    participant Draw as doDrawModule
    participant Shroud as setFullyObscuredByShroud
    participant Load as loadPostProcess
    participant Toss as tossTreadEmitters

    Note over Constructor,PSM: Initialization Phase
    Constructor->>CreateTread: call
    CreateTread->>PSM: findTemplate(treadDebrisName)
    PSM-->>CreateTread: ParticleSystemTemplate
    CreateTread->>PSM: createParticleSystem()
    PSM-->>CreateTread: ParticleSystem
    CreateTread->>CreateTread: attachToDrawable, setSaveable, stop
    CreateTread->>CreateTread: store system ID

    Note over Draw,PSM: Runtime Update Phase
    Draw->>PSM: findParticleSystem(ID)
    PSM-->>Draw: ParticleSystem
    alt velocity > threshold and visible
        Draw->>PSM: start particles
    else
        Draw->>PSM: stop particles
    end
    Draw->>PSM: set velocity and burst multipliers

    Note over Shroud,PSM: Shroud Obscuration
    alt becoming obscured
        Shroud->>Shroud: stopMoveDebris
        Shroud->>PSM: stop particles only
    else becoming visible
        Note over Shroud: Tread emitters persist not recreated
    end

    Note over Load,PSM: Reload Phase
    Load->>Toss: call
    Toss->>PSM: destroy all systems
    Toss->>Toss: invalidate IDs
    Load->>CreateTread: call
    Note over CreateTread,PSM: Recreate all tread emitters
Loading

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@greptile-apps
Copy link

greptile-apps bot commented Feb 3, 2026

Additional Comments (1)

Core/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DTankDraw.cpp
In W3DTankDraw::createTreadEmitters, particle is explicitly stopped after creation, but in W3DTankTruckDraw::createTreadEmitters (line 206) it's commented out. Inconsistent behavior - check if this is intentional.

Prompt To Fix With AI
This is a comment left during a code review.
Path: Core/GameEngineDevice/Source/W3DDevice/GameClient/Drawable/Draw/W3DTankDraw.cpp
Line: 147:147

Comment:
In `W3DTankDraw::createTreadEmitters`, particle is explicitly stopped after creation, but in `W3DTankTruckDraw::createTreadEmitters` (line 206) it's commented out. Inconsistent behavior - check if this is intentional.

How can I resolve this? If you propose a fix, please make it concise.

@xezon xezon force-pushed the xezon/fix-tanktruckdraw-tank-debris-3 branch from 222a664 to f3fc099 Compare February 3, 2026 21:36
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

Tread debris can be enabled in W3DTankTruckDraw INI modules by setting

TreadDebrisLeft=TrackDebrisDirtLeft
TreadDebrisRight=TrackDebrisDirtRight
@xezon xezon force-pushed the xezon/fix-tanktruckdraw-tank-debris-3 branch from f3fc099 to aa8ffdb Compare February 3, 2026 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Is new feature or request Fix Is fixing something, but is not user facing Gen Relates to Generals Minor Severity: Minor < Major < Critical < Blocker Mod Relates to Mods or modding ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant