Commit graph

161 commits

Author SHA1 Message Date
4efd60cb52 Preserve first-match exchange inference 2026-09-27 19:32:29 +02:00
c0aefa5d14 Honor exchange inferences when sampling production cards 2026-09-27 19:29:55 +02:00
9860195072 Preserve observed card and bid constraints across analysis resampling 2026-09-27 19:22:40 +02:00
46e322f98b Add observation-based ongoing analysis scenarios 2026-09-27 19:14:27 +02:00
911a6c9db2 Keep slow chat and journal scrolling away from the bottom 2026-09-27 10:07:01 +02:00
126c9670f0 Improve mobile action layout and preserve touch scrolling 2026-09-27 09:33:06 +02:00
4d41681ad5 Add Persian viewer and tutorial translations 2026-09-27 00:53:02 +02:00
37fa7d4449 Fit two auction upgrades per row on mobile 2026-09-26 15:48:04 +02:00
64d94565f7 Identify opponents’ resource cards with icons 2026-09-26 15:13:01 +02:00
28c4971d48 fix(viewer): restore saved unread chat counts 2026-09-26 12:10:19 +02:00
7f11b0c6c7 Translate complete journal upgrade and action lists 2026-09-25 22:10:06 +02:00
cca9122873 Review viewer terminology and tutorials across every locale 2026-09-25 21:38:47 +02:00
00f063ee3c Translate complete viewer effects and prompts before rendering icons 2026-09-25 21:19:53 +02:00
97ed84e610 feat(viewer): localize interface and tutorials in 15 languages 2026-09-25 16:30:05 +02:00
52e1fcbc16 feat(viewer): add player hover cards and board thumbnails 2026-09-24 11:44:29 +02:00
50c209beb7 feat(viewer): support editing chat messages 2026-09-21 22:40:11 +02:00
c86c8e46f1 fix(viewer): make chat translation controls compact 2026-09-21 21:53:15 +02:00
3bdb1f9295 Support playable analyses and translated chat 2026-09-21 20:32:12 +02:00
c20c47de4d Deal four ore and two water cards at setup 2026-09-18 17:14:01 +02:00
07c4b1d46e Explain tutorial quiz answers and integrate chapter navigation 2026-09-16 09:30:26 +02:00
82aa8b3324 Add guided Outpost tutorials and fix open auction feedback 2026-09-16 00:02:55 +02:00
04a1bc1499 Continue chat messages after Tab-completing a mention 2026-09-13 22:51:00 +02:00
6385032ca7 Clear visible chat mentions in BGS and show date separators 2026-09-13 22:41:01 +02:00
9b8b8cb07f Share chat input and scrolling behavior while retaining colony UI 2026-09-13 22:18:53 +02:00
ae6d311775 Use shared BGS protocol for viewer lifecycle and chat 2026-09-13 20:14:10 +02:00
c9377b0a30 Require sealed challengers to bid above the base price 2026-09-12 20:36:07 +02:00
42e27f2d58 Wrap large factory groups inside player cards 2026-09-11 20:44:00 +02:00
a1e7ec2589 Scroll recent events after iframe layout settles 2026-09-11 19:37:32 +02:00
bf247cdc5b Clarify auctions and era progress, add action sounds and release 0.10.12 2026-09-10 22:12:49 +02:00
fe850e9836 Release Outpost engine 0.10.11 2026-09-10 18:30:46 +02:00
6ea0353c02 Separate robot ownership from operation and require usable workers to be assigned 2026-09-10 18:28:27 +02:00
bd63371622 Redraw colony structures and add Kicker landmarks with Biosphere domes 2026-09-10 18:23:37 +02:00
636a470ff9 Chat: auto-scroll to newest; keep Wily Trader exchanges out of chat
The chat feed stays chronological (newest last) and now scrolls to the
bottom on load and on each new message while the user is already near the
bottom — scrolling up to read history no longer gets yanked back down.

Exchange moves no longer push a message into the game chat. The engine's
state.messages drains into the platform's chat as system messages, and the
per-trade lines were pure noise there — the trade already shows in the event
log. Chat is now reserved for game-over and auction wins. Engine 0.10.10.
2026-09-10 14:32:52 +00:00
coyotte508
8c3941bab4 Render game chat in the viewer (boardgamers #509/#510 contract) (#1)
## Summary

Render the platform's game chat inside the Outpost viewer. This is the **reference-engine implementation** of the viewer-chat protocol that was added to the platform in **boardgamers/boardgamers#510** (issue **boardgamers/boardgamers#509** — Outpost is the reference engine named there).

The viewer now owns the game chat surface: a `ChatPanel` sits beside the event log and renders the room chat, fed by the `chat:*` downlink events and posting through the `chat:send` / `chat:read` uplinks, per the merged platform contract.

## Protocol conformance (boardgamers/boardgamers#510, incl. the Fuji-author additions)

Downlink (host → viewer), handled in `store.svelte.ts`:

- `chat:messages` — full-history replace (on mount/remount)
- `chat:appended` — append new messages (own accepted posts come back this way; no optimistic echo)
- `chat:updated` — replace in place by `_id`
- `chat:deleted` — drop by `ids: string[]`
- `chat:disabled` — room kill switch, hides the composer
- `chat:state` — write-permission `{ canSend, reason? }`, gates the composer with a human-readable reason
- `chat:result` — **send-ack** `{ requestId, ok, error? }`; refused sends restore the draft and show the error so the user can retry

Uplink (viewer → host), on `ViewerBridge`:

- `chat:send` — `{ text, requestId? }`; every send carries a `requestId` so it is answered by one `chat:result`
- `chat:read` — **read receipt** `{ messageId }`; watermarks the newest shown message (real ObjectIds only) so the platform clears its unread badge while the viewer owns the chat surface

`ViewerChatMessage` supports the additive author identity fields: `authorId`, `playerIndex`, `createdAt` (author colors prefer `playerIndex`, falling back to a name match — never matching identity on the name). `editedAt` renders an "(edited)" marker; `createdAt` renders a short timestamp.

## Files

- `packages/viewer/src/lib/bgs.svelte.ts` — `ViewerChatMessage` (+ `authorId`/`playerIndex`/`createdAt`), `ViewerChatCanSend`, `ViewerChatResult`; the `chat:*` event types; `sendChat` / `readChat` uplinks.
- `packages/viewer/src/lib/store.svelte.ts` — chat state (`chatMessages` / `chatDisabled` / `chatCanSend`), `chat:result` ack handling with draft restore, `chat:read` watermark, `chatAuthorColor`.
- `packages/viewer/src/lib/ChatPanel.svelte` — feed + composer, author colors, write gating, edited/time display, send-error surface.
- `packages/viewer/src/App.svelte` — panel placed above the log in the desktop sidebar and the mobile column.
- `packages/viewer/src/dev-backend.ts`, `packages/viewer/src/dev.ts` — dev harness: seeded history, echo sends as `chat:appended` with identity fields, `chat:result` acks, and `outpostDev.chatAppend` / `chatDisable` / `chatState` console helpers.

## Verification

`pnpm build` (engine + viewer) and `svelte-check` pass with 0 errors; the chat event vocabulary and panel are present in the built `outpost-viewer.iife.js`. The dev harness (`pnpm dev`) seeds a chat history and echoes accepted sends, so the panel can be exercised locally end-to-end against the mock backend.

Closes the engine-viewer half of boardgamers/boardgamers#509.

Co-authored-by: Coyote508 (bgs-ci) <coyotte508@users.noreply.codeberg.org>
Reviewed-on: https://codeberg.org/boardgamers/outpost/pulls/1
2026-09-10 15:31:12 +02:00
a69f21c9d9 ci: tighten workflow header 2026-09-10 12:50:25 +00:00
bed335c133 ci: enable Forgejo Actions on the repo 2026-09-10 12:49:57 +00:00
d9b2b9afcd ci: trigger first Forgejo Actions run 2026-09-10 12:47:40 +00:00
0e28593cef Move the repo to Codeberg and port CI to Forgejo Actions
The project now lives at codeberg.org/boardgamers/outpost. The GitHub
Actions workflow is replaced by an equivalent Forgejo Actions workflow
(.forgejo/workflows/ci.yml): docker runner on a pinned node:24-bookworm
image, pnpm via corepack, checkout from data.forgejo.org — the same shape as
boardgamers-mono. AGENTS.md points at the new remote.
2026-09-10 12:46:58 +00:00
dfc3cf3f6f Show a parked exchange card in the hand, face-down, instead of a banner
Rather than a waiting-banner note, the card you received in an exchange now
appears in your hand as a face-down (unknown-value) card with a dashed gold
border and a title explaining it is parked on the Wily Trader / Merchant
House until the exchange step ends. The wrapper masks the parked card's
value from everyone — owner included — while the step runs, so it genuinely
is unknown; it resolves to a real card when the step closes. The banner note
is gone. Engine 0.10.9.
2026-09-10 00:18:16 +02:00
d2290d2e3a Mask an exchange's received card value until the exchange step ends
The received card is parked face-down on the Wily Trader / Merchant House
for the rest of the discard phase's exchange step (phase 4), so its value is
nobody's business until then. While the step runs, the exchange log entry
shows the offered card but masks the received value as "for a higher one"
for every viewer — participants included; once the step closes (and the card
lands in the giver's hand) the participants see it, others only at game end.
Added a waiting banner note so a trader sees their card is parked, not lost.
Engine 0.10.8.
2026-09-09 23:32:28 +02:00
7f44fe4a46 Buy several factories of a type in one payment, like colonists
Factory buys take a count, the same way population and robots do: one
payment covers count x cost, the cards are spent once, and the overpay is
lost. A lone Mega Titanium 44 buys 4 ore factories (cost 40) in a single
step; New Chemicals needs one research card per factory. The log reads
"builds 4 ore factories (paid 44)". Replaces the earlier one-step-per-copy
splitting, which was wrong — a card can only be spent once. Engine 0.10.7.
2026-09-09 22:21:33 +02:00
be48e4a1e2 Cap the factory multi-buy by how many copies the hand can partition into
A card pays for a single factory (its overpay is lost, not spread), so
floor(handValue / cost) was the wrong cap: a lone Mega Titanium 44 showed
4 ore factories as reachable when it only pays for one. The stepper now caps
at the number of groups the cards partition into, each reaching the cost
(descending-value greedy, matching the confirm split).
2026-09-09 22:15:45 +02:00
405cfb07f6 Buy several factories of a type in one payment, like colonists
The factory payment panel now has the − / +1 stepper colonists and robots
always had, so a big card (e.g. a Mega) can pay for several factories at
once instead of wasting the overpay one factory at a time. The purchase is
split into one engine buy step per copy — the engine's endTurn already
applies repeated factory steps — with the picked cards dealt highest-value
first so each step clears the cost, and indices re-resolved per step against
the shrinking hand. New Chemicals stays one research card per factory.
Viewer-only change.
2026-09-09 22:10:34 +02:00
f6bb598595 Mark the era change once per transition and give it a real delimiter
The era announcement read off entry.era, which is set on every round entry —
so "Era II begins" printed on every round of era II. The round entry now
carries eraBegan only on the round the era actually advances, and the log
text uses that. The feed renders it as a full-width era-colored band (bold,
era II orange / era III purple) instead of a subtle ruled line. Engine 0.10.6.
2026-09-09 21:56:07 +02:00
14b6b8b221 Show the exchanged cards in the log to the participants, to everyone at game end
The exchange move now records the offered card (exchangeGiven: type + value)
alongside the returned card's value. The offered card's value needs no
masking once offered — it never re-enters the giver's hand (it goes to the
target, or bounces back from the parked cards at the same value). Both
values are still hidden from non-participants until the game ends, then
revealed to everyone. The log line reads "P1 trades Ore 5 with P2 for Ore 9"
for the two participants (and post-game), "P1 trades a card with P2 for a
higher one" for the rest. Engine 0.10.5.
2026-09-09 21:16:16 +02:00
0feff7acae Announce the era change in the event log
The era transition was invisible in the log (only the market contents hinted
at it). The round entry's text now opens with "Era II begins — " / "Era III
begins — " on the round the era advances (era I is the opening era, so no
announcement), and the log feed renders it as a ruled delimiter above the
round line instead of plain text. The era is public and unmasked on the round
entry, so spectators and replays get the same delimiter. Engine 0.10.4.
2026-09-09 14:25:13 +02:00
b1a47f3d72 Count Smelter's bonus ore draws in the production range; track staged manning live
productionRange ignored the Smelter kicker — it now adds the extra
floor(manned ore / 2) ore draws to min/max/avg. The other production kickers
(Ice Prospector / Refinery) draw-then-discard-cheapest: same card count, so
the range is unchanged by design.

PlayerPanel: while staging the operator assignment, your own panel shows the
production the STAGED factories would give — the min–max (~avg) line updates
with every toggle instead of only after the turn commits. Engine 0.10.3.
2026-09-07 13:25:13 +00:00
8c5bedbf99 Keep fastBid log text neutral until the auction resolves
While a sealed auction collects bids, its log entries (and the game-server's
last-move summary built from them) leaked information: the opening line
showed the auctioneer their own amount, and auto-passes printed as "X passes
on the auction" the moment they happened. Now opening/bid/pass entries all
read as a neutral sealed-auction line until the resolving move is logged;
the wrapper's reveal then restores full text (amounts, passes, outcome). A
pass that resolves the auction now carries the "wins at N" outcome line too.
Engine 0.10.2.
2026-09-07 08:04:10 +00:00
17fa32eb21 Handle autoPassBids engine-side for sealed auctions; drop the viewer send
The setting now lives entirely in fastAutoPass: a seat whose true hand value
cannot reach the list price is auto-passed (bid 0) the moment the auction
opens, recorded in info.autoPassed and applied verbatim on replay. The viewer
no longer sends anything for it — the previous client-side auto-pass raced
the host's state pushes and produced spurious "not your turn to play"
rejections. Timing may reveal that an auto-passed seat held a weak hand;
accepted (indistinguishable in the log from a public-bound or manual pass).
Engine 0.10.1.
2026-09-06 17:43:23 +00:00
679d513da3 Move auto-pass sealed bid logic from viewer to engine 2026-09-06 17:42:13 +00:00