- HexSides now stores radius+1 (for hex coordinate math); HexPolygonSides stores the corner count (3–10)
- Board.IsTemplateBased: template boards use tile existence for IsInBounds/GetNeighbors instead of the hexagonal formula, so N-gon and other custom shapes work correctly
- HexGrid.AllNeighbors: unfiltered 6-neighbor generator for template board use
- ApplyHexConfig: generates a regular N-gon on the hex canvas — tiles outside the polygon are marked absent; N corner zones auto-generated for each player count 2..N
- Admin builder UI: separate "Polygon Sides" (3–10 corners) and "Radius (tiles)" inputs
- BoardTemplate entity and migration: HexPolygonSides column added to board_templates
- BoardTemplateDto exposes HexPolygonSides to client
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>
- 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>
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>
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>
DB columns are PascalCase (e.g. BoardWidth, not board_width). The previous
migration used snake_case names — renamed grid_type→GridType and hex_sides→HexSides
on pg-forge-01, and updated the migration file to match so future re-runs are correct.
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>
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>
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>
- 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>
- Add IsAvailableInShop to the buy query so decks not marked for sale
cannot be purchased directly by ID (store listing already filtered
this, but the buy endpoint did not)
- Remove the unconditional starter-deck block; IsAvailableInShop is
now the single gate — if an admin explicitly marks a starter deck
as available in shop it can be purchased like any other deck
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>
The client sends 'boardTemplateIdOverride' but the server DTO had the
property named 'BoardTemplateId' (serializes to 'boardTemplateId').
The JSON key mismatch caused the server to always receive null, so
lobby.BoardTemplateIdOverride was never set and the auto-shape ran.
Rename BoardTemplateId → BoardTemplateIdOverride throughout
CustomRulesOverride and CustomRulesDto to match the client's key.
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>
CustomRulesOverride and CustomRulesDto both lacked a BoardTemplateId
field, so the client's template selection was never received or stored.
lobby.BoardTemplateIdOverride always remained null, boardTemplateJson
was never built, and the auto-shape generator ran instead of the
template.
- CustomRulesOverride: add Guid? BoardTemplateId
- CustomRulesDto: add Guid? BoardTemplateId (default null for compat)
- GameCreateCustomLobbyHandler: save BoardTemplateIdOverride on create;
thread boardTemplateId through ToDto()
- GameUpdateLobbyRulesHandler: save BoardTemplateIdOverride on update
- GameGetLobbyHandler, GameJoinCustomLobbyHandler,
GameListCustomLobbiesHandler, GameListActiveLobbiesHandler:
include BoardTemplateId in outgoing DTOs
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>
The lobby ready handler only checked lobby.BoardTemplateIdOverride and
never fell back to dbDefaults.BoardTemplateId, so templates configured
on the admin default GameRuleSet were silently skipped and the
auto-shape generator ran instead.
Apply the same override → default fallback chain as all other rules:
effectiveTemplateId = lobby.BoardTemplateIdOverride ?? dbDefaults?.BoardTemplateId
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>
- SnapshotTile: add IsAbsent flag (JSON: "absent")
- BoardShapeGenerator.FromTemplate(): absent tiles are removed from
the tiles dict instead of being filled with Void+Void, producing
sparse board layouts with genuine missing cells
- Builder: Empty swatch in paint palette marks cells as absent
(striped crosshatch visual); absent cells are excluded from zone
assignment; PureVoid paint clears absent state back to valid void;
ApplyModal() also clears IsAbsent; SerializeTiles() includes absent
entries so they round-trip correctly through save/load
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>
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>
- Add BoardTemplateJson (nullable string) to GameRules so admin-defined
board layouts are snapshotted at session creation; in-flight games are
unaffected by subsequent template edits.
- Introduce BoardTemplateSnapshot + SnapshotTile types in SOR.Game.Grid
(integer-enum serialisation matching the admin builder).
- BoardShapeGenerator.FromTemplate / FromTemplateJson: build a Board from
a snapshot, respecting AffinityOverrideable + StartingRandomTilePct.
- GameEngine.Initialize: use FromTemplateJson when BoardTemplateJson is set,
falling back to algorithmic Generate.
- GameLobbyReadyHandler: load BoardTemplateIdOverride template from DB and
embed as BoardTemplateJson in the rule snapshot at lobby start.
- MatchmakerService: load BoardTemplateId template from DB and embed via
JsonElement in the ranked-rule snapshot at match creation.
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>
3rd-player ready-up (two root causes):
- Server: LobbyReadyStatusPush to additional players was deserialized
without PropertyNameCaseInsensitive, so after the 3rd player readied
(converting JSON to camelCase) all subsequent pushes went to Guid.Empty
→ 3rd player never received ready/start notifications
- Client: ready_status push handler treated all non-hosts as "guest",
so i_am_ready was incorrectly set from guestReady for additional players
→ their ready state was clobbered every time host/guest readied
- Server: JoinCustomLobbyResponse now includes IsAdditionalPlayer flag
so the client can correctly distinguish guest from 3rd+ player
Board shape fallback:
- GameEngine.cs 2-player overload and GameReadyHandler N-player path both
now treat "Default"/null BoardShape as AutoShape(playerCount) rather than
hardcoded "Rectangle", fixing old sessions and ranked matches
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>
- GameEngine.cs: 2-player Initialize overload was hardcoding "Rectangle"
regardless of rules.BoardShape — now uses rules?.BoardShape ?? "Rectangle"
- game_screen.gd: _on_player_eliminated was setting _is_spectating but not
calling _setup_spectator_ui(), leaving eliminated players with no Leave button
- GameGetStateHandler.cs: on reconnect (game.get_state), populate missing
display names from identity DB so old/reconnected sessions show real names
instead of truncated account IDs
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>
- rules_editor_dialog.gd: add add_option helper, boardShape OptionButton
in BOARD section (Default/Rectangle/Cross/Triangular/RadialStar/HexRing),
and OptionButton branch in _on_confirm
- lobby_room_screen.gd: add boardShape to both rules display dicts
- AbilityBuilder.razor: add help docs for OnUnitSentToDiscard CausedBy field
- GameDbContextModelSnapshot.cs: reflect AddBoardShapeOverride migration
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>
- CustomLobby: add BoardShapeOverride (null/"Default" → AutoShape at game start)
- CustomRulesOverride: add optional BoardShape string field for lobby creation/update
- CustomRulesDto: add BoardShape field exposed to clients ("Default" | shape name)
- GameCreateCustomLobbyHandler: store + pass BoardShapeOverride; ToDto gains
optional boardShape param so shape is reflected in the creation response
- GameGetLobbyHandler / GameJoinCustomLobbyHandler / GameListCustomLobbiesHandler
/ GameListActiveLobbiesHandler: all pass lobby.BoardShapeOverride to ToDto
- GameUpdateLobbyRulesHandler: store BoardShapeOverride when rules are edited
- GameLobbyReadyHandler: resolve boardShape — use explicit override when set,
otherwise fall back to BoardShapeGenerator.AutoShape(playerCount)
- EF migration AddBoardShapeOverride: adds board_shape_override column
Valid BoardShape values: null | "Default" | "Rectangle" | "Cross" |
"Triangular" | "RadialStar" | "HexRing"
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>
Server:
- PlayerState: add DisplayName property (populated from identity DB)
- PlayerStateDto: add DisplayName field (falls back to truncated ID)
- GameEngine.ToDto: include DisplayName in player DTO
- GameReadyHandler: resolve display names from identity DB after state
initialization so every subsequent state push carries them
Client:
- Game.gd: add get_display_name(account_id) helper — reads displayName
from player state, falls back to substr(0,8)
- game_screen.gd: replace all 5 pid/eid/elim_id.substr(0,8) UI sites
with Game.get_display_name() — HUD opp name, turn order strip,
game-over outcome list, discard scope selector, elimination dialog
- Turn order strip chips: use resolved display name; add mouse_filter
STOP + tooltip_text showing SP/ST/Hand/Deck for opponent chips on hover
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>
- GameEngine.Concede: use EliminatePlayer instead of unconditionally
setting GamePhase.GameOver — FFA game continues until one team remains.
Return value changed to (GameState, bool gameOver) tuple.
- GameConcedeHandler / GameForceConcedeHandler: check gameOver flag;
when game continues push BroadcastPlayerEliminatedAsync + state update
instead of calling FinalizeMultiPlayerGameAsync prematurely.
- game_screen.gd _valid_attack_target_coords: use `not (_tpos is Dictionary)`
guard instead of typed assignment — prevents nil crash when eliminated
players' units still appear in get_all_enemy_units() with position:null.
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>
- GameReadyHandler: change `else` → `else if (P2)` so Player 3+ no
longer incorrectly marks PlayerTwoReady; additional players now track
their own IsReady flag inside AdditionalPlayersJson on the session.
All-ready check now waits for P1 + P2 + all additional players.
- GameLobbyReadyHandler.StartGameAsync: add PropertyNameCaseInsensitive
when deserializing AdditionalPlayersJson → prevents Guid.Empty deck IDs
caused by camelCase/PascalCase mismatch between join and ready handlers.
- SessionAdditionalPlayer: add IsReady property to support per-player
ready tracking in the N-player game.ready flow.
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>
BoardShapeGenerator: 2-player rectangle now assigns one row per seat
(row 0 for seat 0, top row for seat 1), restoring the original 1v1
behaviour. 3-4 player lobbies keep the two-row zones for extra
placement room.
Game.gd game.over: server sends playerOutcomes:null for 2-player games.
d.get(key, default) returns null when the key exists with value null,
so 'null as Array' crashed. Use 'is Array' guard to safely fall back
to an empty array when the field is absent or null.
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>
GameLobbyReadyHandler: change else→else if (isGuest) so additional
players (seat 3+) no longer incorrectly set GuestReady=true. When
Player 3 called ready the else-branch marked GuestReady, making the
all-ready check fire as soon as the host was also ready — starting
the game without Player 2 ever clicking ready, leaving 2/3 clients
in a starting state and 1 stuck in the lobby.
Also: update DeckId for additional players in AdditionalPlayersJson;
push ready_status to additional player connections.
GameUnreadyHandler: handle additional players (seat 3+) by updating
isReady in AdditionalPlayersJson via JsonNode; push unready status to
all participants including additional players. Previously threw
NOT_IN_LOBBY for anyone beyond the primary guest.
Game.gd: guard _on_auth_reconnect with 'state is non-empty' so stale
session_id values from ended games don't trigger spurious game.ready
calls. Also clear session_id in the game.over handler so it never
lingers past the end of a session.
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>
- game_screen.gd: fix Parser Error on line 270 — use 'as Environment'
cast instead of ': Variant' annotation for WorldEnvironment.environment
- Game.gd: auto-resend game.ready on auth_success reconnect so the
game session is restored when the WebSocket reconnects mid-game
- lobby_browser_row.gd: show real N/Max player count instead of
hardcoded "1/2" / "2/2"
- CustomLobbyDto: add MaxPlayers, CurrentPlayerCount, GameMode, TeamCount
- GameListCustomLobbiesHandler: compute currentPlayerCount from
GuestAccountId + AdditionalPlayersJson; pass new fields to DTO
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>
Server:
- BoardDto: add StartingZones (seat → coord list) so client knows valid placement tiles
- GameEngine.ToBoardDto: serialize StartingZones into the DTO
Client – Game.gd:
- get_enemy_players(): returns all players not on the local player's team
- get_all_enemy_units(): flat list of field + archSpirit from all enemies
- game_over signal: adds player_outcomes: Array parameter
- game.over push: extracts playerOutcomes array and passes to signal
Client – game_screen.gd:
- _valid_placement_tiles(): uses board.startingZones[seatIndex] when available; falls back to legacy row logic
- _valid_attack_target_coords/ids: use Game.get_all_enemy_units() instead of single opponent
- ability target picker: uses get_all_enemy_units() for enemy units
- player-panel builder (zone abilities): iterates get_enemy_players() for N-player
- _on_game_over: shows per-player rank deltas from playerOutcomes when present
Client – CustomLobby.gd:
- State: max_players, game_mode, team_count fields (cleared on clear_state)
- create(): accepts p_max_players, p_game_mode, p_team_count params; sends to server
- join(): stores max_players/game_mode/team_count from server response
- game.custom.started: calls clear_state() before emitting game_starting
Client – FreePlayScreen:
- Create dialog: MaxPlayersSpinner (2-10), GameModeOption (FFA/Teams/MultiTeam), TeamCountRow (hidden for FFA)
- GameModeOption.item_selected toggles team_count_row visibility
- _on_create_confirmed: passes max_players, game_mode, team_count to CustomLobby.create()
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>
- GameEngine: GetNPlayerTurnLimitWinners() ranks surviving players by ArchSpirit HP; highest-HP player(s) win, rest lose
- GameConcedeHandler: N-player path — conceder is loser, remaining non-eliminated players are winners; delegates to FinalizeMultiPlayerGameAsync
- GameForceConcedeHandler: same N-player/1v1 branch split for inactivity forfeit
- GameEndTurnHandler: N-player path uses GetNPlayerTurnLimitWinners + FinalizeMultiPlayerGameAsync on turn-limit game-over
- GameTurnTimerService: same N-player/1v1 branch on timer-expiry game-over
- Game.gd: player_eliminated signal + game.player_eliminated push handler
- game_screen.gd: _on_player_eliminated shows AcceptDialog; sets _is_spectating=true for the local player so they can watch the rest of the game
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>