Skip to content

Measure runtime rail boxes against occupancy - #267

Open
byalex33 wants to merge 1 commit into
FactoryGameFan:wormeyman-space-age-supportfrom
byalex33:fix-251-rail-runtime-box-analysis
Open

Measure runtime rail boxes against occupancy#267
byalex33 wants to merge 1 commit into
FactoryGameFan:wormeyman-space-age-supportfrom
byalex33:fix-251-rail-runtime-box-analysis

Conversation

@byalex33

Copy link
Copy Markdown
Collaborator

Closes #251. Extends the existing rail-box analyzer to score the captured Factorio 2.0.77 runtime boxes against the committed 38-orientation rail occupancy fixture. Only legacy-curved-rail changes editor footprint (4x4 to 2x3), producing 180 to 220 occupied-but-not-keyed cells while reducing keyed-but-empty cells from 96 to 56, so the runtime boxes are not adopted. Adds coverage and coordinate-alignment controls and records the result in the generated fixture and probe documentation. Checks: vp check --fix; vp test (194 passed); fixture rescore controls passed.

@wormeyman wormeyman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-derived this independently rather than reading it. My own scorer, transcribing getEntitySize and processArea from the editor source, reproduces 180/96 to 220/56 exactly. The baseline matches the today: {missed: 180, empty: 96} already committed in entity-tile-size.json, the delta is entirely legacy-curved-rail across its 8 orientations at plus and minus 5 cells each, the fixture is byte-identical generator output, and nothing under packages/ changed. The verdict also survives all four reference entities, so it does not hinge on wooden-chest.

Two things worth adding before merge.

Name the three rails that are actually masked. "The other 15 differences round to the same footprint or are masked by a declared dimension" folds together two different situations. Twelve genuinely round to the same footprint. Three of them, half-diagonal-rail and its elevated and dummy variants, really do change, and only data.json's declared tile_height: 2 pulls them back. That masking step leans on the tile_width/tile_height read that #142 established is a centring parity rather than a size, so it is worth saying out loud rather than leaving as "masked". (Measured while reviewing: 7 of 155 entities declare one of those fields, not the 3 CLAUDE.md claims. That correction is in #278.)

Add the cheap control. entity-tile-size.json already holds an independently produced today: {missed: 180, empty: 96} against the same fixture and the same reference. Reading it and comparing would fail loudly if sizeFromBox, swapForDirection or keyedCells were transcribed wrong, while the hypothesis under test could still hold. That is the bar the probe README sets for a control, it is about six lines, and it is the only thing that would catch a transcription error in the new sizeFromBox.

Approving, since neither changes a number and the analysis is sound either way.

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.

data.json disagrees with the running game about every rail's collision box, and only about rails

2 participants