AiDeckResolver (DbUpdateConcurrencyException on re-add):
- ReplaceRange via EF navigation property was failing when the same AI
account's deck was synced more than once (retry after a failed lobby
attempt left EF's change-tracked xmin stale).
- Fix: use ExecuteDeleteAsync to delete old DeckCard rows directly
(bypasses change tracker), then AddRange new ones without touching
the navigation property. Fully idempotent.
GamePlaceArchSpiritHandler (AI never places ArchSpirit):
- Previous fix checked newState.ActivePlayerAccountId, which stays as P1
throughout the simultaneous placement phase — so AI opponents in seat 1
(guest) were never triggered.
- Fix: when !bothPlaced, scan all players for AI accounts that haven't
placed yet and publish AiTurnStartedEvent for each. When bothPlaced,
keep the existing check for the first active player in Draw/Main phase.
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>
Two bugs prevented AI from participating after being added to a lobby:
1. GameAddAiHandler never set GuestReady=true (or IsReady in additional
players JSON), so the all-ready check in GameLobbyReadyHandler never
fired — the game never started when the host clicked ready.
Fix: set GuestReady=true for 1v1, IsReady=true for multi-player.
2. GamePlaceArchSpiritHandler never published AiTurnStartedEvent.
If the human places first, the AI placement turn was never triggered.
Likewise, if the AI goes first in the Active phase after both players
place, no event fired. Fix: check the new active player after each
placement and publish AiTurnStartedEvent if it is an AI seat.
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>
AiDeckResolver depends on BazaarDbContext to look up prebuilt decks, but
AddAiService never registered it. When NatsMessageRpcResponder.StartAsync
called GetServices<IMessageHandler>(), DI failed to instantiate
GameAddAiHandler (via AiDeckResolver → BazaarDbContext not found),
causing the entire NATS subscription startup to throw — leaving the AI
pod with no NATS listeners.
Fix: AddBazaarDatabase(configuration) is now called at the top of
AddAiService before any handlers are registered.
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>
- Phase Summary table: mark phases 1.1-4.4 as done (added 4.3 training
pipeline and 4.4 client UI); mark 5.1-5.6 as TODO with status column
- Section 7.3: replace placeholder model spec with actual implemented
ValueNet MLP (1024->512->256->128->1 tanh, ~920k params, ONNX contract)
- Section 7.4: replace stub pipeline with actual How to Train the AI
guide (self-play -> export -> train_neural.py -> hot-swap); includes
CLI flags table and iterative improvement workflow
- New section: Remaining Work (Phases 5.x) with full implementation
detail for each pending phase: active abilities (5.1), triggered
target selection (5.2), adaptive difficulty API (5.3), personality
& display (5.4), counter-deck selection (5.5), initial model
operational runbook (5.6)
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 NeuralModelRegistry singleton: loads ONNX model from Ai:NeuralModelPath,
hot-swap via ReloadAsync(), static Instance for engine access
- Add NeuralEvaluator: GameState → ONNX inference with heuristic fallback when
no model is loaded (tiers 9-10 fully playable without a trained model)
- Add AiNeuralStartupService: loads model at startup, logs if not configured
- Add NeuralDecisionEngine: MCTS with neural leaf evaluation (400 sims/action,
6-10s budget) replacing random rollouts with direct score estimation
- Set tiers 9-10 EngineType="Neural" in AiDifficultyProfiles
- Add AiModelPage (/ai/model): model status, hot-swap button, ONNX contract docs
- Register NeuralModelRegistry + NeuralDecisionEngine in SOR.Ai and SOR.Admin
- Add Microsoft.ML.OnnxRuntime 1.18.0 to central package versions
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>
- AiDeckResolver: resolves which prebuilt deck an AI uses for a given
difficulty. Checks AiDeckAssignment table first (admin-configured),
then falls back to a random active starter deck. Creates/updates a real
Deck row in CollectionDb so GameReadyHandler's standard path works unchanged.
- AiDeckAssignment entity + EF migration (ai_deck_assignments table): admin
maps Difficulty 1-10 → PrebuiltDeckId; null = "random starter".
- GameAddAiHandler: replaced direct Deck lookup with AiDeckResolver.ResolveAsync.
- AiSeedStartupService: removed AiDeckSeeder call — decks are resolved
per-game from prebuilt decks, not pre-seeded with placeholder cards.
- ServiceRegistration: registers AiDeckResolver as Scoped.
- Admin: new /ai/deck-config page (AiDeckConfigPage) showing a D1-D10 table
with prebuilt deck dropdowns; saved via upsert. Added to AI nav section.
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>
SOR.Admin now references SOR.Ai (Phase 3 calibration pages), which
transitively depends on SOR.Game. Both csproj files must be copied
before dotnet restore or the layer cache miss causes NETSDK1004.
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>
- MCTS (UCT) decision engine for difficulty tiers 6-8 (MctsNode, MctsSimulator,
MonteCarloEngine); tiers 6-8 updated from Heuristic → MCTS in AiDifficultyProfiles
- AiEloService: separate ELO ledger for AI accounts (ai_elo_records table)
so calibration games don't pollute the human RankScore leaderboard
- FinalizeGameAsync / FinalizeMultiPlayerGameAsync: AI accounts are now guarded
from RankScore and OriginPoints adjustments (IsAi check)
- AiPlayerSessionManager: async GameEnded handler calls AiEloService
- SelfPlayRunner: pure in-process AI vs AI game loop (no DB, no NATS)
- SelfPlayOrchestrator: batch runner loading real decks from DB, parallel games
- FeatureExtractor: GameState → float[1024] feature vector for ML training
- GameReplayExporter: replays completed sessions → TrainingRecord JSONL
- TrainingDataWriter: async JSONL writer
- AiCalibrationJob: pairwise self-play calibration (D1vD2…D9vD10), writes
AiCalibrationRun rows to GameDbContext
- EF migration: ai_elo_records + ai_calibration_runs tables applied to remote DB
- SOR.Admin: references SOR.Ai; new AI section in NavMenu with ELO Leaderboard
and Calibration pages; SelfPlayOrchestrator + AiCalibrationJob registered
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>
Full design document for the AI player system: project structure,
integration approach (AI as a real player through the existing handler
pipeline), 23 granular implementation phases across 5 tracks (scaffold,
turn pipeline, MCTS, neural engine, polish), difficulty/strategy system,
training data pipeline, and self-play calibration strategy.
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>
- HasAbilities now uses JsonDocument to check array length > 0, so
cards with an empty [] don't incorrectly show as having abilities.
- Added Card Desc column/filter: whether the card's own Description
field is non-empty.
- Added Ability Desc column/filter: whether at least one ability in the
JSON array has a non-empty description field. Shows — when card has
no abilities.
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>
- /reports/cards: filterable report of all cards with columns for 3D
model (+ AI badge), 2D art, abilities, SFX, and prebuilt deck membership.
All entries link to card editor and deck detail pages.
- AccountDetail: danger-zone Delete Account section that cascades through
collection, bazaar, chat, game lobbies/presets, and identity data.
Requires typing DELETE to confirm; preserves game session history.
- NavMenu: Reports section wired up.
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>
Both GameLobbyReadyHandler and MatchmakerService were building BoardTemplateSnapshot
without GridType/HexSides. FromTemplate checks HexSides > 0 to set IsTemplateBased,
so hex templates were silently treated as square grids.
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>
IsOrthogonallyAdjacentTo uses Manhattan distance == 1, which only
covers the 4 square neighbours. The two hex-diagonal offsets (1,-1)
and (-1,+1) have Manhattan distance 2 and were rejected.
Now mirrors the existing server pattern: use HexGrid.Distance == 1
when board.HexSides > 0, fall back to IsOrthogonallyAdjacentTo for
square 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>
- TileBottomModel gains a Shape column (Square/Hex, default Square)
so admins can manage separate stalagmite pools per tile grid type
- EF migration 20260407153312_AddTileBottomModelShape adds the column
with a default of 'Square' to preserve existing data
- Admin UI splits the Tile Bottom Models section into Square and Hex
cards, each with their own Add/toggle/delete controls
- content.tile_bottoms response now returns squareUrls and hexUrls
separately; handler queries each shape independently
- ContentCache splits into _tile_bottom_urls_square / _hex and
get_random_tile_bottom_url() now takes a shape parameter
- game_screen: hex tiles with no 3D model now receive a hex stalagmite
instead of silently skipping; 3D-model path passes shape_key through
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>
Main already had the HexLine+flood-fill implementation. Resolution keeps
main's CartToHex/CubeRound local functions and zone logic, but switches
the sideLength source from _pendingHexRadius to _pendingHexSideLength and
adds _template.HexSideLength = L to persist the new field.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add HexSideLength property to BoardTemplate (tiles per edge)
- Add EF migration 20260406000000_AddBoardTemplateHexSideLength
- Replace NPolyInside (Euclidean circle test) with HexLine + flood-fill:
* N corners placed at circumradius = (L-1)/(2·sin(π/N)) in hex-Cartesian
* Corners snapped to nearest integer axial cell via HexRound
* Perimeter built by hex-line lerp between adjacent corners
* Interior determined by BFS flood-fill from center
- Auto-compute bounding hex radius from side length (max(L*2, ceil(circumR)+2))
- UI: expose Side Length input instead of Radius; canvas header shows L=n tiles/edge
- Zone tiles now walk along actual hex-line edges from each corner
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the direction-snapping approach (which broke N>6 and N=5) with:
1. Place N corners as a true regular N-gon in Cartesian space (radius =
sideLength), then snap each to the nearest hex via cube-coordinate
rounding (CartToHex / CubeRound).
2. Draw each edge with cube-space lerp (HexLine): interpolate in cube
coords and round at each step, producing the canonical hex-lattice
line between any two tiles regardless of direction.
3. Flood-fill from (0,0) with the edge tiles as walls.
4. Mark absent all in-bounds tiles outside the filled region.
This correctly handles all N in [3,10] without direction quantisation
or bridging hacks.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ApplyHexConfig now:
1. Picks the closest hex direction (axial, pointy-top) to each of the N
evenly-spaced target angles (360°/N · k).
2. Walks sideLength steps per side from pre-computed centred corners.
3. Bridges any gap between the end of one side and the start of the next
by greedily stepping toward the target corner.
4. Flood-fills the interior from (0,0) stopping at the border ring.
5. Marks only the out-of-shape in-bounds tiles as absent; present tiles
stay as default (no _tiles entry needed).
N=3 (triangle) and N=6 (hexagon) produce exact shapes with no bridging;
other N values approximate with minimal bridging tiles.
Zone generation updated to use the actual axial corner positions instead
of Cartesian vertex approximations.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All 26 pages had @attribute [Authorize(Roles = "Admin,SuperAdmin")] which
conflicts with the Keycloak role sor-admin. The fallback policy in Program.cs
already enforces RequireRole("sor-admin") globally, making these attributes
redundant. Removing them fixes Access Denied for all admin pages.
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>
Without shared key storage, pod A's cookies were unreadable by pod B, causing
an infinite OIDC redirect loop that appeared as access denied. Keys are now
persisted under SOR.Admin:DataProtection-Keys in the existing Redis instance.
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>
Replaces the default ConfigurationManager with a FixedConfigurationManager
that returns the pre-fetched OpenIdConnectConfiguration synchronously, so
per-request GetConfigurationAsync can never fail due to network errors or
cancellation-token / lock-contention issues in the dynamic manager.
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>
Eagerly fetch the Keycloak discovery document after app.Build() so any
network/DNS/SSL failure appears in startup logs with the real exception and
the exact URL being fetched, rather than surfacing later as the cryptic
"Cannot redirect to the authorization endpoint" 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>
Without it, liveness/readiness probe requests hit the fallback auth policy,
trigger an OIDC challenge, fail with 500, and restart the pod in a loop —
which is the root cause of the repeated auth instability.
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 pod cannot reach auth.aeternalisgames.com from inside the cluster (DNS/
network policy), so the OIDC middleware fails to fetch the discovery document
and throws "Cannot redirect to the authorization endpoint".
Add optional Keycloak__MetadataAddress env var. When set, the middleware
fetches the discovery doc from that URL (internal k8s service, HTTP allowed)
while still validating JWT issuer against the public Authority URL.
Set in sor-config:
Keycloak__MetadataAddress=http://<keycloak-service>.<ns>.svc.cluster.local:<port>/realms/aeternalis
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>
- Validate Keycloak:Authority and Keycloak:ClientId at startup with a clear
InvalidOperationException. Previously a missing env var produced the cryptic
"Cannot redirect to the authorization endpoint" error on every request.
- Remove app.UseHttpsRedirection(). The pod runs plain HTTP on :8080; TLS is
terminated at the ingress. The middleware had no HTTPS port to redirect to,
generating a warning on every request and potentially interfering with the
OIDC 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>
ctx.TokenEndpointResponse?.AccessToken in OnTokenValidated is not reliably
populated; if null the silent catch left the principal with no role claims,
causing 403 on every request despite successful Keycloak auth.
Switch to OnTicketReceived which fires after SaveTokens — access token is
guaranteed present via ctx.Properties.GetTokenValue("access_token").
Use JsonWebTokenHandler.ReadJsonWebToken() instead of manual base64 decode
to eliminate silent parse failures. Extracts both realm_access.roles and
groups claims so either Keycloak assignment style works.
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>
realm_access.roles only contains directly-assigned realm roles. When the user
is a member of a Keycloak group (e.g. "sor-admin"), the group appears under
the groups claim as "/sor-admin". Parse both sources so group membership
satisfies RequireRole("sor-admin") the same way a realm role would.
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>
1. Remove GetClaimsFromUserInfoEndpoint=true — the extra pod→Keycloak HTTPS
call was throwing (SSL/network error from within the cluster), which hit the
exception handler and triggered a protected /Error redirect, starting the loop.
Roles are extracted from the access token payload instead (no HTTP call needed).
2. Set AccessDeniedPath=PathString.Empty on the cookie handler — the default
/Account/AccessDenied path doesn't exist in this app, causing the cookie
middleware to redirect there infinitely. Empty path returns 403 directly.
3. Replace UseExceptionHandler("/Error") with an inline handler — /Error is a
protected Blazor route; redirecting to it while unauthenticated re-triggered
the auth challenge, feeding the redirect loop. Inline handler returns 500
without any redirect.
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>
OnTokenValidated + manual access-token base64 decode was unreliable.
Switch to GetClaimsFromUserInfoEndpoint=true and extract realm_access.roles
in OnUserInformationReceived where the UserInfo JSON is already parsed into
ctx.User (JsonDocument) — no manual JWT decoding needed.
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 admin pod runs plain HTTP; the ingress terminates TLS. Without forwarded
headers, ASP.NET Core built the redirect_uri as "http://control.aeternalisgames.com/signin-oidc"
but Keycloak only accepts the https:// variant, causing "invalid_redirect_uri".
Add UseForwardedHeaders() with XForwardedProto/Host/For before UseAuthentication
so the OIDC middleware sees the correct public https scheme and hostname when
constructing the callback URL.
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 panel now delegates authentication entirely to Keycloak using the
Authorization Code flow. The local Identity password form and
IdentityRevalidatingAuthenticationStateProvider are removed. Access requires
the "admin" Keycloak realm role, mirroring the game's role-based auth model.
- Program.cs: AddOpenIdConnect("Keycloak") with cookie session; /auth/challenge
triggers the OIDC flow; /auth/logout signs out of both cookie and Keycloak SSO
- Login.razor: replaced HTML form with an immediate redirect to /auth/challenge
- IdentityRevalidatingAuthenticationStateProvider.cs: deleted (no longer needed)
- appsettings.json: Keycloak:Authority / ClientId / ClientSecret section added
- Directory.Packages.props: pinned Microsoft.AspNetCore.Authentication.OpenIdConnect 8.0.0
- SOR.Admin.csproj: added OpenIdConnect package reference
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 — JWT audience validation failing:
Keycloak does not include the client ID in the `aud` claim by default
(uses "account"). ValidateAudience=true with ValidAudience="sor-game"
rejected every token. Disabled audience validation — issuer + signature
+ realm role check is sufficient for a single-realm deployment.
Bumped JWT validation failure log to Information so it appears in default logs.
Client — DISCONNECTED instead of AUTH_FAILED on rejected auth:
When the server sends an error packet immediately followed by a close frame,
the socket transitions to STATE_CLOSING before the next _process frame.
Network.gd returned early during STATE_CLOSING without draining packets,
leaving the pending request unresolved. _on_ws_closed then failed it as
DISCONNECTED. Now drains packets during STATE_CLOSING so the error packet
is resolved with the correct error code before the close is processed.
Also added "invalid_token", "role_required", "invalid_payload",
"auth_service_unavailable", "account_creation_failed" to the close reason
→ error code mapping so they surface as AUTH_FAILED / AUTH_SERVICE_UNAVAILABLE
rather than DISCONNECTED even in the fallback path.
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:
- Add TeamCount, PlayerOneTeamIndex, PlayerTwoTeamIndex to GameSession so
team assignments survive the lobby→game transition without recomputation
- GameLobbyReadyHandler.StartGameAsync: apply TeamAssignmentsJson (host custom
reassignments) for all seats; store P1/P2 team indices on the session
- GameReadyHandler N-player path: use session.PlayerOneTeamIndex /
PlayerTwoTeamIndex instead of hardcoded teamCount=1 (which put both P1 and
P2 on team 0 in every non-FFA game)
- EF migration: AddGameSessionTeamFields
Client (game_screen.gd):
- _rebuild_ownership: treat same-team allies as friendly instead of enemy
- Unit color loop: use state.teamColors palette per team instead of hardcoded
blue (self) / red (everyone else)
- _on_game_over: derive i_won from player_outcomes[me].outcome == "Winner" so
a teammate's final kill correctly shows "Victory!" for the whole team
Also: skip absent hex tiles in BoardTemplateBuilder SVG render
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>
- 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>