Repository navigation
Own backend: units (step 10) - #55
Merged
Merged
Conversation
Step 10 of the way off eudplib: every unit row of the ledger (99 of 99) is a map of our own's. A pass of its own (compiler/backend/units.ts) makes each unit two numbers — the EPD of its record and its place's uniqueness byte, a kept unit checked before use — reads its fields through the current player, writes them with masked Set Deaths, and lowers the verbs and select() as the Python side does. A loop or a pick walks the table oldest first down to the lowest place the game has ever handed out, a cell for the map that each walk moves down: nothing is counted on the way. A turn is the loop's test, the filter in one trigger and the step; small bodies take two places a turn. In the lifted game a walk costs about half of eudplib's, a sum of hit points a third (probes/own-units.ts, the plan's table). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01En4SHqafb1QFJ4xgbUkAe5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01En4SHqafb1QFJ4xgbUkAe5
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 10 of the way off eudplib: units on a map of our own. The ledger's step 10 is 99 of 99 (it was 0); no row of
another step moved. Unit events (
on.*) stay step 11's rows andunderMousestep 12's.compiler/backend/units.tsis a pass before the heap's, astexts.tsandheap.tsare. The emitter itself onlyexports
STATEMENT_KINDS; the eudplib build is untouched.What it does
before use in one trigger of four conditions (EPD, sprite, order not Die, same uniqueness byte), as the Python side's
when_alive.13, then the pointer given back. A read in place would make each bit's condition a place of the unit. Writes are one
masked Set Deaths, stopped at the simulator's tops.
select()mirror the Python side: an order through a4-pixel box, give as eudplib's
cgive, andselect()'s command written into the game's queue.map-wide cell each walk moves down. The game hands never-used places out last, in order (scm-sim
docs/specs/unit-lists.md§3), so nothing is counted per place. eudplib's walk counts units against the game'sin-use count: a trigger and a record read at every place.
Small bodies are unrolled to two places a turn.
nearestpre-tests a box through the current player.Weighed (
probes/own-units.ts, lifted game, Remastered's weights, 193 units; ours / eudplib):Not yet good enough, listed in the plan's Open list:
nearestis about even with eudplib when the box rejects nothing.give()leaves the game's counts stale (both builds).Checked
tests/emitter.test.ts"a map of our own, units": the payload walked over a unit table laid out as the game's,against the simulator. Covers loops with every filter, break and continue (including a continue inside a switch), a
full table of 1700 units, fields and flags, picks, writes, damage and heal, kill, arrays and kept units.
select()and a cutscenewalk.select()rows' first lines, since fixed.To play:
Maps/TrigScript/own-step10-units.scxwith its answer sheet.🤖 Generated with Claude Code
https://claude.ai/code/session_01En4SHqafb1QFJ4xgbUkAe5