Skip to content

Feature/performance improvements#98

Merged
GianRathgeb merged 17 commits intomainfrom
feature/performance-improvements
Dec 14, 2025
Merged

Feature/performance improvements#98
GianRathgeb merged 17 commits intomainfrom
feature/performance-improvements

Conversation

@GianRathgeb
Copy link
Contributor

When merged this pull request will:

  • Terrain map: switched TerrainViewport to on-demand updates (UPDATE_DISABLED + UPDATE_ONCE) instead of per-frame redraws
  • Terrain map: coalesces refresh requests and debounces optional mipmap baking to prevent render spikes
  • Terrain map: caps render target size and auto-adjusts oversampling to avoid huge textures on large maps
  • Terrain map: avoids expensive GPU→CPU readbacks unless mipmap baking is enabled
  • Documents: intel/transcript/briefing SubViewports render on-demand and avoid readbacks by default
  • Transcript: coalesces transcript rebuilds and removes await when adding entries to avoid stalls
  • UnitCounter: caches baked face textures and optionally frees/disables the face renderer after baking
  • MilSymbol: caches generated textures and renders its SubViewport on-demand (not UPDATE_ALWAYS)
  • Video: stabilizes resize/fullscreen performance via coalesced resize handling + locked internal render resolution + adaptive 3D - MSAA reduction at high pixel counts
  • LOS: replaces per-frame proximity scanning with interval-based scans (plus squared-distance checks)
  • More smaller optimizations (timer LCD updates only on change, skip per-frame mouse-grid work when unchanged, etc.)

Issue ticket number and link

Optimize Performance #37

Checklist before requesting a review

  • I have performed a self-review of my code.
  • I have tested my code.
  • I have documented my code in accordance with gdscript_documentation_comments.
  • I have requested a review in discord.
  • I have moved the related issues to the review section in the SCRUM Board.

Switch TerrainViewport to UPDATE_DISABLED and trigger UPDATE_ONCE only when terrain/viewport changes
Auto-fallback to UPDATE_ALWAYS when debug overlay is enabled (or viewport_update_always is set)
Debounce mipmap regeneration after changes and bind TerrainData change signals to request refresh
Disable viewport mipmap baking by default (avoids get_image() CPU readback); add bake_viewport_mipmaps opt-in
Use UPDATE_DISABLED + UPDATE_ONCE for the terrain viewport, with automatic UPDATE_ALWAYS when debug overlay is enabled
Refresh map on TerrainData change signals with a debounced update path
Set document SubViewports to UPDATE_DISABLED and switch to UPDATE_ONCE only when applying/refreshing textures
Render MilSymbol generator viewport on-demand instead of UPDATE_ALWAYS to avoid idle cost
Keeps existing debounce/page-change refresh flow; just avoids per-frame rendering
- Disable FaceRenderer updates by default
- Use UPDATE_ONCE only while baking the face texture
- Optionally queue_free FaceRenderer after bake (runtime)
When a document was dropped down using the ESC instead of mouse clicking, there was a lot of lagg. This commit fixes this issues
Add bake_viewport_mipmaps toggle (opt-in)
Default to ViewportTexture + linear filtering
Keep mipmap/aniso baking path when enabled
The solution is not the best since the graphics are still scaled down when making the window bigger but at least the lag is gone. Could fix the issue with these improvements:
Use content-scale viewport render locking on resize
Avoid supersampling when window is smaller
Base adaptive MSAA on content render size
- Cache MilSymbol generated textures (bounded)
- Cache UnitCounter baked face textures (bounded)
- Skip duplicate bakes; keep free-after-bake behavior
- Add viewport_max_size_px and dynamic pixel scale
- Scale canvas_transform + fix map/terrain mapping
- Set LCD viewport to UPDATE_DISABLED by default
- Trigger UPDATE_ONCE when seconds/state changes
- Throttle transcript repagination with timer
- Debounce SubViewport refresh after updates
- Make HQTable transcript hooks non-blocking
- Auto-wire SimWorld contact_reported signal
- Only enable scans when actor_path is set
- Throttle scans + use squared distance checks
- Add fullscreen overlays for map + documents
- Disable grain/CA/vignette/glow; boost sharpen
- Force full-res while reading; restore after
- Reduce paper/map glare; MSAA doc viewports
@GianRathgeb GianRathgeb merged commit 282f3d1 into main Dec 14, 2025
3 checks passed
@GianRathgeb GianRathgeb deleted the feature/performance-improvements branch December 14, 2025 16:21
@GianRathgeb GianRathgeb restored the feature/performance-improvements branch December 15, 2025 17:36
@Tapawingo Tapawingo deleted the feature/performance-improvements branch December 15, 2025 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants