Skip to content

Add extensible machine statistics and generator side configuration - #95

Merged
dshadowwolf merged 3 commits into
master-2.0-1.21.1-neofrom
codex/stats-drawer
Nov 7, 2026
Merged

dshadowwolf merged 3 commits into
master-2.0-1.21.1-neofrom
codex/stats-drawer

Conversation

@faceofcat

@faceofcat faceofcat commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

Machine screens gain a Statistics drawer below Info, supplied by a public StatsProvider contract implemented by individual machine parts.

  • Show measured RF input/output, configured maximum transfer rates, and processor energy use. Usage rows appear only when processors declare demand for that buffer; maximum use sums the current recipe demands sharing it.
  • Show each processor's name, measured cycles, and current-recipe maximum cycles (or “No recipe”). Item and fluid storage contribute no rows.
  • Cycle tick/second/minute in a compact header control. RF stays integer-valued, cycles keep two decimals, and numbers use comma grouping. Configured transfer maxima scale using one transfer per tick; the underlying per-call limits are unchanged.
  • Give Creative Power only side configuration, Info and Statistics panels, without player inventory, equipment or addon/filter slots. Disabled faces block both automatic output and external extraction, and settings persist.
  • Store companion machine facing at placement and use it consistently for neighbor icons, resource side controls and redstone. Previously placed blocks retain north because their original placement direction was not recorded.
  • Document provider registration and cover counters, rollback, resource attribution, timescales, side settings and placement orientation.

Review follow-up for the review comment:

  • Transfer-charge reservations and refunds bypass external input/output and processor-use counters, including delayed refunds after reload.
  • Host-suspended processors publish a saved and synchronized HELD status while preserving progress and reservations. Manual pause retains priority; the Info drawer shows the specific redstone/reserve warning.
  • Unattributed recoveries drop at the block before player interactions and during background transfers. Only recoveries generated by the current interaction return to that player.
  • Inventory-toolbar expansion moves main-panel content without shifting edge tabs or their children.
  • Automation action acknowledgements advance the last-sent markers, preventing a duplicate full snapshot next tick.
  • Viewers of the same machine share the statistics sampler and counter history; weak cache entries do not retain machines.
  • Remove empty item/fluid statistics providers and replace automation slot-count literals with the shared constants.

The previously accepted Curios discovery tradeoff remains unchanged.

Validation:

  • check build runCompanionClientSmoke passed: 150 unit tests, 69 library and 42 companion server GameTests, packaging/import/asset checks, and all five companion menus.
  • Regression coverage includes transfer escrow accounting, held-state save/sync/resume, recovery attribution, edge-tab placement, acknowledgement markers, and shared statistics sampling.
  • This full local UI run completed before the new focused-UI-testing policy was requested. Future local UI checks are limited to the affected areas; CI provides broader coverage.

@dshadowwolf

Copy link
Copy Markdown
Collaborator

Okay, I'm not feeling well, so I gave Claude the lead on this review:

Should be fixed before merging

  1. The energy statistics count transfer charges as real use. Automation transfers reserve energy up front and refund the unused part. Both go through the same buffer calls the new counters watch, so a pusher that finds nothing to move logs 640 RF used and 640 RF received, every attempt. On a machine with a few addons, the stats would be mostly noise. Since the stats are this PR's main feature, I'd fix this first. The reservation and refund should bypass the counters, or transfers should get their own counter.
  2. A machine held by redstone or the energy reserve keeps showing its last status. suspended() doesn't change the status, mark it for syncing, or mark it for saving. A lane stopped mid-cycle keeps showing "running" with frozen progress for as long as the hold lasts. Players will report that as "the machine says it's running but nothing happens", the same kind of confusion the info drawer was meant to prevent. It should show something like "held by redstone" or "waiting for energy".
  3. Recovered items go to whichever player next clicks in the screen. The recovery list is shared by the whole machine. Items queued during a chunk load, a background revalidation or another player's action are all handed to the next player who finishes any click in the screen, possibly days later. On a multiplayer server, that's giving one player's items to another. Recoveries with no specific player should drop at the block.

Worth fixing

  1. The inventory-toolbar shift can move edge tabs. Everything at or below the inventory's top edge moves down, including side tabs low enough to start there. The tab stack then has a gap and can run off the panel. It's the same kind of bug as the tab fix in Add per-face redstone drawer and machine reservation overlays #94: shift only the inventory and what's under it.
  2. Every automation action sends its full state packet twice. The action sends its own snapshot, but the "last sent" markers aren't updated, so the next tick sends it again. That's up to 256 groups' worth of data, twice per click.
  3. Statistics are computed separately for each player viewing a machine, even with the stats drawer closed. Sampling once per machine, or only while the drawer is open, would fix it.
  4. Item and fluid storage implement the stats interface but only return empty results. The sampler still processes them. Leave the interface off until they have something to report.

Repeats from earlier reviews (already known, not new in this PR)

My overall take: 1 and 2 make the new feature show wrong information, and 3 is the one with real gameplay consequences on a server. I'd ask for those three before merging. 4 and 5 are quick fixes, and 6 and 7 can wait.

Base automatically changed from codex/redstone-control-drawer to master-2.0-1.21.1-neo November 7, 2026 09:15
@faceofcat
faceofcat requested a review from dshadowwolf November 7, 2026 10:03
@dshadowwolf
dshadowwolf merged commit ff9e6c4 into master-2.0-1.21.1-neo Nov 7, 2026
5 checks passed
@faceofcat
faceofcat deleted the codex/stats-drawer branch November 7, 2026 13:35
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.

2 participants