Skip to content

Own backend: the game read as a value, locations, players, centre prints (step 5, parts 3–5) - #45

Merged
jeany55 merged 4 commits into
trigscript-4from
game-reads
Oct 20, 2026
Merged

jeany55 merged 4 commits into
trigscript-4from
game-reads

Conversation

@jeany55

@jeany55 jeany55 commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

The rest of step 5 of the way off eudplib (docs/v4-plan.md: "The game read as a value on our own backend", "Locations, players and latches on our own backend"). Follows #44. Step 5 is done but Wait, refused on purpose (in a program it holds only its own trigger and takes the player's wait from Transmissions; a program waits with sleep()).

Part 3: the game read as a value. One player's deaths, kills, ore and gas, and memory() at a known address, are read where the game keeps them: a masked condition a bit, starting at the highest group of 8 bits the value has. Anything else (group sums, Command/Bring counts, score, clocks, opponents) asks the condition a bit at a time, its amount a place of what has been found so far. Race, slot and supply come from the player tables. A read compared with a value is the condition itself (minerals(P1) >= cost is Accumulate at least cost, its amount a place of cost), so there is no read at all.

Part 4. centerLocation is four Set Deaths into MRGN, each amount a place of the side; without a size the sides are read first. A print to P1–P8 or All Players is Display Text with each one the current player in turn, which needs none of the map's settings. rose()/once() use a latch per place in the script.

Part 5: prints at the centre, as eudplib's f_eprintln. "Cannot create more units" is raised with the free-unit pointer read, zeroed and put back; on the target's computer only, the text is written into the error line, which is the template itself.

Ledger

Step Before After
5 154 / 195 197 / 198
7 1 / 22 1 / 24 (hasLeft and a force print moved here: they need the map's slots)

Four rows of steps 6/9 build now and were relabelled step 5: screen library (it was waiting on centerLocation), and two instance scripts that were refused only for TrigScript's warning print to All Players; both agree with the simulator.

Lifted game, ms (ours / eudplib)

Probe Ours eudplib
own-reads: 200 ore reads 0.129 0.219
own-reads: 200 unit counts 0.102 0.418
own-reads: 200 minerals(P1) >= j * 10 0.012 0.248
own-locations: 200 moves 0.036 0.061

Every line of probes/own-reads.ts and probes/own-locations.ts is the same in both builds. The centre print is on line 12 in both, and so are prints to P1/P2/All Players.

For Remastered: probes/own-step5.ts (copied to Maps/TrigScript with an answer sheet): the centre print, Transmissions in a loop, a print to every player, counts after Create Unit, a moved location. Not played yet.

Found (in the plan's Open list): a condition kept in a const is asked where it is used, not where it is written (both builds).

Suite 1258 pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BwPs2Ya2X9rB9TYHijfoom

jeany55 and others added 4 commits October 20, 2026 07:53
What a condition can be asked, read as a number, and the players' race,
slot and supply.

- One player's deaths, kills, ore or gas, and memory() at a known
  address, read where the game keeps them: a masked condition a bit,
  entered at the highest group of eight bits the number has (ore below
  65 536 in 16 bits; eudplib's f_dwread_epd reads 32).
- Anything else asked of the condition a bit at a time from the top,
  its amount a place of what is found so far: one trigger a bit.
- Race and slot as a byte of the player table; supply from its race's
  table, halved as the top bar shows it.

Ledger: step 5 179/195. probes/own-reads.ts: every line the same both
ways; 200 ore reads 0.129 ms vs 0.219, 200 unit counts 0.102 vs 0.418.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BwPs2Ya2X9rB9TYHijfoom
`minerals(P1) >= cost` is Accumulate at least `cost`, the condition's
amount a place of `cost`: no read. `>` / `<` and their turned-around
forms shift the amount by one where the value's range allows.

probes/own-reads.ts: 200 of `minerals(P1) >= j * 10` 0.012 ms vs
eudplib's 0.248.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BwPs2Ya2X9rB9TYHijfoom
- centerLocation: four Set Deaths into MRGN, each amount a place of
  the side, the counts thrown away after; without a size the sides read
  first. Actions with fields from values share a trigger.
- A print to P1–P8 or All Players: Display Text with each the current
  player in turn (no map settings needed); forces wait for step 7.
- rose() / once(): a latch per place in the script.
- hasLeft and force prints moved to step 7; Wait refused on purpose,
  its reason says why.

Ledger: step 5 195/198 (centre prints left). probes/own-locations.ts:
every line ok both ways; 200 moves 0.036 ms vs eudplib's 0.061.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BwPs2Ya2X9rB9TYHijfoom
As eudplib's f_eprintln: with each target the current player, "Cannot
create more units" raised (Create Unit with the first free unit read,
taken away, put back), and on that player's computer alone the text
written into the game's line of errors — the template is the line.

Ledger: step 5 197/198; Wait refused on purpose. probes/own-step5.ts
for Remastered (centre print, Transmissions in a loop, a print to
every player, counts after Create Unit, a moved location).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BwPs2Ya2X9rB9TYHijfoom
@jeany55
jeany55 merged commit 70a910b into trigscript-4 Oct 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant