2026-08-14 16:13:24 +02:00
|
|
|
extends Node2D
|
|
|
|
|
|
|
|
|
|
var gas_phase: float = 0.0
|
Stop redrawing what only needs moving
Reviewed against the rule issues #6 and #10 set for the buildings: geometry
is rasterised once and thereafter only moved, scaled or faded, because every
NeonDraw call expands into four antialiased polylines.
The planet visuals never got that refactor. The black hole rebuilt ten
glowing paths of twenty-five points every frame - forty polylines - to spin
five rings; each ring is a NeonPiece that rotates now. The research lab spent
nine draw calls a frame, eight of them fixed geometry, to turn one dish and
blink six lights; the dish is a child that rotates and the lights a child
whose modulate breathes. The gas giant's bands genuinely deform, so they
still draw, but its constant rim moved out to a child. NeonPiece gained
add_path, which it needed for open arcs.
And I had broken the rule myself. ScannerGuidance re-queued a redraw of its
arrow every frame for a colour that changes only with the destination - and
it runs with PROCESS_MODE_ALWAYS, so it was re-tessellating through every
dialog that stops the rest of the game. Guarded, and pinned by a test that
counts CanvasItem's own draw signal: 36 rasterisations in 0.6s before, one
after.
Two smaller things from the same pass: the station menu drew its condition
bar by hand where the ship lab already uses a ProgressBar node, so it uses
one now and its _draw is gone; and station/upkeep refreshes were wired into
_refresh_garrison(), which nothing but a test calls, so both menus showed
whatever was true when they opened.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019AJMdB7iuHuLFZM1aBu3GD
2026-09-08 11:35:45 +02:00
|
|
|
var _rim: NeonPiece
|
2026-08-14 16:13:24 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
func configure(_shape_seed: int) -> void:
|
|
|
|
|
queue_redraw()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func extractor_anchor() -> Vector2:
|
|
|
|
|
return Vector2(0.0, -118.0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _process(delta: float) -> void:
|
|
|
|
|
gas_phase += delta
|
|
|
|
|
queue_redraw()
|
|
|
|
|
|
|
|
|
|
|
Stop redrawing what only needs moving
Reviewed against the rule issues #6 and #10 set for the buildings: geometry
is rasterised once and thereafter only moved, scaled or faded, because every
NeonDraw call expands into four antialiased polylines.
The planet visuals never got that refactor. The black hole rebuilt ten
glowing paths of twenty-five points every frame - forty polylines - to spin
five rings; each ring is a NeonPiece that rotates now. The research lab spent
nine draw calls a frame, eight of them fixed geometry, to turn one dish and
blink six lights; the dish is a child that rotates and the lights a child
whose modulate breathes. The gas giant's bands genuinely deform, so they
still draw, but its constant rim moved out to a child. NeonPiece gained
add_path, which it needed for open arcs.
And I had broken the rule myself. ScannerGuidance re-queued a redraw of its
arrow every frame for a colour that changes only with the destination - and
it runs with PROCESS_MODE_ALWAYS, so it was re-tessellating through every
dialog that stops the rest of the game. Guarded, and pinned by a test that
counts CanvasItem's own draw signal: 36 rasterisations in 0.6s before, one
after.
Two smaller things from the same pass: the station menu drew its condition
bar by hand where the ship lab already uses a ProgressBar node, so it uses
one now and its _draw is gone; and station/upkeep refreshes were wired into
_refresh_garrison(), which nothing but a test calls, so both menus showed
whatever was true when they opened.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019AJMdB7iuHuLFZM1aBu3GD
2026-09-08 11:35:45 +02:00
|
|
|
# The bands genuinely deform - each point moves along its own sine - so they
|
|
|
|
|
# are the one thing here that has to be re-tessellated to animate. The rim
|
|
|
|
|
# does not move at all, so it is a NeonPiece child rasterised once rather
|
|
|
|
|
# than a thirty-two point polygon rebuilt every frame alongside them
|
|
|
|
|
# (issues #6/#10).
|
|
|
|
|
func _ensure_rim() -> void:
|
|
|
|
|
if _rim != null:
|
|
|
|
|
return
|
|
|
|
|
var points := PackedVector2Array()
|
2026-08-14 16:13:24 +02:00
|
|
|
for i in range(32):
|
|
|
|
|
var angle := TAU * float(i) / 32.0
|
Stop redrawing what only needs moving
Reviewed against the rule issues #6 and #10 set for the buildings: geometry
is rasterised once and thereafter only moved, scaled or faded, because every
NeonDraw call expands into four antialiased polylines.
The planet visuals never got that refactor. The black hole rebuilt ten
glowing paths of twenty-five points every frame - forty polylines - to spin
five rings; each ring is a NeonPiece that rotates now. The research lab spent
nine draw calls a frame, eight of them fixed geometry, to turn one dish and
blink six lights; the dish is a child that rotates and the lights a child
whose modulate breathes. The gas giant's bands genuinely deform, so they
still draw, but its constant rim moved out to a child. NeonPiece gained
add_path, which it needed for open arcs.
And I had broken the rule myself. ScannerGuidance re-queued a redraw of its
arrow every frame for a colour that changes only with the destination - and
it runs with PROCESS_MODE_ALWAYS, so it was re-tessellating through every
dialog that stops the rest of the game. Guarded, and pinned by a test that
counts CanvasItem's own draw signal: 36 rasterisations in 0.6s before, one
after.
Two smaller things from the same pass: the station menu drew its condition
bar by hand where the ship lab already uses a ProgressBar node, so it uses
one now and its _draw is gone; and station/upkeep refreshes were wired into
_refresh_garrison(), which nothing but a test calls, so both menus showed
whatever was true when they opened.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019AJMdB7iuHuLFZM1aBu3GD
2026-09-08 11:35:45 +02:00
|
|
|
points.append(Vector2(cos(angle) * 118.0, sin(angle) * 118.0))
|
|
|
|
|
_rim = NeonPiece.create(self, Vector2.ZERO, Color(0.4, 0.78, 1.0))
|
|
|
|
|
_rim.add_polygon(points, 0.9)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _draw() -> void:
|
|
|
|
|
_ensure_rim()
|
2026-08-14 16:13:24 +02:00
|
|
|
for row in [-62.0, -28.0, 8.0, 43.0, 73.0]:
|
|
|
|
|
var band := PackedVector2Array()
|
|
|
|
|
var half_width: float = sqrt(maxf(0.0, 118.0 * 118.0 - row * row))
|
|
|
|
|
for i in range(15):
|
|
|
|
|
var x := lerpf(-half_width, half_width, float(i) / 14.0)
|
|
|
|
|
band.append(Vector2(x, row + sin(x * 0.045 + gas_phase * 1.6 + row) * 7.0))
|
|
|
|
|
NeonDraw.draw_glowing_path(self, band, Color(0.85, 0.52, 1.0), 0.75, 0.65)
|