From 451460e37523faf793a939f26c780b401ad9e351 Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Wed, 24 Sep 2025 19:32:49 +0200 Subject: [PATCH 1/4] tweak(gamelod): Simplify game detail setup for options menu --- .../Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp index ab379e892d..0f3145c92c 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp @@ -1915,6 +1915,7 @@ void OptionsMenuInit( WindowLayout *layout, void *userData ) GadgetComboBoxAddEntry(comboBoxDetail, TheGameText->FETCH_OR_SUBSTITUTE("GUI:VeryHigh", L"Very High"), color); GadgetComboBoxAddEntry(comboBoxDetail, TheGameText->fetch("GUI:Custom"), color); static_assert(STATIC_GAME_LOD_COUNT == 5, "Wrong combo box count"); + static_assert(STATIC_GAME_LOD_COUNT == 4, "Wrong combo box count"); //Check if level was never set and default to setting most suitable for system. if (TheGameLODManager->getStaticLODLevel() == STATIC_GAME_LOD_UNKNOWN) From eb881bc7ab2d829999fb0e9afa38db81495216e7 Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Wed, 24 Sep 2025 19:46:38 +0200 Subject: [PATCH 2/4] feat(gamelod): Implement 'Very High' system spec --- .../Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp index 0f3145c92c..ab379e892d 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp @@ -1915,7 +1915,6 @@ void OptionsMenuInit( WindowLayout *layout, void *userData ) GadgetComboBoxAddEntry(comboBoxDetail, TheGameText->FETCH_OR_SUBSTITUTE("GUI:VeryHigh", L"Very High"), color); GadgetComboBoxAddEntry(comboBoxDetail, TheGameText->fetch("GUI:Custom"), color); static_assert(STATIC_GAME_LOD_COUNT == 5, "Wrong combo box count"); - static_assert(STATIC_GAME_LOD_COUNT == 4, "Wrong combo box count"); //Check if level was never set and default to setting most suitable for system. if (TheGameLODManager->getStaticLODLevel() == STATIC_GAME_LOD_UNKNOWN) From 1364e1f2b37106ef79c6f9d72204eeda45deed92 Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Wed, 24 Sep 2025 20:41:12 +0200 Subject: [PATCH 3/4] bugfix(gamelod): Disable the recommended static lod level for texture reduction to prevent low texture resolution with Medium and High specs --- .../Code/GameEngine/Include/Common/GameLOD.h | 1 + .../Code/GameEngine/Source/Common/GameLOD.cpp | 53 ++++++++++++++----- 2 files changed, 41 insertions(+), 13 deletions(-) diff --git a/GeneralsMD/Code/GameEngine/Include/Common/GameLOD.h b/GeneralsMD/Code/GameEngine/Include/Common/GameLOD.h index e4d90fd4d4..e9ddaa78dd 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/GameLOD.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/GameLOD.h @@ -204,6 +204,7 @@ class GameLODManager void applyStaticLODLevel(StaticGameLODLevel level); void applyDynamicLODLevel(DynamicGameLODLevel level); void refreshCustomStaticLODLevel(void); ///m_textureReduction; + { + requestedTextureReduction = lodInfo->m_textureReduction; requestedTrees = lodInfo->m_useTrees; } else - if (level >= STATIC_GAME_LOD_LOW) - { //normal non-custom level gets texture reduction based on recommendation - requestedTextureReduction = getRecommendedTextureReduction(); + { + //normal non-custom level gets texture reduction based on recommendation + StaticGameLODLevel textureLevel = getRecommendedTextureLODLevel(); + if (textureLevel == STATIC_GAME_LOD_UNKNOWN) + textureLevel = level; + requestedTextureReduction = getLevelTextureReduction(textureLevel); + + //only use trees if memory requirement passed. + requestedTrees = m_memPassed; } if (TheGlobalData) @@ -723,16 +730,36 @@ void GameLODManager::applyDynamicLODLevel(DynamicGameLODLevel level) Int GameLODManager::getRecommendedTextureReduction(void) { - if (m_idealDetailLevel == STATIC_GAME_LOD_UNKNOWN) - getRecommendedStaticLODLevel(); //it was never tested, so test now. + StaticGameLODLevel level = getRecommendedTextureLODLevel(); + + if (level == STATIC_GAME_LOD_UNKNOWN) + { + level = getStaticLODLevel(); + } + return getLevelTextureReduction(level); +} - if (!m_memPassed) //if they have < 256 MB, force them to low res textures. - return getLevelTextureReduction(STATIC_GAME_LOD_LOW); +StaticGameLODLevel GameLODManager::getRecommendedTextureLODLevel() +{ + // TheSuperHackers @bugfix xezon 24/09/2025 Disables the recommended static LOD level for texture reduction + // because the benchmark code always generates a low level for it. Can revisit if the benchmarking is changed. + constexpr const Bool UseRecommendedStaticLODLevel = FALSE; - if (m_idealDetailLevel < 0 || m_idealDetailLevel >= STATIC_GAME_LOD_COUNT) - return getLevelTextureReduction(STATIC_GAME_LOD_LOW); + StaticGameLODLevel level = STATIC_GAME_LOD_LOW; - return getLevelTextureReduction(m_idealDetailLevel); + // Force low res textures if user has less than 256 MB. + if (m_memPassed) + { + if constexpr (UseRecommendedStaticLODLevel) + { + level = getRecommendedStaticLODLevel(); + } + else + { + level = STATIC_GAME_LOD_UNKNOWN; + } + } + return level; } Int GameLODManager::getLevelTextureReduction(StaticGameLODLevel level) From 285ed43c2e23d54543d96938d212d9ddc54cfd48 Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Sat, 11 Oct 2025 22:18:47 +0200 Subject: [PATCH 4/4] Replicate in Generals --- .../Code/GameEngine/Include/Common/GameLOD.h | 1 + .../Code/GameEngine/Source/Common/GameLOD.cpp | 53 ++++++++++++++----- 2 files changed, 41 insertions(+), 13 deletions(-) diff --git a/Generals/Code/GameEngine/Include/Common/GameLOD.h b/Generals/Code/GameEngine/Include/Common/GameLOD.h index 7ed420b22b..61d13e3d7e 100644 --- a/Generals/Code/GameEngine/Include/Common/GameLOD.h +++ b/Generals/Code/GameEngine/Include/Common/GameLOD.h @@ -203,6 +203,7 @@ class GameLODManager void applyStaticLODLevel(StaticGameLODLevel level); void applyDynamicLODLevel(DynamicGameLODLevel level); void refreshCustomStaticLODLevel(void); ///m_textureReduction; + { + requestedTextureReduction = lodInfo->m_textureReduction; requestedTrees = lodInfo->m_useTrees; } else - if (level >= STATIC_GAME_LOD_LOW) - { //normal non-custom level gets texture reduction based on recommendation - requestedTextureReduction = getRecommendedTextureReduction(); + { + //normal non-custom level gets texture reduction based on recommendation + StaticGameLODLevel textureLevel = getRecommendedTextureLODLevel(); + if (textureLevel == STATIC_GAME_LOD_UNKNOWN) + textureLevel = level; + requestedTextureReduction = getLevelTextureReduction(textureLevel); + + //only use trees if memory requirement passed. + requestedTrees = m_memPassed; } if (TheGlobalData) @@ -717,16 +724,36 @@ void GameLODManager::applyDynamicLODLevel(DynamicGameLODLevel level) Int GameLODManager::getRecommendedTextureReduction(void) { - if (m_idealDetailLevel == STATIC_GAME_LOD_UNKNOWN) - getRecommendedStaticLODLevel(); //it was never tested, so test now. + StaticGameLODLevel level = getRecommendedTextureLODLevel(); + + if (level == STATIC_GAME_LOD_UNKNOWN) + { + level = getStaticLODLevel(); + } + return getLevelTextureReduction(level); +} - if (!m_memPassed) //if they have < 256 MB, force them to low res textures. - return getLevelTextureReduction(STATIC_GAME_LOD_LOW); +StaticGameLODLevel GameLODManager::getRecommendedTextureLODLevel() +{ + // TheSuperHackers @bugfix xezon 24/09/2025 Disables the recommended static LOD level for texture reduction + // because the benchmark code always generates a low level for it. Can revisit if the benchmarking is changed. + constexpr const Bool UseRecommendedStaticLODLevel = FALSE; - if (m_idealDetailLevel < 0 || m_idealDetailLevel >= STATIC_GAME_LOD_COUNT) - return getLevelTextureReduction(STATIC_GAME_LOD_LOW); + StaticGameLODLevel level = STATIC_GAME_LOD_LOW; - return getLevelTextureReduction(m_idealDetailLevel); + // Force low res textures if user has less than 256 MB. + if (m_memPassed) + { + if constexpr (UseRecommendedStaticLODLevel) + { + level = getRecommendedStaticLODLevel(); + } + else + { + level = STATIC_GAME_LOD_UNKNOWN; + } + } + return level; } Int GameLODManager::getLevelTextureReduction(StaticGameLODLevel level)