feat(stats): best-move word, moves & hint-share, and a hint-count fix (#81)
The statistics screen gains real depth, plus a hint-count bug fix found along the way. - Best move per variant: the screen shows the actual best-move word (drawn as game tiles; a wildcard shows its letter but no value), broken down by game variant, empty variants omitted. New account_best_move table, written at game finish. - Moves & hint share: two new lifetime tiles — the player's play count and the share of plays that used a hint — from summed account_stats counters (moves, hints_used). Honest-AI games are excluded, like the rest of the stats. - Hint-count fix: the in-game hint badge no longer goes stale across games. The global wallet now rides the wire apart from the per-game allowance (wallet_balance on StateView/HintResult/StatsView), so the client reads the live wallet rather than a per-game snapshot; game_players.hints_used now counts every hint (allowance + wallet), its true per-game total. - Account merge: sums the new moves/hints_used counters and merges the per-variant best moves (higher score kept), which it previously dropped. - Admin: the user card shows Moves and Hints used. - UI polish: tab/label wording, game-over text, and e2e selectors hardened against label changes. All wire additions are trailing (backward-compatible). Docs (ARCHITECTURE, FUNCTIONAL +ru, UISN_DESIGN) updated in step.
This commit was merged in pull request #81.
This commit is contained in:
+37
-2
@@ -240,6 +240,12 @@ table StateView {
|
||||
bag_len:int;
|
||||
hints_remaining:int;
|
||||
alphabet:[AlphabetEntry];
|
||||
// wallet_balance is the requesting player's global hint-wallet balance, sent apart from
|
||||
// hints_remaining (which folds the wallet in with the per-game allowance) so the client can
|
||||
// separate the two: the per-game allowance remaining is hints_remaining - wallet_balance, and
|
||||
// the wallet is a single global figure the client keeps live across games (added trailing —
|
||||
// backward-compatible).
|
||||
wallet_balance:int;
|
||||
}
|
||||
|
||||
// GameActionRequest carries just a game id (pass / resign / hint / history).
|
||||
@@ -290,10 +296,14 @@ table ComplaintRequest {
|
||||
note:string;
|
||||
}
|
||||
|
||||
// HintResult is the top-ranked move plus the remaining hint budget.
|
||||
// HintResult is the top-ranked move plus the remaining hint budget. wallet_balance is the
|
||||
// global hint-wallet balance after spending (see StateView.wallet_balance), so the client
|
||||
// refreshes its live wallet and re-derives the per-game allowance (added trailing —
|
||||
// backward-compatible).
|
||||
table HintResult {
|
||||
move:MoveRecord;
|
||||
hints_remaining:int;
|
||||
wallet_balance:int;
|
||||
}
|
||||
|
||||
// DraftRequest saves the player's client-side composition for a game: a single
|
||||
@@ -458,14 +468,39 @@ table LinkResult {
|
||||
session:Session;
|
||||
}
|
||||
|
||||
// BestMoveTile is one letter cell of a best-move word: its concrete letter (the designated
|
||||
// letter for a blank), its tile point value (0 for a blank) and whether it is a blank. It
|
||||
// lets the client render the word as game tiles without the variant's alphabet table.
|
||||
table BestMoveTile {
|
||||
letter:string;
|
||||
value:int;
|
||||
blank:bool;
|
||||
}
|
||||
|
||||
// BestMoveView is an account's highest-scoring single play within one game variant: the
|
||||
// variant label, the play's total score (matching max_word_points for that variant) and its
|
||||
// main word as ordered tiles.
|
||||
table BestMoveView {
|
||||
variant:string;
|
||||
score:int;
|
||||
word:[BestMoveTile];
|
||||
}
|
||||
|
||||
// StatsView is a durable account's lifetime statistics (games-played and win-rate
|
||||
// are derived client-side).
|
||||
// are derived client-side). best_moves breaks the best move down per variant, carrying the
|
||||
// word itself; it is empty for an account with no recorded play and lists only variants the
|
||||
// account has played (added trailing — backward-compatible).
|
||||
table StatsView {
|
||||
wins:int;
|
||||
losses:int;
|
||||
draws:int;
|
||||
max_game_points:int;
|
||||
max_word_points:int;
|
||||
best_moves:[BestMoveView];
|
||||
// moves is the player's lifetime play count (tile placements); hints_used is their lifetime
|
||||
// hint count. The screen shows the hint share = hints_used / moves (added trailing).
|
||||
moves:int;
|
||||
hints_used:int;
|
||||
}
|
||||
|
||||
// TargetRequest names a single counterpart account (friend request/cancel/unfriend,
|
||||
|
||||
Reference in New Issue
Block a user