Commit Graph
246 Commits
Author SHA1 Message Date
0572aea4d2 Extend board template builder with hex SVG canvas + filter client by grid type
- Admin builder: SVG hex canvas renders when GridType=Hexagon (pointy-top hexagons, correct axial layout); square CSS grid otherwise
- Admin builder: ApplyHexSides / OnGridTypeChanged handle dimension/tile pruning; canvas header shows N/diameter for hex
- BoardTemplateDto now includes GridType and HexSides so clients can filter
- rules_editor_dialog: Board Width/Height/Shape hidden when hex selected; Hex Sides hidden when square; template picker filtered to matching grid type with live toggle

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-04-01 21:22:07 -04:00
a4badc276b Unit models face nearest enemy rather than fixed north/south
_idle_rotation now:
- Finds the nearest enemy body in _unit_bodies by XZ distance
- Returns atan2 toward that position minus the model's base angle
- Falls back to the original north/south heuristic when no enemy exists yet

Also refreshes idle rotation for all units on every state rebuild (step 4 in
_rebuild_units), skipping any unit currently in a move tween, so rotations
stay correct as units reposition across turns.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-04-01 20:30:39 -04:00
f9832d1a1f Hex board: corner starting zones, half tile spacing
Server - MakeHexagon starting zones:
- Zones are now corner-based instead of full-edge: each zone is the corner
  tile plus (N-1)/2 tiles along each of the two edges meeting at that corner
- 2 players → opposite corners (0, 3 = right/left); 3 → every-other corner
  (0,2,4); 4 → (0,1,3,4); 5 → (0-4); 6 → all 6 corners

Client - game_screen.gd:
- Add HEX_TILE_SPACING = TILE_SPACING * 0.5 constant
- _coord_to_world: use HEX_TILE_SPACING for hex world positions
- _add_tile: tile cylinder radius scaled by HEX_TILE_SPACING
- _add_highlight: highlight cylinder radius scaled by HEX_TILE_SPACING

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-04-01 18:44:20 -04:00
97e7698000 Wire HexSides through custom lobby; fix boardTemplateIdOverride empty-string crash
Server:
- CustomRulesOverride: add HexSides (int?) field
- CustomLobby entity: add HexSidesOverride (int?) column
- GameUpdateLobbyRulesHandler: save HexSidesOverride, include HexSides in
  effective rules preview
- GameLobbyReadyHandler: set rules.HexSides from lobby.HexSidesOverride on
  game start
- GameSavePresetHandler: capture BoardShape + HexSides in saved presets
- Migration 20260401222603_AddCustomLobbyHexSides: adds HexSidesOverride to
  custom_lobbies; applied to pg-forge-01 via dotnet ef database update

Client:
- rules_editor_dialog: send null (not "") for boardTemplateIdOverride when no
  template selected — empty string crashed Guid? deserialisation on the server

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-04-01 18:28:08 -04:00
aa76ac9994 Add Grid Type toggle (Square/Hexagon) to lobby rules editor
Replaces burying "Hexagon" in the Board Shape list with a dedicated
Grid Type dropdown at the top of the BOARD section. When "Hexagon" is
selected, boardShape is forced to "Hexagon" on confirm; square boards
use the Board Shape field as before. Hex Sides remains visible for
the sides setting.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-04-01 18:18:21 -04:00
8a20e56cb3 Hex tiles: use affinity-coloured cylinder placeholder, no Square fallback
When no Hex CDN model exists for an affinity, hex tiles now keep their
coloured CylinderMesh (radial_segments=6) placeholder rather than loading
a Square model or texture. Square boards are unchanged.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-04-01 17:38:49 -04:00
1bd26f11be Add hex grid to lobby rules editor; fix hex model/texture CDN loading
- rules_editor_dialog: add "Hexagon" to Board Shape picker and a Hex Sides
  spinner (3–10, default 5) so custom lobbies can configure hex boards
- game_screen _add_tile: has_model check now looks for Hex-shape CDN models
  (falls back to Square), so hex tiles get height variance when a Hex model is
  registered on the CDN instead of always using the flat placeholder height
- game_screen _try_load_tile_model: texture fallback now checks shape_key
  ("Hex") first, then falls back to "Square" — consistent with model loading

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-04-01 17:16:22 -04:00
2cfa60c7dd Add hex grid support (sides 3–10) for boards, pathfinding, LOS, and client rendering
- New HexGrid.cs: axial coord helpers, BFS neighbors, cube-lerp LOS, jump-range
- Board: HexSides property, GetNeighbors() dispatches hex/square, IsInBounds() hex-aware
- BoardShapeGenerator: MakeHexagon() with edge-based starting zones (2–6 players);
  FromTemplate() now carries HexSides through to the Board
- Pathfinding: Walk/Flight BFS uses board.GetNeighbors() (hex+square unified)
- LineOfSight: delegates to HexGrid.HasLos when hexSides > 0
- GameRules/GameRuleSet/BoardTemplate/BoardTemplateSnapshot: GridType + HexSides fields
- GameMessages BoardDto: GridType + HexSides sent to client
- GameEngine: PlaceArchSpirit range uses HexGrid.Distance on hex boards;
  Teleport LOS passes board.HexSides; ToBoardDto emits GridType/HexSides
- EF migration 20260401000000_AddHexGridSupport: grid_type + hex_sides columns on
  game_rule_sets and board_templates; applied to pg-forge-01
- Client game_screen.gd: hex coord→world (pointy-top flat layout), CylinderMesh
  tiles (radial_segments=6), _board_distance cube metric, _bfs_reachable 6-dir,
  _client_has_los cube-lerp, highlight mesh for hex tiles; reads gridType/hexSides
  from BoardDto

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-04-01 16:44:17 -04:00
c756b9cffa Fix highlight accuracy: BFS movement, LOS attack filtering
Movement tiles (_valid_move_tiles):
- Walk: BFS blocked by all occupied tiles (can't walk through units)
- Flight: BFS blocked only by other Flight units (flies over Walk units)
- Jump: Manhattan range, unoccupied only (was already correct)
- Teleport: Manhattan range + LOS to destination

Attack highlights (_attack_range_tiles, _valid_attack_target_coords,
_valid_attack_target_ids):
- Added AttackRequiresLos field to CardInstanceDto / ToCardInstanceDto
- Client now checks _client_has_los() for LOS-required attackers
- Tiles/units blocked by occupants are no longer highlighted as targets

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-04-01 11:19:24 -04:00
1d53f1046a Merge Sacrifice/Ascend/Transition into the unit ability panel
Previously, clicking an ArchSpirit showed the abilities panel AND a
separate OS-level PopupMenu for arch-spirit actions. Now everything
lives in one floating panel:

  [Abilities]        ← shown only if unit has active abilities
  ──────────
  <ability buttons>

  [ArchSpirit]       ← shown only for friendly ArchSpirit
  ──────────
  Sacrifice a Spirit  (only when valid candidates adjacent)
  Ascend              (only when tier+1 card in hand)
  Transition          (only when tier-1 card in hand)

Removed the _show_arch_spirit_menu() PopupMenu call from _select_unit().
_show_ability_panel() now builds both sections and returns early only
when both would be empty.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-03-31 14:13:22 -04:00
2a37f90746 Add 20-second sync watchdog to fix random hung init screen
If sync_complete or sync_failed never fires (e.g. background refresh
_is_syncing guard eats the start_sync call and signals were already
emitted before init_screen connected them, or a server request is
in-flight with no reply), the player was silently stranded with no
retry path and had to relaunch.

Adds a SYNC_TIMEOUT_SEC = 20 watchdog timer started in _do_sync() and
reset on each sync_progress page. If it fires, surfaces the retry
button with a "Timed out" message.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-03-31 13:25:27 -04:00
waterss dccdb8a4f8 SP now in Icon on bottom left of game screen, just above cards.
- Added SP and ST images in icons/
2026-03-31 11:51:15 -04:00
waterss 318c50c2a6 Update LoginScreen 2026-03-31 10:57:43 -04:00
95841b724a Disable all multi-finger gestures in buttons camera mode
2-finger pinch/pan, 3-finger pan, MagnifyGesture, and PanGesture are
now gated behind gesture mode. In buttons mode only single-finger drag
(controlled by the active toggle button) affects the camera.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-03-31 09:44:58 -04:00
7da9335599 Disable gesture timer accumulation in buttons camera mode
Gesture movement tracking and timer cancellation in ScreenDrag were
running unconditionally. Gate them behind gesture mode so buttons mode
is fully independent of gesture logic.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-03-31 09:23:46 -04:00
dingo 431ae6fc2c Typing fix 2026-03-31 09:00:54 -04:00
Shard a655ce8e47 Fix board click occupant redirect: ignore null occupantId for movement 2026-03-31 12:46:56 +00:00
Shard a1e7bd06b1 Set web client to 72fba92 baseline for confirmation 2026-03-31 12:29:48 +00:00
Shard dead968e51 Set web client to 2e3e284 baseline for confirmation 2026-03-31 12:14:14 +00:00
Shard 1b968b30f1 Rollback web client camera/input files to 515bfaa for bisect baseline 2026-03-31 12:04:26 +00:00
dingo 45eb19615c Breaking it worse 2026-03-31 07:56:46 -04:00
72fba92af5 Fix touch: use start-to-end distance to distinguish taps from camera drags
Cumulative drag distance (_touch_drag_total) is the wrong metric for tap
detection: natural finger jitter (A→B→A) can exceed 36 px even on a clean
tap, silently suppressing board clicks (unit moves, card plays, etc.).

Switch the board-click gate to start-to-end distance (< 50 px = tap).
_touch_drag_active now only means "camera mode fired during this touch" and
is set by the gesture timer or when an active camera mode consumes a drag.
This means taps always reach _handle_board_click regardless of finger wobble.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-03-30 19:58:52 -04:00
6e27f57d7a Fix touch input: tap suppression must only fire when camera mode is active
_touch_drag_active was set unconditionally on 36px drag, silently eating
board taps even when no camera action occurred. Now only set when a camera
mode (orbit/pan/zoom) is actually active. Gesture timer also immediately
marks drag-active on activation so the 3s hold doesn't fire a board click.
Buttons enlarged to 44px minimum height for touch usability.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-03-30 17:34:31 -04:00
08be334b4d Add Option 3 touch camera: gesture hold and button toggle modes
- Settings: new touch_camera_mode ("gesture"|"buttons"), persisted to camera section
- GameScreen: CamGestureTimer (3 s), CamCtrlPanel with Orbit/Pan/Zoom toggle buttons
- game_screen: gesture timer fires orbit/pan/zoom after 3-second stationary hold;
  button mode shows on-screen toggles; single-finger drag now gated behind active mode
- InGameSettings: Camera Controls section with Touch Camera OptionButton

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-03-30 17:21:13 -04:00
3bc7c30093 Fix camera control: right-click orbits, left-click always fires board action
Left-click drag was orbiting the camera on desktop, so any mouse movement
>2px during a click would suppress _handle_board_click. Moved camera orbit
to right-mouse drag (_orbit_active flag) leaving left-click exclusively for
board actions regardless of mouse movement. Touch single-finger orbit is
unchanged.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-03-30 13:51:03 -04:00
dingo d541dccb78 camera control fight 2026-03-29 22:03:52 -04:00
247d92c253 Fix touch: use cumulative drag distance to distinguish taps from swipes
4px per-event threshold was too sensitive — normal finger tremor during
a tap could exceed it, causing _touch_drag_active to suppress the click.
Now accumulates total drag distance since touch-down; requires 12px total
movement before classifying the touch as a camera orbit.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-03-29 18:07:20 -04:00
Shard 206ff9a212 Add touch tap/hold selection and keep one-finger orbit 2026-03-29 19:55:03 +00:00
b9e6dc6e80 Fix touch input: distinguish taps from swipes for camera vs click
Added _touch_drag_active flag set only when finger moves > 4px threshold.
Camera orbit now requires meaningful drag; taps no longer jiggle camera
or get swallowed — board clicks fire correctly for gameplay actions.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-03-29 10:48:05 -04:00
Shard 864ae4a847 Ignore single-touch PanGesture to preserve one-finger orbit 2026-03-29 14:14:18 +00:00
a2a7d7bff0 Fix indentation in _unhandled_input touch guard comment/condition
Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-03-29 10:05:48 -04:00
Shard ed5e8f12c3 Guard mouse orbit during touch gestures in browser 2026-03-29 13:48:31 +00:00
38a7a23c5f Fix browser multi-touch: prevent camera spin during pinch gestures
- Add _was_multi_touch flag: set when second finger lands, cleared only
  when all fingers lift — prevents single-finger orbit logic from running
  during a pinch even if ScreenDrag(finger-0) arrives before ScreenTouch(finger-1)
- Handle InputEventMagnifyGesture (trackpad/browser pinch-to-zoom) and
  InputEventPanGesture (two-finger pan) which browsers emit instead of
  raw dual ScreenDrag events
- Initialize _last_mouse from touch pair midpoint when second finger lands
  so two-finger pan has a correct delta baseline

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-03-29 09:39:11 -04:00
515bfaabdf Implement triggered ability target prompting (Option D)
When a Triggered ability fires and any of its actions require a human target
pick, the server now pauses execution instead of auto-resolving:

Server:
- AbilitySystem.FireTrigger detects actions needing client input via
  ActionNeedsClientTargets(); stores PendingTriggeredTarget in GameState and
  returns early rather than executing the ability
- PushStateToPlayersAsync (GameHandlerBase) checks for PendingTriggeredTarget
  after every state push and sends a game.ability.triggered_target_request push
  to the owning player carrying the action definition and range
- New GameTriggeredTargetHandler (game.triggered_target) receives the player's
  picks, calls AbilitySystem.ResumeTriggeredAbility, and broadcasts the result
- PendingTriggeredTarget model stored in GameState.PendingTriggeredTarget (JSONB)

Client:
- Game.gd handles the triggered_target_request push and emits a signal
- game_screen.gd connects the signal, re-uses the existing ABILITY_TARGET mode
  and _start_ability_targeting() flow, then sends game.triggered_target instead
  of game.activate_ability when done
- A brief banner ("Triggered: <name> — select a target") informs the player

"Warrant Cover" (OnChanneled, Owner unit pick) will now correctly prompt the
player to select which friendly unit gains +1 Defense.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-03-28 18:50:48 -04:00
cb601abd00 Add tile detail drawer, click-to-focus-camera, and occupied tile click redirect
- Right-side slide-in drawer shows tile coords, affinity, base1/base2, ruin,
  and occupant name when any tile is clicked in NONE mode; auto-closes on mode change
- New 'Focus camera when clicking a tile' setting (Settings.click_to_focus_camera),
  toggled in in-game settings panel, tweens camera to clicked tile
- Clicking a tile occupied by a unit now redirects to that unit in both NONE
  and UNIT_SELECTED modes, so you no longer need to hit the unit mesh exactly

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-03-28 17:36:01 -04:00
2e3e284023 Fix ability targeting gaps: multi-target, UpTo, ChooseOne, LinearOnly, RequiresLos
- AbilityTarget: add BranchIndex for ChooseOne branch selection
- Action: add ChooseOne? property; when set the action is a branch selector
- AbilitySystem: ExecuteSingleAction handles ChooseOne — reads BranchIndex
  from client targets, executes chosen branch actions (auto-resolved)
- game_screen.gd: count.N > 1 — input handler now accumulates targets until
  N collected before advancing to next action
- game_screen.gd: count.UpTo — show "Done Selecting" confirm button so player
  can finish with fewer than N targets
- game_screen.gd: ChooseOne — detect chooseone key in action dict, show branch
  panel with labelled buttons, record branchIndex in target payload
- game_screen.gd: LinearOnly — _is_linear() filter applied to both tile and
  unit highlights when ability range has linearonly=true
- game_screen.gd: RequiresLos — _client_has_los() supercover DDA (matches
  server LineOfSight.HasLos) applied to highlights when requireslos=true

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-03-28 16:27:47 -04:00
bd59904ce2 Add Decagonal board shape, team reassignment, and multiplayer considerations
- BoardShapeGenerator: add MakeDecagonal() for 7-10 players (10-armed
  radial, 11x11 arena, 21x21 total); AutoShape now routes 7-10 to Decagonal
- CustomLobby: add TeamAssignmentsJson (seat -> team override map)
- GameMessages: add ReassignTeamRequest/Response, LobbyTeamAssignmentChangedPush,
  SeatTeams field on JoinCustomLobbyResponse
- GameReassignTeamHandler: new game.custom.reassign_team handler (host-only);
  pushes team_reassigned to all participants including additional players
- EF migration: AddTeamAssignmentsToLobby (applied to pg-forge-01)
- Client CustomLobby.gd: seat_teams state, reassign_team() action, push handler
- lobby_room_screen.gd: _rebuild_team_controls() renders host-only [<] Tx [>]
  cycle buttons per seat in team modes; _team_label() reads seat_teams overrides
- OVERALL.md: add Considerations for Later (fog of war, asymmetric teams, ranked ELO)

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-03-28 15:18:53 -04:00
450c71544d Fix nil crash: int(null) on currentHealth in damage animations
unit.get("currentHealth", 0) returns null when the key exists with a
null value; int(null) has no valid constructor in GDScript 4.
Use explicit null check before casting.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-03-28 12:05:57 -04:00
04ad45d0f7 Fix nil crash when clicking card with null abilitiesJson
card.get("abilitiesJson", "") returns null when the key exists but
the server sent null — the default only fires for absent keys.
Assigning null to a typed String variable throws in GDScript 4.

Use an explicit null check instead of relying on the dict default.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-03-28 11:39:58 -04:00
66b116b5e0 Fix bool crash in _play_damage_animations (GDScript or operator)
GDScript 4's `or` is a logical operator that returns bool, not the
left/right value like Python. `player.get("archSpirit") or {}` was
putting true/false into the iteration array instead of the dict,
causing `is_empty` to fail with 'base bool'.

Replace with an explicit null check:
  var _arch_list = [] if arch_raw == null else [arch_raw]

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-03-28 11:30:09 -04:00
ba898f610a Filter channel tile highlights to matching affinity only
Spirits may only be channeled onto tiles whose resolvedAffinity
matches the card's affinity. Previously all unoccupied in-range tiles
were highlighted regardless of affinity.

Also:
- Cache Game.get_tile() result to avoid double lookup per cell
- Add sparse-board guard (_tile_bodies existence check)
- Remove stray debug print statements

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-03-28 11:12:39 -04:00
883543d8de Fix nil crash in _play_damage_animations on player concede
When a player is eliminated, the server sends archSpirit: null.
player.get("archSpirit", {}) returns null (not {}) when the key
exists but its value is null — the default only fires for missing
keys. GDScript then throws assigning null to unit: Dictionary.

Use `player.get("archSpirit") or {}` which coerces any falsy value
(null, missing key) to an empty dict before building the iteration
array.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-03-28 10:20:07 -04:00
c4177257ef Support sparse (non-rectangular) boards and N-player camera
Sparse board fixes:
- _bfs_path: skip neighbour tiles not present in _tile_bodies (e.g. Cross
  arm corners), preventing movement through void gaps on non-rectangular boards
- _valid_move_tiles: same tile-existence guard before adding candidates
- _attack_range_tiles: same guard for ranged-reach highlights

Camera improvements:
- Auto-scale _cam_distance from board size (max_dim × 1.5, clamped 12–30)
  so RadialStar, HexRing and other large boards are fully visible on load
- Camera orientation now uses board.startingZones centroid to derive yaw for
  any seat index, enabling correct "look from behind" for seats 2–5 in Cross,
  Triangular, RadialStar, and HexRing layouts; falls back to P1/P2 logic when
  zones are absent (legacy 1v1 games)
- Pan limits scale with board size (board_half_extent clamped 6–20) instead
  of hardcoded ±6 world units, allowing full pan across large boards

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-03-27 22:06:40 -04:00
3517ee30b5 Fix affinity logic and wire BoardTemplateCache init fetch
Builder (BoardTemplateBuilderPage):
- ComputeDisplayAffinity: rewritten to exactly mirror AffinitySystem.Resolve.
  Was reversed on gateway direction ((Void,Basic)→Gateway, (Basic,Void)→Basic)
  and silently returned Void for (Void,Aether) instead of UnstableAether.
- PaintMap: corrected B1/B2 slot assignments to match AffinitySystem.Decompose:
  basics now use (Void,Basic), gateways use (Basic,Void), UnstableAether and
  Aether both use canonical (Void,Aether).

Client (init_screen):
- Fire BoardTemplateCache.fetch() in parallel with ContentCache.start_sync()
  so the template list is populated before the player reaches a lobby screen.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-03-27 21:23:23 -04:00
5b836a8e7f Implement phase-3 board template client integration
Server:
- Add GetBoardTemplatesRequest/Response + BoardTemplateDto to ContentMessages.cs
- ContentBoardTemplatesHandler: content.board_templates → returns all enabled
  templates (id, name, dimensions, player range, flags, tilesJson, startingZonesJson)
- Register AddGameDatabase + ContentBoardTemplatesHandler in SOR.Content

Client:
- BoardTemplateCache.gd autoload: fetches content.board_templates on demand,
  exposes get_templates_for_custom(), get_templates_for_ranked(), get_template_by_id()
- rules_editor_dialog.gd: add Board Template OptionButton in the BOARD section;
  uses _option_ids map so confirmed() emits the template GUID (not label text)
- project.godot: register BoardTemplateCache autoload

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-03-27 21:12:49 -04:00
Shard a656c701c0 Handle nullable spectator arrays in Game getters 2026-03-27 14:25:00 +00:00
Shard e5a9bde653 Guard archSpirit nil in game ownership/render loops 2026-03-27 14:17:24 +00:00
Shard 8736217241 Harden multiplayer rejoin and eliminate-concede cleanup semantics 2026-03-27 14:06:50 +00:00
dingo de3c62e1e5 Missed a typeing 2026-03-27 09:27:33 -04:00
Shard bf9e0591af Fix delta arch-spawn propagation and viewer private lookup 2026-03-27 13:10:08 +00:00