I can zoom out until the map is a speck, or not far enough to see all of it
The lowest zoom has to depend on the map and the window, not a number picked once. Otherwise small maps float in empty space and big ones never fit, and after resizing the window the view is suddenly too far out. Here is how to work out the limit and what to do when it clashes with the highest zoom.
Why this works
The right limit is not a number picked once but a fact about the map and the window: the point where everything just fits. Working it out again whenever either changes means the player can see the whole map, and can never lose it as a speck.
When not to use it
Do not stop the zoom at the map when you want to show space beyond it, such as a world map that continues, a stars-and-void backdrop, or an endless sandbox. Let the player zoom out further and draw something sensible past the edge.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- 29 lines of example code with 4 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "I can zoom out until the map is a speck, or not far enough to see all of it" (read_entry strategy-zoom-out-limit-fits-the-map) in my game. Build it step by step, and show me how you checked that it works.Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP