Skip to content

[GEN][ZH] Fix black terrain in World Builder without RTS_DEBUG #1190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

xezon
Copy link

@xezon xezon commented Jun 24, 2025

This change fixes the black terrain in World Builder without RTS_DEBUG. This issue happens because all code around GlobalData::m_shroudOn is compiled out without RTS_DEBUG, which enables shroud and turns the world black.

TODO

@xezon xezon added this to the Major bug fixes milestone Jun 24, 2025
@xezon xezon added Major Severity: Minor < Major < Critical < Blocker WorldBuilder Relates to World Builder Fix Is fixing something, but is not user facing labels Jun 24, 2025
@xezon xezon force-pushed the xezon/fix-black-terrain branch from 4455050 to c369e8e Compare June 24, 2025 20:32
@Caball009
Copy link

This fix works as intended for me.

@xezon xezon force-pushed the xezon/fix-black-terrain branch from c369e8e to d204b44 Compare June 28, 2025 17:17
@xezon
Copy link
Author

xezon commented Jun 28, 2025

Rebased on latest main.

@xezon xezon requested a review from a team June 29, 2025 09:07
@ViTeXFTW
Copy link

What are the necessary changes to have WB work in release (without RTS_INTERNAL)? I feel like that should also be a target goal.

@xezon
Copy link
Author

xezon commented Jun 30, 2025

If you know of more things broken in Release World Builder, please create a report. I only noticed the Terrain and System Maps thing.

@ViTeXFTW
Copy link

Also tested and works as advertised

@xezon xezon force-pushed the xezon/fix-black-terrain branch from d204b44 to 66b5e72 Compare June 30, 2025 21:04
@xezon
Copy link
Author

xezon commented Jun 30, 2025

Rebased.

Replicated in Generals with conflicts.

$ git diff 28adea33cec5ca38d28ce276ed668d4e8db9e46a..b0ef819c2278fba9e2adb993de5b0f1480bf07c7 > changes.patch

$ git apply -p2 --directory=Generals --reject --whitespace=fix changes.patch
changes.patch:42: trailing whitespace.

changes.patch:198: space before tab in indent.
        TheDisplay->drawImage( m_overlayImage, ul.x, ul.y, lr.x, lr.y );
Checking patch Generals/GameEngine/Include/Common/GameDefines.h...
error: Generals/GameEngine/Include/Common/GameDefines.h: No such file or directory
Checking patch Generals/Code/GameEngine/Include/Common/GameCommon.h...
Hunk #1 succeeded at 52 (offset -6 lines).
Checking patch Generals/Code/GameEngine/Include/Common/GlobalData.h...
error: while searching for:
#include "Common/SubsystemInterface.h"
#include "GameClient/Color.h"
#include "Common/STLTypedefs.h"
#include "Common/GameCommon.h"
#include "Common/Money.h"

// FORWARD DECLARATIONS ///////////////////////////////////////////////////////////////////////////

error: patch failed: Generals/Code/GameEngine/Include/Common/GlobalData.h:39
error: while searching for:
  Bool m_TiVOFastMode;            ///< When true, the client speeds up the framerate... set by HOTKEY!



#if defined(RTS_DEBUG) || defined(RTS_INTERNAL)
        Bool m_wireframe;
        Bool m_stateMachineDebug;
        Bool m_useCameraConstraints;
        Bool m_shroudOn;
        Bool m_fogOfWarOn;
        Bool m_jabberOn;
        Bool m_munkeeOn;

error: patch failed: Generals/Code/GameEngine/Include/Common/GlobalData.h:482
Checking patch Generals/Code/GameEngine/Include/Precompiled/PreRTS.h...
Checking patch Generals/Code/GameEngine/Source/Common/CommandLine.cpp...
Checking patch Generals/Code/GameEngine/Source/Common/GlobalData.cpp...
error: while searching for:
#endif
  m_TiVOFastMode = FALSE;

#if defined(RTS_DEBUG) || defined(RTS_INTERNAL)
        m_wireframe = 0;
        m_stateMachineDebug = FALSE;
        m_useCameraConstraints = TRUE;
        m_shroudOn = TRUE;
        m_fogOfWarOn = FALSE;
        m_jabberOn = FALSE;
        m_munkeeOn = FALSE;

error: patch failed: Generals/Code/GameEngine/Source/Common/GlobalData.cpp:548
Checking patch Generals/Code/GameEngine/Source/GameClient/GameClient.cpp...
Hunk #1 succeeded at 619 (offset -38 lines).
Hunk #2 succeeded at 650 (offset -38 lines).
Checking patch Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp...
Hunk #1 succeeded at 2488 (offset -60 lines).
Checking patch Generals/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp...
Hunk #1 succeeded at 1267 (offset 12 lines).
Hunk #2 succeeded at 1287 (offset 12 lines).
Hunk #3 succeeded at 1424 (offset 12 lines).
Checking patch Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/BaseHeightMap.cpp...
error: Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/BaseHeightMap.cpp: No such file or directory
Checking patch Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cpp...
Hunk #1 succeeded at 104 (offset -1 lines).
Hunk #2 succeeded at 758 (offset -38 lines).
Checking patch Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp...
Hunk #1 succeeded at 850 (offset -144 lines).
Checking patch Generals/Code/Tools/WorldBuilder/src/WorldBuilder.cpp...
Hunk #1 succeeded at 411 (offset -22 lines).
Applied patch Generals/Code/GameEngine/Include/Common/GameCommon.h cleanly.
Applying patch Generals/Code/GameEngine/Include/Common/GlobalData.h with 2 rejects...
Rejected hunk #1.
Rejected hunk #2.
Applied patch Generals/Code/GameEngine/Include/Precompiled/PreRTS.h cleanly.
Applied patch Generals/Code/GameEngine/Source/Common/CommandLine.cpp cleanly.
Applying patch Generals/Code/GameEngine/Source/Common/GlobalData.cpp with 1 reject...
Hunk #1 applied cleanly.
Hunk #2 applied cleanly.
Rejected hunk #3.
Applied patch Generals/Code/GameEngine/Source/GameClient/GameClient.cpp cleanly.
Applied patch Generals/Code/GameEngine/Source/GameClient/InGameUI.cpp cleanly.
Applied patch Generals/Code/GameEngineDevice/Source/W3DDevice/Common/System/W3DRadar.cpp cleanly.
Applied patch Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DScene.cpp cleanly.
Applied patch Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DView.cpp cleanly.
Applied patch Generals/Code/Tools/WorldBuilder/src/WorldBuilder.cpp cleanly.

@xezon
Copy link
Author

xezon commented Jun 30, 2025

This needs an approval.

@ViTeXFTW
Copy link

ViTeXFTW commented Jul 1, 2025

Wish I could

@ViTeXFTW
Copy link

ViTeXFTW commented Jul 1, 2025

By the way, this change also makes the release WorldBuilder work as expected. I think the only issues was no handling of shroud clearing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fix Is fixing something, but is not user facing Major Severity: Minor < Major < Critical < Blocker WorldBuilder Relates to World Builder
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Terrain renders black in World Builder [ZH] World Builder behaves differently when built with RTS_BUILD_OPTION_DEBUG enabled
3 participants