Skip to content

The 3D line view lays the factory out where its buildings stand - #216

Merged
kalwei merged 4 commits into
mainfrom
feat/satisfactory-positions
Oct 31, 2026
Merged

kalwei merged 4 commits into
mainfrom
feat/satisfactory-positions

Conversation

@kalwei

@kalwei kalwei commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

What

The 3D line view lays a plant out where its machines really stand, when a source has said where that is. The Satisfactory save is the first source.

  • Equipment can hold a position. New nullable columns on equipment: pos_x, pos_y, pos_z (metres) and heading (degrees). Migration c8e2f4a6d1b7, chained on b3d7e2a9c514. masterdata.place_equipment writes them and adds an equipment.placed audit entry only when the position changes. This is general to any plant, not Satisfactory-specific.

  • The Satisfactory reader writes it. Each building's location goes in at first sight and again on change: game centimetres ÷ 100, game y becomes the plan's depth, game z is held as height, and rotation becomes heading. A building with no location holds no position. It is never put at the origin. run-satisfactory --once now also reports how many buildings it placed.

  • The line view uses it. Each station's place comes from the first of these sources that has one:

    1. a line_layout.json entry: x/z, or rot alone, still wins;
    2. the held position, framed on the centre of the line's own buildings rather than the game's origin;
    3. the old even run from routing order.

    When any station holds a position, the scene becomes a floor plan with a 10 m grid. It draws no belts or robots, because the MES doesn't know what runs between two buildings. The height is shown in the label ("+34 m"), not used to place. A machine with no position waits in a row past the plan's edge, labelled "position unknown". A plant with no positions lays out exactly as before.

  • The picker offers the area. When positions are held, a picker inside the 3D view also offers the area: FACTORY — every machine. I put it in the 3D frame, not the line page's picker, because the line page's picker also drives the analysis tab, and that tab has no meaning for an area.

  • Fixture. tests/fixtures/satisfactory/2026-10-30.jsonl.gz was committed without location. I restored it to every building and generator from the raw file. Nothing else in the fixture changed: key order is the same, and gzip mtime is 0.

Why

Scott asked for the 3D view to show his factory where its buildings stand, rather than one straight row.

How verified

  • tests/test_the_line_view_lays_machines_out_where_they_stand.py (13 tests): game (−43794.9, −139688.7, 8236.5, 200°) is held as (−437.9, −1396.9) m, height 82.4, heading 200; a drawn entry beats a held one; a line is framed on its centre; heading turns the right way; a plant with no positions is unchanged; the area view lists every building of the save's unpaused polls, less the retired ones; an unknown name is still NotFound.
  • Full fast suite and pytest -m browser both pass locally.
  • I ran a scratch plant on 127.0.0.1 with the lab's Satisfactory pack, replaying the 2026-10-31 file. The screenshot below is /dashboard/line/3d?line=FACTORY, looked at on loopback only.
    • 33 buildings hold positions, spanning about 240 × 230 m.
    • 21 machines from the committed 2026-10-28 master data are not named in that file, so they wait in the "position unknown" row, off-camera.

FACTORY floor plan

Not done

No map backdrop or game artwork, no per-class 3D models, nothing talks to the game. Those are out of scope. Belts aren't drawn on a plan.

🤖 Generated with Claude Code

kalwei and others added 4 commits October 31, 2026 15:27
… from the game

x, y and z (height) in metres and a heading in degrees, nullable and
deferred like retired_at, with a migration. The reader writes a building's
position on first sight and on change, game centimetres over 100. The
2026-10-30 fixture keeps each building's location now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: scottkalw <scottkalwei@gmail.com>
… area whole

Layout sources in order: a drawn line_layout.json entry, the held
position (framed on the line's centre), the even run from routing order.
A line with held positions is drawn as a floor plan, without belts. An
area whose machines hold positions is offered in the 3D view's picker.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: scottkalw <scottkalwei@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: scottkalw <scottkalwei@gmail.com>
…r on a plan

The camera frames the machines with a place, not the row of those
without; it stands closer; the footer says no belts are drawn. The lab
README shows the FACTORY plan replayed from the 2026-10-31 save.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: scottkalw <scottkalwei@gmail.com>
@github-actions

Copy link
Copy Markdown

Thanks for the first pull request. Checks: every commit signed off (git commit -s), ruff and pytest green, and the house-rules checklist in the template. The maintainer reviews within a few days.

@kalwei
kalwei merged commit 06cb674 into main Oct 31, 2026
28 checks passed
@kalwei
kalwei deleted the feat/satisfactory-positions branch October 31, 2026 21:30
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