A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.
Decision videos: implementation plan
Date: 2026-10-13. Branch ui/decision-card-centred from origin/main 8cc4776, worktree .worktrees/decision-videos.
Design of record: reports/Video at decision moments.md (its recommendation, the "Full plan", chosen by the owner on
2026-10-13). Inputs: the repo audit (video-integration-proposal.md, session scratchpad) and
research_notes/Video at decision moments/unity_webgl_video.md.
Owner rulings this plan implements (2026-10-13)
- Centred, large decision card, up to about 1040 px, with a 16:9 media header.
- The archival photograph comes first. An "Illustration" switch shows a silent 4–8 s AI loop, labelled "AI-generated illustration", on about 12 events.
- Phase 2: a 3–4 s skippable outcome clip, for the historical option only, played at End Turn.
- Deport never gets any video.
- The Ben-Gurion recording on the start screen is a separate PR (PR 4 below). The ISA file has arrived.
- AI clip rights: "no need to check, just use them". This goes in
docs/oss/DECISIONS.md(PR 1).
Constraints, checked against the code
- The sim never sees video. The mapping lives in
unity/Assets/UI/EventVideos/event-videos.yaml, which only Unity reads. The clips live inunity/Assets/StreamingAssets/video/. Nothing goes undercontent/. The goldens must not move: 195071e9904d, 195262f8ec61, smoked3fdd459. - The smoke run doesn't depend on layout. It presses
event-options' firstButtonwith aNavigationSubmitEvent(GameRoot.cs:376-381). It doesn't depend on where the card is or which buttons sit in the header, as long as the options stay inside#event-optionsand stay first in it. - Automated runs skip the start screen through
StartScreenPresenter.Skipped, which reads smoke,golden,shot,vprofile,profile,units,borderproofandnostart. Video-off uses the same automated flags but notnostart, because that one is manual. - #409
ScreenNav.DisableCovereddisables the panels that a root class hides (top-bar,right-column,info-panel). Today the card sits insideright-column(Game.uxml:80-110,Statecraft.uss:166, 480 px wide). - The card's photographs are 9:4 crops at 720×320 (
tools/event_images.pyASPECT,WIDTH; 24 rows inevent-images.yaml). A 16:9 header needs new crops from the originals, at up to 960×540. - The Hebrew UI is not loaded by the game (
strings.he.yamlheader; #193). Event text is English content. - #401 (HUD PR A) edits
Game.uxml(UiFramefiligreelines, including the event card's at line 99, and the info panel) andStatecraft.uss(the info panel). This plan doesn't change any info-panel or gilt-trim rule. The only overlap is the event card's UiFrame line, which moves with the card: whichever PR merges second takes the other's one-line change. - WebGL video must come from a URL in StreamingAssets, with one VideoPlayer, a RenderTexture and
Background.FromRenderTexture, all unverified in this project until the spike.com.unity.modules.videois already inmanifest.json.
Decisions taken in this plan (rank 10, with the devil's advocate)
| # | Decision | Devil's advocate | Why it stands |
|---|---|---|---|
| A | The card leaves right-column for a new full-height layer, event-layer, under the bar. The minimap keeps the column. |
Moving the element conflicts with #401's one-line UiFrame change. | Centring a child of a 480 px right-hand column needs negative offsets that depend on the window size. A sibling layer is the plain way to do it, and the conflict is one line. |
| B | While a screen (Cabinet, Budget, Defence, Why) is open, the card is hidden and disabled. It comes back when the screen closes. | Today a player can read the Cabinet beside an open event. | A centred card and a centre screen overlap at every window size. This is #210's existing two-row rule, extended to every tier, and it goes in DisableCovered, so nothing re-enables a covered panel. |
| C | Video is opt-in per card: the photograph shows first, and the switch starts the loop. There is no autoplay, so there is no separate pause button and no reduced-motion jslib. | WCAG 2.2.2 asks for pause, stop or hide on motion longer than 5 s. | 2.2.2 covers content that starts automatically. Here the player's own switch starts the loop and the same switch stops it. |
| D | The mapping is a YAML TextAsset that GameRoot takes as a serialized field, the same way it takes strings.en.yaml, parsed at start by EventVideoMapping with YamlDotNet. There is no editor importer and no ScriptableObject. |
The photos use an importer and a ScriptableObject (EventImageImport). |
The photos need the importer to reference textures. Clips are URLs, so they don't, and the importer would be an abstraction nobody asked for. An EditMode test checks the rows instead: each event exists, each file exists, and no row names a Deport option. |
| E | Encoding is pinned in tools/encode_event_videos.py: H.264 High, yuv420p, 960×540, 24 fps, CRF 28, -g 48, -an, +faststart. It refuses any output that has an audio stream. |
720p is sharper. | The header is about 960 px wide at most at the 1080p reference. 540p is about 40% smaller (audit §4.3). |
| F | Video is forced off by EventVideo.ForcedOff(url, args, webgl): smoke > 0, golden, shot, vprofile, profile, units, borderproof. When it is off, the switch is not shown at all, so captures and ?smoke see the same card as PR 1. |
The switch could be shown greyed out instead. | Not shown is the deterministic choice: no element to focus, nothing to measure. |
| G | The fallback: if a clip is missing, fails (errorReceived) or isn't prepared within 8 s, the header goes back to the photograph and the switch hides for that event. |
It could retry. | A silent retry hides errors. The photograph is the source of truth. |
Questions for you before code (each ranked below 10, so I won't act on them alone)
Modal or not (9/10). At 1920×1080 a 1040 px card with a full 16:9 header reaches from the bar nearly to the bottom of the window, and it overlaps the info panel (x 440–1480 against x 16–536). I propose:
- while the card is open, a dim scrim under the bar blocks map clicks, and the info panel and the right-hand column
are disabled through
DisableCovered; - a "Hide" button on the card collapses it to a small "Decision waiting" button at the top right under the bar, which reopens it;
- the card reopens by itself when the shown event changes.
Without the collapse, a player couldn't look at the map or inspect a hex while any decision is pending, and that is a regression. The alternative is no scrim, and the card overlapping the map and the info panel.
- while the card is open, a dim scrim under the bar blocks map clicks, and the info panel and the right-hand column
are disabled through
The illustration switch persists for the session (8/10). I propose that once the player picks Illustration, the following cards open on their clip (when they have one) until the player switches back. It isn't saved, and every launch starts on the photograph. The alternative resets to the photograph on every card.
A burned-in bug on the clips (8/10). The report's table asks for a small burned-in bug as well as the UI label, because StreamingAssets files can be downloaded and passed around. This machine's ffmpeg has no
drawtextand Pillow has no raqm. So I'd render "AI-generated · נוצר בבינה מלאכותית" once, as a transparent PNG, in headless Chrome (proper bidi, Frank Ruhl Libre and EB Garamond, both OFL), commit it with an ASSETS row, and overlay it with ffmpeg. The alternatives are English only, or no bug.ASSETS status for the clips (9/10). You said "status per the repo's convention, citing that ruling". The convention has two statuses:
owner-verify(waiting for the owner) andverified(the owner signed off). Since the ruling is the owner's sign-off, I'd useverified, with the note "Owner ruling 2026-10-13 (DECISIONS.md D-V): terms not checked". That stops the clips blocking--release. Consequence: the Dreamina clips (A07, A09) would pass the release gate for a paid build.owner-verifywould keep them blocking. Which one?Sensitive events (9/10).
ten_days(J09) andoperation_yoav(W04a) arewar-casualties. The audit recommended a per-clip sensitivity review. I proposesensitive: true, sensitivity_reviewed: falserows that a-shareablebuild refuses, mirroring the photo gate inBuild.cs, and they show normally in dev builds. The alternative is to leave those two out until you review them.The contact sheet tiers and Hebrew (9/10).
- The WebGL player is the Mobile tier, and its captures come from headed Chrome.
- Editor renders show no UI (
MapCapture.Promo), and a macOS player can't be driven by CDP. So the PC tier would be an uncommitted editor capture that renders the MapCapture scene at quality level 1 and composites the UI document throughPanelSettings.targetTexture. It is deleted after use. - "HE" can only mean the card rendered with
strings.he.yaml, so that just the new labels are Hebrew. The full RTL card waits for #193.
Is that what you want?
The photographs grow (9/10). New 16:9 crops at up to 960×540 cost about 4× the pixels of 720×320 in
.data, and their GPU memory goes from about 2.9 MB to about 6.5 MB (DXT1 crunched). I'll measure the.data.brchange in PR 1 and report it. A 16:9 crop shows more of each picture than the 9:4 one, so the five sensitivity-reviewed photographs (altalena, ten_days, operation_yoav, operation_hiram, bernadotte_assassination) are flagged on the contact sheet for a look.
Answers (coordinator, 2026-10-13; plan approved)
- Modal: yes. A dim backdrop blocks map clicks, and the info panel and the minimap are disabled while the card is open. Hide collapses the card to "Decision waiting" (EN and HE), which reopens it, and a new event reopens it by itself. Hide and reopen go in the focus tests.
- The Illustration switch is remembered for the session, and is not saved.
- Burned-in bug: yes, the bilingual PNG from headless Chrome, overlaid with ffmpeg. It is small, in a corner, inside the safe area.
- Clip rows:
verified, citing D-V. D-V says that it covers commercial and paid builds and that the owner accepts the Dreamina restriction. - J09 and W04a: sensitive and not reviewed, so the gate refuses them until the owner reviews them.
- Contact sheet as planned, with the HE limitation (#193) labelled on the sheet.
- Bigger photographs: fine. Report the
.datachange, and flag the sensitivity-reviewed photographs whose new crop shows more. - The WAV goes through Unity's AudioClip import with no processing (no normalising, no force to mono). The ISA licence allows technical format changes. The sha256 test on the source WAV stays.
PR 1: the centred card, photographs only, plus the DECISIONS ruling
Branch ui/decision-card-centred. The issue to claim: open "Decision cards: centred, large, 16:9 media header (video
phase 0)" (Refs #106, #41) and comment the branch on it.
Files
unity/Assets/UI/Game.uxml:- move
event-cardout ofright-columninto a newevent-layer(afterinfo-panel, before the screens), with the card's existing inner block unchanged, except thatevent-photobecomesevent-media(16:9); - add the
event-hidebutton and theevent-reopenbutton (question 1).
- move
unity/Assets/UI/Statecraft.uss:.event-layer: absolute; left, right and bottom 16;topper HUD tier (112, 140, 232, 328, the same asright-column);.event-card:width: 1040px; max-width: 100%, centred,max-height: 100%;.event-media: a 16:9 height, set by the presenter from the card's width, since USS has no aspect-ratio property. It is still the first to shrink on short windows, as now;- the tier,
screen-openandstart-openrules for the layer; .event-open .toastat the top centre over the media header.
No rule for
.info-panel,UiFrameor the gilt trim is changed.EventCardPresenter.cs:- the media header's height (width × 9/16, capped by the room left);
- the collapse and reopen;
- card focus when a new event opens (the card itself, not an option, so no choice looks recommended; Tab reaches the options);
RoomForDroppedPhotoreads the layer instead ofright-gap.
The drop and restore logic (
MinPhotoHeight, the CC BY credit never cut) stays as it is.ScreenNav.cs(DisableCovered):event-layeris disabled understart-openandscreen-open. While the card is open (event-open),right-columnandinfo-panelare disabled.HudPresenter.cs: nothing, because the tier classes already exist.tools/event_images.py:ASPECT = 16/9,WIDTH = 960, andMAX_BYTESre-checked.event-images.yaml: thecropvalues reviewed for 16:9 and the comment updated.The 24 JPGs remade from the originals, fetched into an empty folder outside the repo with a project User-Agent, no owner identifiers, and their SHA-1 checked by the tool.
EventImageImport.MaxEdgestays 1024.ASSETS.yaml: the crop text in each photo row's note (licences unchanged).docs/event-images.md.EventImageCatalog.cs: the memory comment.strings.en.yamlandstrings.he.yaml:event.hide,event.reopen.docs/oss/DECISIONS.md, a new ticked line (moved to its own docs PR, #449, after review):- D-V AI video clips in the game: Veo 3.1 (through ElevenLabs) and Seedance 2.0 (through Dreamina). Decided (owner, 2026-10-13): "no need to check, just use them". D-D found that Dreamina's terms restrict commercial use, and D5 covered images only; the owner accepts this.
CHANGELOG.md, Unreleased.
Tests (EditMode, written first)
UiLayoutTests, extending the existing tests, plusDecisionCardLayoutTests. At everyPromoHudTestsshape (1920×1080, 1280×720, 1366×768, 1760×1000, 1920×1200, 1440×900, 1024×768, 1280×1024, 1024×1024, 960×1080, 800×1000), plus 390×844, 960×600 and 2560×1080, for every real event:- the card is centred (|left gap − right gap| ≤ 1 px), at most 1040 logical px wide, inside the layer, and below the bar at every tier, the narrow two-row and three-row tiers included;
- the media header is 16:9 within 1 px when the window has room, and the photograph is shown whole with its credit or dropped, never cut (the current rules, re-pointed);
- the options are inside the card and their text fits;
- no window shape at least as tall as 1366×657 scrolls the body.
- Focus and #409:
- with the card open,
info-panelandright-columnbuttons are disabled and Tab can't reach them; - collapsing the card enables them again;
- with a screen open (every tier), the card is hidden and disabled, and closing the screen restores it;
- under the start screen the layer is disabled;
- a new event puts the focus on the card (no option lit), and an event that is already open does not steal the focus from the top bar.
- with the card open,
- Collapse: Hide, then reopen; a new shown event reopens the card.
- The existing tests still pass:
EventCardTests,TheTwoRowHudKeepsWhatAScreenCoversOutOfReach,AWideScreenHidesTheInfoPanelItCovers,PromoHudTests.TheToastIsOpaqueAndClearOfTheScreens(updated for the toast over the card), andSimSmokeTests. tools/tests/test_event_images.py: the 16:9 box, and the size cap.
Verification
dotnet test sim/Statecraft.sln, the tools pytest,scripts/osspytest andcheck_repo.py.- The full EditMode suite under
machine_lock --shared --wait-unity, with 0warning CS. - A WebGL build, then
web_check.py --query "golden&smoke=5"with the three values. - The
.data.brand.wasm.brsizes against main, built on the same machine. headed.py boot --cpu 4 --runs 5against main: the map build doesn't change, and the first frame is reported.- Then revert the
ProjectSettings,Assets/SettingsandUNITY_MCPchurn. - Contact sheet to you before the push:
- EN and HE label sets;
- Mobile (WebGL, headed Chrome) and PC (editor composite);
- 1920×1080, 1440×900, 1024×1024 (two-row), 390×844 (three-row), and 2560×1080;
- a photograph event, a portrait-only event, and a long event;
- the collapse state;
- the 24 new 16:9 crops on a separate sheet, the sensitive ones marked.
PR 2: the WebGL spike, then the clips and the Illustration switch
Branch ui/decision-card-video, from main after PR 1 merges, or stacked on it if you say so.
Step 1, the spike (measure before building the rest). One clip (L14), a minimal CardVideo, and one event.
.wasm.br,.data.brandframework.jssizes against PR 1's build. Is the video module stripped today? The spike shows that.headed.py boot --cpu 4 --runs 5, interleaved with the PR 1 build: map-build median and range, first frame. The #321 margin is about 100 ms over 2620 ms against the 2720 ms budget, and a regression beyond noise is a stop. No clip is requested before the map is built: the player is created lazily, on the first switch press.- Playback in headed Chrome (ANGLE Metal):
- after pressing the switch, two screenshots 1 s apart differ inside the header, and nowhere else;
- the console has no errors;
Background.FromRenderTextureupdates withoutMarkDirtyRepaint(if it doesn't, repaint onframeReady);- a renamed clip falls back to the photograph within 8 s;
- a frame-time sample with the loop running and with it off (
?vprofileisn't usable here, so CDPPerformance.getMetrics).
- Firefox and Safari aren't on this machine's automation path. I'll note them as untested unless you want a manual check.
The numbers go to you; then step 2.
Step 2, files
unity/Assets/UI/EventVideos/event-videos.yaml. One row per event:event,file,source(the promo shot and its sha256),generator,generated(date),alt,sensitive,sensitivity_reviewed.unity/Assets/StreamingAssets/video/<clip>.mp4, 12 clips:Event Shot Source latrun_proposal L14 demo2 v2, Veo 3.1 first_truce K03a demo3, Veo 3.1 jerusalem_ceasefire K03b demo3, Veo 3.1 operation_yoav W04a demo3, Veo 3.1; sensitive maabarot_policy W05a demo3, Veo 3.1 frumkin_commission W05b demo3, Veo 3.1 law_of_return K04a demo3, Veo 3.1 hula_drainage W06 demo3, Veo 3.1 austerity_1949 A09 demo2 v1, Seedance 2.0 / Dreamina; audio stripped iraqi_exodus A07 demo2 v1, Seedance 2.0 / Dreamina; audio stripped ten_days J09 demo2 v2, Veo 3.1; sensitive jerusalem_military_government JQ18 demo2 v2, Veo 3.1; generic alt, because it shows May - Not used: H01, A27 (Altalena), any demo 1 file, any finished cut, any audio.
- Each source is copied out of
promo/(read-only) and encoded by the script. Every clip gets a frame contact sheet checked for recognisable faces before it is committed. - About 8–9 MB in all (audit §4.3).
tools/encode_event_videos.py:- pinned arguments;
- an
ffprobecheck of each output: H.264, 960×540, no audio stream,moovbeforemdat; - an optional bug overlay (question 3).
EventVideoMapping.cs(parse andProblems), andEventVideo.cs(ForcedOff, URL).CardVideo.cs: one lazyVideoPlayer(URL source, RenderTexture target,audioOutputMode None, looping), one reused 960×540 RenderTexture released when the card closes or collapses, anderrorReceivedand the timeout leading to the fallback.EventCardPresenter.cs: the Photograph | Illustration switch in the header's corner, and the "AI-generated illustration" strip in place of the credit while the clip shows. Focus order: options, then Hide, then the switch.GameRoot.cs: the serialized TextAsset, andForcedOffpassed in.Build.cs:-shareablerefuses sensitive unreviewed clip rows (question 5).strings.{en,he}.yaml:event.photo,event.illustration,event.ai_label.ASSETS.yaml: one row per clip, withai_generated: true, the generator, the generation date, the source shot and its sha256, the encode recipe, and the status per question 4, citing D-V. Plus a row for the bug PNG if question 3 goes ahead.docs/ai-disclosure.mdregenerated, the README "AI use" line,docs/event-videos.md,CHANGELOG.md.
Tests (EditMode)
- Mapping:
- every row's event exists in
content/and its file exists in StreamingAssets; - no duplicate events;
- no row names an event with an option whose id is
deport(the Deport guard, ahead of GDD Phase 6); ai_generatedis required.
- every row's event exists in
ForcedOffis true for each automated flag (WebGL URL and desktop args) and false for none ornostart. With video forced off, the switch isn't in the tree and the card matches PR 1's.- The switch appears only for events with a clip. Pressing it shows the label and hides the credit. Pressing it again restores the photograph and the credit.
- Fallback: a missing file, or a simulated
errorReceived, puts the photograph back, hides the switch for that event and logs once. - Focus order: options, then Hide, then the switch.
- Content hash and goldens:
SimSmokeTestsand the WebGLgolden&smoke=5are unchanged, and a test asserts thatevent-videos.yamlisn't underPaths.Content. - Layout: every PR 1 layout test, with the switch present.
Verification: as in PR 1, plus the spike numbers repeated on the final build, and an itch-style relative-path check
(web_check serves the build from a subdirectory). Then a contact sheet and the measurements to you before the push:
- the 12 clips' mid frames;
- the switch states, in EN and HE;
- the fallback;
- Mobile and PC.
PR 3 (later, after your review of PR 2): outcome clips at End Turn
Only for the historical option (historical: true) of a mapped event, and only when that option was the one queued.
Played at End Turn as "this turn's orders": 3–4 s, skippable by click, Esc, Enter or Space, with video forced off in
automated runs. Deport never gets a clip, and the mapping test refuses it. Candidates from the audit:
| Event | Option | Shot |
|---|---|---|
| first_truce | accept | A02 |
| operation_horev | launch | A05 |
| maabarot_policy | maabarot | A08 |
| hula_drainage | continue_works | W08 |
There is no A27. The detailed plan comes after PR 2.
PR 4 (separate, start screen): Ben-Gurion's Declaration recording
The input is promo/demo2/audio/archival/BG-1948-ORIGINAL_isa-00113hj.wav:
- 9.29 s, sha256
2b949e12f1d33d6f…; - Israel State Archives item 00113hj (טס-169/21), rights field «גנזך המדינה»;
- provenance and the licence quotes are in the session scratchpad,
bg-audio/isa/*.info.json.
Branch ui/start-screen-declaration-audio, which plays independently of the video PRs. I'll plan it in full when it
starts. The outline:
- The file is not altered. No trim, fade, denoise or loudness change.
- Copy it byte for byte to
unity/Assets/Audio/declaration-1948-isa-00113hj.wav. - Superseded (review of #465): that WAV was itself an ffmpeg decode, so "byte for byte" could not be claimed. What
ships is a stream-copy cut of the archive's upload, decoded to PCM WAV with no other processing, fetched from
StreamingAssets; the chain is in
docs/declaration-recording.md. - Import it as an AudioClip with PCM compression, so Unity doesn't transcode it. The cost of PCM is about 9.29 s × rate × channels × 2 bytes; I'll measure it.
- Check: the imported clip's sample count and rate match the WAV.
- I'll ask you whether Unity's container conversion counts as "alteration". If it does, the fallback is the raw file
in StreamingAssets played through a jslib
<audio>element.
- Copy it byte for byte to
- It plays only after a user gesture. On the start screen, a "Play the recording" button (a click, Enter or a tap)
starts it. It never autoplays and never plays on Continue or New Game by surprise. The button switches to "Stop".
ForcedOff(PR 2) applies: automated runs skip the start screen anyway. It is muted under the existing skip flags. - EN and HE captions in UI Toolkit:
- Hebrew in Frank Ruhl Libre through the advanced text generator,
language-direction="RTL", asstart-healready does; - English is the official translation, the same text as the panel;
- the cue times come from listening, and live in a small Unity-side
declaration-captions.yaml; StartScreenTestsrenders both and checks the RTL order.
- Hebrew in Frank Ruhl Libre through the advanced text generator,
- The credit line on screen: "Recording: Israel State Archives", beside the existing "Painting: AI-generated." It plays over the still painting only, never with H01 or any moving image.
- Provenance:
- an
ASSETS.yamlrow with the licence "Israel State Archives terms of use". That value isn't inscripts/oss/oss_policy.pyALLOWED_LICENCES, so the PR adds it, as its own reviewed line; - status
owner-verify; - the note records the recordist's 1980s claim (ע"א 474/86): moot in Israel since 1998, US status uncertain;
NOTICEcarries the credit.
- an
- Tests:
- the button is the only thing that starts playback;
- the credit is present;
- the caption text matches
docs/sources/declaration-1948; - the sha256 of the shipped WAV equals the source's (the no-alteration guard);
- the goldens and smoke stay unchanged.
- Audio-module check: this is the game's first
AudioSource. I'll measure the.wasmchange and boot at--cpu 4, as in the PR 2 spike.
Machine and repo rules
- Every Unity run goes through
uv run tools/machine_lock.py --shared|--exclusive --wait-unity --timeout 3000, without-nographics, and with-CI false -GITHUB_ACTIONS false -TF_BUILD false. Afterwards I revertProjectSettings,Assets/Settingsand theUNITY_MCPdefines. - No AppleScript,
pkillorkillall, and any stop is by PID only. promo/is read only, andpromo/demo/is never touched.- One PR per phase. I claim the issue and never merge.
- No owner email or identifiers in any web request: the Commons original downloads use the project User-Agent only.