Skip to content

Battle replay: surface new combat mechanics, fix zone alignment#147

Merged
cahaseler merged 4 commits into
mainfrom
claude/battle-view-combat-state-cqjctk
Jun 26, 2026
Merged

Battle replay: surface new combat mechanics, fix zone alignment#147
cahaseler merged 4 commits into
mainfrom
claude/battle-view-combat-state-cqjctk

Conversation

@cahaseler

@cahaseler cahaseler commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

The battle view (/battles list + /battles/[id] replay) was built against an older version of the gameserver battle-log API and had drifted out of sync with combat. This updates it to render the combat mechanics the server already logs, fixes a rendering bug, and corrects how the replay draws zones.

  • Renders mechanics the replay previously ignored: burn damage-over-time, splash/collateral hits, remote hull repair from allied logistics, and per-shot ammo.
  • Ship overlay now shows active status effects (disruption / burning / armor-melt) and each weapon's loaded ammo + magazine count; ships carry status indicators on the canvas. (These light up once the matching gameserver change deploys; the page degrades gracefully without them.)
  • Fixes the loadout panel showing NaN% — it read a module "quality" field the server never sent.
  • Zone alignment: the server lays each side out along an arbitrary axis, but the replay drew zone bands as vertical dividers and hardcoded ship facing to horizontal, so bands/labels/ships were misaligned whenever the axis wasn't horizontal. The replay now derives the battle axis from the data and draws the four rings (outer/mid/inner/engaged) perpendicular to it, with ship facing following the axis. Attack events show the 0–6 separation that weapon reach maps onto.
  • Shows faction tags on battle cards for completed battles (previously only active battles, and only as a raw id).
  • Removes dead system-POI fetch scaffolding that was never wired.
  • Memoizes the event feed and adds a canvas accessibility label.

User-Facing Changes

  • Battle replays now show burn damage, splash hits, remote repairs, and what ammo each weapon is loaded with.
  • Ships in the replay display active status effects (disrupted, burning, armor-melted) and per-weapon ammo counts.
  • The replay's zone rings and ship orientation now line up correctly with where ships actually are.
  • Battle cards show faction tags for completed battles, not just active ones.
  • Fixed the ship loadout panel showing "NaN%".

claude added 4 commits June 26, 2026 19:21
…play

The battle replay now renders combat mechanics the gameserver already
logs but the view ignored: burn damage-over-time, splash/collateral hits,
remote hull repair from allied logistics, and per-shot ammo. Ship
overlays show active disruption/burn/armor-melt status badges and the
loaded ammo + magazine count per weapon, and ships carry status-effect
indicators on the canvas. Fixes the loadout panel showing NaN% (it read
a module quality field the server never sends).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TZXMs46rdfWEbSHqKovo8j
… dead POI code

The server lays each side out along an arbitrary axis (origin-POI direction
or a battle-ID seed), but the replay drew zone bands as vertical dividers and
hardcoded ship facing to horizontal, so bands, labels and ship orientation
were misaligned whenever the axis wasn't horizontal. The replay now derives
the battle axis from the data (side centroids, or a PCA fallback) and renders
the four rings (outer/mid/inner/engaged) perpendicular to it, with ship facing
following the axis. Attack events show the 0-6 separation that weapon reach
maps onto. Removes the system-POI fetch scaffolding, which was never wired
(the battle-log API carries no POI data) and only produced dead branches.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TZXMs46rdfWEbSHqKovo8j
Completed battles never showed faction affiliation because the summary
omitted it; with the gameserver now supplying a faction tag per side, the
battle list displays it (preferred over the raw faction id) for both active
and completed battles.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TZXMs46rdfWEbSHqKovo8j
Memoizes the per-tick event feed so it isn't rebuilt on hover/mouse-move
renders, adds an aria-label to the replay canvas, and explicitly resets the
line dash for non-splash attack lines.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TZXMs46rdfWEbSHqKovo8j
@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
www Ready Ready Preview, Comment Jun 26, 2026 7:45pm

Request Review

@cahaseler cahaseler merged commit 5c66d56 into main Jun 26, 2026
3 checks passed
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