Fix Flagship visuals, beam aiming, results and Frame controls

This commit is contained in:
ElHombreAlex committed 2026-10-05 10:52:16 +02:00
1 parent e857f4eee9
commit cf9cfca866
27 files changed
+1084 -96

No files matched your search

+8 -2
View File
@@ -45,6 +45,8 @@ Godot uses this state to place and animate visual actors. Native positions, curr
Projectiles originate from native weapon/drone locations and follow native shot information. Rendering does not determine hits or damage. Pause freezes presentation clocks while keeping actual native paused projectiles visible and removing stale shots. Environmental animation conveys the current hazard; exact hazard timing remains a polish/verification area.
Artillery uses a separate native `artillerySystems`/projectile-factory list so Flagship guns retain individual mount and shot identities even when regular weapon slots are empty. Enemy hull cells are generated from `hull_max`, with one cell per native hit point. Shields use current native charge, super charge and `shields_shutdown`; propagate shutdown through the main presentation update and include it in the shield-state cache. `Ship::GetBaseEllipse` supplies their unchanged center/radii. Cloaking reads `ship.ship.bCloaked` rather than inferring it from a cooldown or hiding the ship's gameplay state.
Placed weapon locks use the player's current native `targets`, `target_ship`, `autofire`, beam length and flak radius, independently of the currently armed cursor. The renderer does not infer locks from projectile history or expose enemy weapon intent. Native beam targets supply both endpoints and their sweep direction; incomplete endpoints do not create a fabricated beam lock. Room marks inherit the receiver's transform through pause, movement, tilt and scale. Clearing native targets or leaving the encounter removes their marks.
Space drones use native IDs and current render space to locate the procedural model's visible muzzle. Bullet launch points stay fixed in that space as the drone moves; a continuing native beam remains attached to its emitter. Ambiguous negative drone IDs use the native origin point at drone height. Native shot kind, live progress, presence and actual collision outcome control presentation. Model bodies, exhaust, emitters and tools share immutable geometry; emission state uses cached materials without changing another drone's glow. Combat, Beam and Defense Mk II variants have distinct hardware.
@@ -53,11 +55,15 @@ Jump stretch starts from the native ship `jumping` flag and follows the transfor
The native missed flag and a post-update event feed evasion feedback so brief missed shots can produce a single MISS cue even between snapshot deliveries. Room condition colors respect native information permissions; role icons and hazards remain, without floor health/status bars or counters. Reactor snapshots distinguish raw availability from usable availability after native capacity/environmental limits; battery availability is separate. Equipped localized weapon/drone metadata is distinct from deployed drone actors, keeping wheel labels tied to actual shortcut slots. Optional collections are normalized by the bridge and parsed defensively by the wheel: Lua may encode an empty table as `{}` rather than `[]`.
Miss presentation preserves forward progress when switching to a pass-by path; a later native update cannot send the visible shot backward toward its source. It creates no collision or damage event. Beam pointing intersects the enemy deck plane independently of room-floor snapping and maps both freely placed endpoints back to native pixels. Release sends native button-up and the native confirmation click required to complete FTL's aim. The native factory retains its reversed endpoint ordering. Gaps are valid aim positions; the game controls accepted beam geometry and outcomes.
## Original HUD and floating windows
The game renders its original HUD into a separate native framebuffer. This retains native fonts, localization and values even when the normal backbuffer displays Tactical, the map or a window. The bridge removes unwanted world/enemy HUD pixels and preserves complete native window content for floating panels. Supplemental capture suppresses native window draw methods, including the separate `MenuScreen::OnRender` and `OptionsScreen::OnRender` methods, so in-run panels are not duplicated on the headset HUD. Normal capture remains unchanged. Gameplay crops the upper native status and crew region to a fixed-size headset-relative panel, omitting the lower strip; Power/Shortcuts/the wheel supply those actions. Main menus and desktop Tactical/map views retain full framing.
The game renders its original HUD into a separate native framebuffer. This retains native fonts, localization and values even when the normal backbuffer displays Tactical, the map or a window. The bridge removes unwanted world/enemy HUD pixels and preserves complete native window content for floating panels. Supplemental capture suppresses native window draw methods, including the separate `MenuScreen::OnRender` and `OptionsScreen::OnRender` methods, plus `CombatControl::RenderTarget`, so windows and target graphics do not contaminate the headset HUD. Normal capture remains unchanged. Gameplay crops the upper native status and crew region to a fixed-size headset-relative panel, omitting the lower strip; Power/Shortcuts/the wheel supply those actions. Main menus, defeat/victory results and desktop Tactical/map views retain full framing.
[hud_anchor.gd](../scripts/hud_anchor.gd) gives the headset-relative pose priority and keeps fixed metre dimensions for readable text. Collision checks use the transformed hull/shield envelope and the panel's swept movement. Only a potential intersection engages the above-ship clamp, with 8 cm clearance; looking down cannot pass the HUD through the ship. The panel returns to headset-relative placement when clearance permits. Pause is attached above the same HUD panel.
Result detection reads the native `GameOver` window's inherited `FocusWindow` open flag. Hook resolution validates `CommandGui`'s GameOver offset and the FocusWindow flag against matching signatures; the bridge bounds these read-only probes. A result state hides the encounter, combat effects, locks, controller panel and wheel, leaving the full original result screen interactive. A pending event freeze is still distinct from a result window.
[hud_anchor.gd](../scripts/hud_anchor.gd) gives the headset-relative pose priority and keeps fixed metre dimensions for readable text. Collision checks use the transformed hull/shield envelope and the panel's swept movement. Only a potential intersection engages the above-ship clamp, with 5 cm clearance; looking down cannot pass the HUD through the ship. The panel returns to headset-relative placement when clearance permits. Pause is attached above the same HUD panel.
Transport uses atomic raw RGBA files with an `FVR1` header, dimensions, sequence and timestamp. Tactical is captured at a target **30 Hz / 960×540**; map/windows retain **1280×720**. The independent HUD targets **10 Hz / 1280×720**. Native input coordinates remain **1280×720** regardless of capture resolution. PNG previews update at about 1 Hz and are diagnostics rather than the live transport.