fix: Render entire terrain on GeneralsOnline extended zoom (water plane bleeds through on large maps)#513
Closed
sailro wants to merge 1 commit into
Conversation
…plane bleed-through GENERALS_ONLINE_TEMP_FIX_DRAW_ENTIRE_TERRAIN removes the DrawEntireTerrain INI field and leaves m_drawEntireTerrain at its FALSE default. Combined with GeneralsOnline's non-retail extended camera zoom, the partial terrain draw window no longer covers the visible area on large maps, so the global water plane shows through and maps without water appear flooded. Force m_drawEntireTerrain = TRUE under the macro so the full map renders at any zoom. This is visual-only: it does not affect the simulation or the INI CRC, so all players stay consistent/retail-compatible. Regression introduced in 6694942 ("Temp fix for draw entire terrain"). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Author
|
Closing this. The GeneralsOnline team (ibra) confirmed that disabling I verified locally on a Win32 build with The real fix belongs upstream (making full-terrain drawing performant again, TheSuperHackers#2743). Closing in favor of that. Thanks for the context, and apologies for the noise! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On GeneralsOnline builds, larger maps render as mostly water when the camera is zoomed out, even on maps that contain no water at all. Only a fixed-size window of terrain around the camera focus is drawn; everything beyond it falls back to the global water plane. This reproduces on a stock install with no INI modifications.
Repro
GENERALS_ONLINE_VERSION_STRING "060526_QFE2").Result on a stock / vanilla INI install - terrain beyond the draw window is not rendered and the global water plane shows through:
The smaller the draw window, the worse it is. With
StretchTerrain = Yes(a 65-tile window) it collapses to a tiny island:Root cause
m_drawEntireTerraindecides whether the whole heightmap is drawn or only a fixed window centered on the camera:WorldHeightMap.cpp:475- default windowNORMAL_DRAW_WIDTH = 1 + 4*VERTEX_BUFFER_TILE_LENGTH= 129 tiles (VERTEX_BUFFER_TILE_LENGTH = 32,WorldHeightMap.h:45,:124).WorldHeightMap.cpp:532-534andcreateDrawArea(:2214-2217) - whenm_drawEntireTerrainis set, the draw area is expanded to the full map (m_width/m_height).W3DView.cpp:776- the camera far-clip plane is aligned to the same size.In retail this defaults to
FALSE, and the only way to enable it was theDrawEntireTerrainGameData INI key. Retail's limited camera zoom never zoomed far enough to reveal the gap, so it was never visible.GeneralsOnline adds non-retail extended camera zoom (lobby
max_cam_heightup toGENERALS_ONLINE_MAX_LOBBY_CAMERA_ZOOM= 1000). Commit 6694942 ("Temp fix for draw entire terrain") then addedGENERALS_ONLINE_TEMP_FIX_DRAW_ENTIRE_TERRAIN, which:DrawEntireTerrainfield from the INI parse table (GlobalData.cpp:97-99), andm_drawEntireTerrainat itsFALSEdefault (GlobalData.cpp:835).So at extended zoom the 129-tile window no longer fills the screen and the water plane fills the rest. Players cannot work around it either: the INI field no longer exists, and a loose INI override would change the INI CRC (sent to the service as
ini_crc; a mismatch returns417 Anticheat mismatch,OnlineServices_LobbyInterface.cpp:1188), so it is not viable for online play.Proposed fix
Force
m_drawEntireTerrain = TRUEunder the macro. It stays out of the INI parse table, so the INI CRC is unchanged and every player remains consistent / retail-compatible, but the full map is rendered at any zoom.This is a client-side visual setting only - no effect on the simulation or the INI CRC.
@x64-dev - context and a question
You introduced
GENERALS_ONLINE_TEMP_FIX_DRAW_ENTIRE_TERRAINin 6694942 while fixing the metaevent merge (TheSuperHackers#2577). Since it is labelled a temp fix, could you confirm what it was guarding against?DrawEntireTerrainout of the INI/CRC for player consistency, then forcing itTRUE(above) preserves that and fixes the rendering.DrawEntireTerrain = TRUEitself caused a problem at 60 Hz / extended zoom (perf or a crash), then the better fix is to scale the terrain draw window to the camera frustum so only zoomed-out views pay the cost, instead of always drawing the whole map. Glad to take it in that direction with your input.Tradeoffs
DrawEntireTerrain = Yes). A camera-scaled draw window would be the more refined fix; this PR is the minimal one.Testing and disclosure
CONTRIBUTING.md.References
NextGenMP_defines.h:14;GlobalData.cpp:97-99,:835;WorldHeightMap.cpp:475,:532-534,:2214-2217;WorldHeightMap.h:45,:124;W3DView.cpp:776;OnlineServices_LobbyInterface.cpp:1188