You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Game crashes with "Map maximum size exceeded" on World10000 with water nukes #6388
The game crashed mid-match with RangeError: Map maximum size exceeded.
game id: dFasL6K561
client id: p2EUp38a
RangeError: Map maximum size exceeded
at Map.set ()
at e.noteTerrainEdit
at e.setMagnitude
at o_.recomputeMagnitudesInBox
at o_.finalizeWaterChanges
at o_.tick
at l_.executeNextTick
Cause: GameMapImpl records every tile whose terrain changed in a Map (pristineTerrain). A JS Map holds at most 2^24 (~16.7M) entries. World10000 has 50M tiles, and each large water-nuke crater adds roughly 32k tiles to that log, so a long game with heavy nuking passes the limit and the next setMagnitude throws.
To Reproduce
In game:
Play World10000 with water nukes enabled.
Keep playing while large parts of the map get nuked into water.
Once more than ~16.7M tiles have had their terrain changed, the game crashes.
In code (fast):
Create a GameMapImpl with more than 2^24 tiles, e.g. 4200x4200 of water.
Call setMagnitude on every tile.
It throws RangeError: Map maximum size exceeded.
Expected behavior
The game keeps running no matter how many tiles have been edited.
Screenshots
None; the crash text is above.
Desktop
OS: Fedora 44 (Linux)
Browser: Brave
Version: 155.1.97.59
Additional context
GameImpl.addViewResync builds a Set from the same log, so it would hit the same limit.
I have a fix ready with a reproducing test: the edit log moves to a one-bit-per-tile mask plus typed arrays, so it has no entry limit. The snapshot format and first-edit order are unchanged.
Assignment
I'd like to be assigned to this issue and work on it myself
Hi @YassineKaibi, thanks for opening this issue. It hasn't been approved by a maintainer yet — we'll get back to you shortly to either milestone it (approval) or close it.
Activity
github-actions commentedon Nov 11, 2026
Hi @YassineKaibi, thanks for opening this issue. It hasn't been approved by a maintainer yet — we'll get back to you shortly to either milestone it (approval) or close it.
— Automated. See CONTRIBUTING.md.