Repository navigation
Own backend: the game's conditions and actions (step 5, parts 1 and 2) - #44
Merged
Merged
Conversation
Every condition and action whose fields are known when the map is built is laid out as the game's own record (Cond.game, Act.record); its text and sound file go among the map's strings, the script's clips into the archive. memory() and setMemory() at a known address come with it. - `!` of a condition is one condition where one says the opposite (at least n / at most n - 1, set / cleared); else a skip past. - `&&` whose parts fit in one trigger is one trigger, not a branch each. - An `if` of game actions and self-only writes under such conditions is one trigger: no branch, no put-back. - Bring counted again after an action that makes or moves units. - A `?:` of two booleans is taken (the last step-0 refusal). Ledger: step 0 158/158, step 5 118/195. probes/own-game.ts: every line ok both ways; 200 turns of conditions and actions 0.020 ms vs eudplib's 0.028, 200 of `!exactly` 0.021 vs 0.038. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BwPs2Ya2X9rB9TYHijfoom
An action's field from a value is a place of its variable, kept by its writes, so the action reads it where it is (eudplib copies it in before every run). Type, kind and count share a dword: the place's constant is what is not the value. - A unit count: 255 at a time while more are left, then the rest, each half only where the range reaches it; 0 or below none. - A made text fills a template of its own; the action's text names it. - The game's count table thrown away after making or moving units, by Kill Unit of P12's type 228, in a program that asks Command or Bring: `command()` after Create Unit read the old count in both builds. - A Transmission is first in a trigger of its own; the next trigger puts its started mark and the trigger's current action back, so each one in a loop shows (eudplib's: every other). - max(n, 0) around an amount dropped where the ranges know it. Ledger: step 5 154/195. probes/own-fields.ts: every line ok ours; 200 Set Deaths of a counter 0.014 ms vs eudplib's 0.021. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BwPs2Ya2X9rB9TYHijfoom
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Step 5 of the way off eudplib, parts 1 and 2 (
docs/v4-plan.md: "The game's conditions and actions on our own backend", "Fields from values on our own backend").Part 1. Every game condition and action whose fields are known when the map is built is laid out as the game's own record; its text and sound file go among the map's strings, the script's clips into the archive.
memory()/setMemory()at a known address come with it.!of a condition is one condition where one says the opposite. Two general wins: an&&whose parts fit in one trigger is one trigger, and anifof game actions and self-only writes is one trigger with no branch (numbers probes 2–8% faster too). A?:of two booleans is taken (the last step-0 refusal).Part 2. A field from a value is a place of its variable, kept by its writes: the action costs nothing more when it runs (eudplib copies the value in every time). Unit counts past 255, made texts (Transmission, objectives, leaderboard labels) through templates.
Better than eudplib, found on the way (played in the lifted game):
command()after Create Unit read the old count in both builds (the game's count table; Python'sforget_countscovers Bring only). Ours throws the table away with Kill Unit of P12's type 228 in the same trigger.Ledger
Only step-5 rows changed, besides the step-0 row.
Lifted game, ms (ours / eudplib)
ifof 3 conditions →n++, 2 actions!exactlyEvery line of
probes/own-game.tsandprobes/own-fields.tsis ok in ours; every earlierprobes/own-*.tsrebuilt and played again, all ok. Suite 1254 pass.Left in step 5 (41): the game read as a value (19),
centerLocation(6), texts to other players / at the centre (6), the players' facts and supply (7), Wait,rose,once.Open (in the plan):
const both = command(…) && bring(…)is a false compile error; a second Transmission during the first one's time is still held (needs the players' wait timers);command()right after a kill still counts the units until the next frame.🤖 Generated with Claude Code
https://claude.ai/code/session_01BwPs2Ya2X9rB9TYHijfoom