Skip to content

bugfix(worldbuilder): Draw maps larger than 1024x1024 through the partial terrain window - #3502

Open
tintinhamans wants to merge 1 commit into
TheSuperHackers:mainfrom
tintinhamans:arctic/fix/worldbuilder-large-map-draw
Open

tintinhamans wants to merge 1 commit into
TheSuperHackers:mainfrom
tintinhamans:arctic/fix/worldbuilder-large-map-draw

Conversation

@tintinhamans

@tintinhamans tintinhamans commented Oct 13, 2026 •

Copy link
Copy Markdown

⚠️ Merge after: #3501


WorldBuilder draws the entire map by default, which keeps a vertex buffer and a system memory copy for every 32x32 tile, about 256 bytes per cell. Past roughly 1200x1200 that alone pushes the 32 bit process out of memory.

Maps larger than 1024x1024 now use the partial terrain window, which follows the camera, and the show entire map option is disabled for them. With the terrain no longer scaling with the map, the new map memory warning moves up to 2048x2048.

1300x1300 map, border 30 Private memory
Before 870 MB
After 400 MB

@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 431baeb7-aa75-4f1b-96fd-22f4d2eb7842
📥 Commits

Reviewing files that changed from the base of the PR and between fe68496 and a8d121b.

📒 Files selected for processing: 2
  • Generals/Code/Tools/WorldBuilder/src/NewHeightMap.cpp
  • GeneralsMD/Code/Tools/WorldBuilder/src/NewHeightMap.cpp

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Walkthrough

Both Generals and GeneralsMD WorldBuilder variants raise the large-map warning threshold to 2048 and restrict full-map terrain rendering to maps with an area of at most 1,048,576 cells.

Changes

Map size handling

Layer / File(s) Summary
Raise the large-map warning threshold
Generals*/Code/Tools/WorldBuilder/src/NewHeightMap.cpp
The large-map warning threshold increases from 1024² to 2048² tiles, including the map border.
Limit entire-map terrain rendering
Generals*/Code/Tools/WorldBuilder/src/wbview3d.cpp
Full-map terrain initialization requires a height map with an area of at most 1,048,576 cells. The menu command is disabled when no eligible height map exists, and its checkmark reflects that eligibility.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: xezon, wwb2-account

Merge Risk: 🟡 Moderate · up to a8d12

Very large maps can still exhaust WorldBuilder memory after height-map edits, so the memory policy should be resolved before merging.

Pre-merge checks: Passed 4
Check name Status Explanation
Title check Passed The title clearly describes the primary change: larger WorldBuilder maps use the partial terrain window instead of full-map rendering.
Description check Passed The description accurately explains the memory issue, the partial terrain window behavior, the disabled option, and the updated memory-warning threshold.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment thread Generals/Code/Tools/WorldBuilder/src/wbview3d.cpp Outdated
@Mauller Mauller added WorldBuilder Relates to World Builder Gen Relates to Generals ZH Relates to Zero Hour Memory Is memory related Bug Something is not working right, typically is user facing labels Oct 13, 2026
Comment thread Generals/Code/Tools/WorldBuilder/src/wbview3d.cpp Outdated
@tintinhamans
tintinhamans force-pushed the arctic/fix/worldbuilder-large-map-draw branch from 6091bdb to f8bb8fc Compare October 13, 2026 13:17
@tintinhamans tintinhamans changed the title bugfix(worldbuilder): Draw maps larger than 1024 through the partial terrain window bugfix(worldbuilder): Draw maps larger than 1024x1024 through the partial terrain window Oct 13, 2026
@tintinhamans
tintinhamans force-pushed the arctic/fix/worldbuilder-large-map-draw branch 3 times, most recently from 93ffa84 to a2b7b04 Compare October 13, 2026 13:44
@tintinhamans
tintinhamans marked this pull request as ready for review October 13, 2026 13:47
@tintinhamans
tintinhamans force-pushed the arctic/fix/worldbuilder-large-map-draw branch from a2b7b04 to 415d94a Compare October 13, 2026 13:52
@greptile-apps

greptile-apps Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Large maps now use a camera-following terrain window in both WorldBuilder versions.

  • Large maps use the partial terrain window.
  • The map memory warning starts at 2048² tiles.

Reviews (15) · Last reviewed commit: "bugfix(worldbuilder): Draw maps larger t..." · Reviewed by Greptile

Comment thread Generals/Code/Tools/WorldBuilder/src/wbview3d.cpp Outdated
@tintinhamans
tintinhamans force-pushed the arctic/fix/worldbuilder-large-map-draw branch 5 times, most recently from 9701a1b to e67f7de Compare October 13, 2026 19:23
Comment thread Generals/Code/Tools/WorldBuilder/src/NewHeightMap.cpp Outdated

@Mauller Mauller left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

@tintinhamans
tintinhamans force-pushed the arctic/fix/worldbuilder-large-map-draw branch 6 times, most recently from b6cd311 to 79b8e31 Compare October 18, 2026 12:21
@tintinhamans
tintinhamans force-pushed the arctic/fix/worldbuilder-large-map-draw branch 4 times, most recently from da891f3 to fe68496 Compare October 18, 2026 18:37
@xezon

xezon commented Oct 19, 2026

Copy link
Copy Markdown

Needs Rebase

@tintinhamans
tintinhamans force-pushed the arctic/fix/worldbuilder-large-map-draw branch from fe68496 to a8d121b Compare October 19, 2026 21:20
@tintinhamans

Copy link
Copy Markdown
Author

Rebased

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

Labels

Bug Something is not working right, typically is user facing Gen Relates to Generals Memory Is memory related WorldBuilder Relates to World Builder ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants