Detected HW cores: ?. Max capped at 6 — we won't overload the target machine, even if it has more.
State transfer between machines
Export encodes the current layout as a base64 string. Import overwrites the layout.
Dangerous actions
Removes all components and resets the grid to the default 3 × 4 size.
About
Planning tool for the body / inventory grid in
IDLE_DIRECTIVE
(demo available now, full release 29 July 2026) — built as a
tribute and a thank-you to the game's author
kevinfu510.
Try the demo on
Steam or
itch.io.
Body Optimizer — Help
This is a planning tool for the body / inventory grid in IDLE_DIRECTIVE — currently available as a demo on Steam and itch.io; the full release is scheduled for 29 July 2026. Place every component you own onto a virtual grid, let the optimizer arrange them so every Spinner is powered, every Repeater has a target, and as much open space as possible stays accessible for future upgrades.
This script was built as a tribute and a thank-you to the demo's author, kevinfu510. If this helped your run, please wishlist the full release on Steam or play the demo on itch.io.
Top buttons
▣ EXPAND BODY SPACE
Grow the grid by +2 rows and +2 cols, up to the in-game maximum 19 × 12. Disabled once the grid is at max.
⚡ RE-OPTIMIZE LAYOUT
Greedy single-pass arrangement. Throws away current positions and re-places each component in a fixed priority order. Deterministic, fast (1–2 s), but only finds a local optimum. Use this to tidy up a messy grid; use SMART for a thorough search.
⚡³ SMART (Simulated Annealing)
Simulated Annealing across N worker threads (set in Settings). Each worker starts from your current layout (if structurally sane) or a multi-strategy greedy seed, then explores neighbouring layouts. Best valid layouts stream into the Top-20 panel with auto-follow on by default. Runs indefinitely until you click STOP. Pressing the button again terminates the existing run and starts a fresh batch. Runtime varies wildly: small layouts settle in seconds, mid-size (~25–35 components) in minutes, dense or near-optimum layouts may run for hours without a visible improvement. Tip: if SA seems stuck, try EXPAND BODY SPACE — a little extra free space often unlocks much better arrangements.
■ STOP
Terminate every running Simulated Annealing worker immediately. Add, remove, expand, drop, and delete actions also auto-stop any in-flight calculation, so you don't have to click STOP first when editing the layout.
Left panel
COMPONENTS
Library of every component definition (loaded from components.json). Click the + button to add one to the grid. The counter shows how many of each are already placed.
PLACED
List of currently placed components, sorted by id. Each row shows the component icon, name, position, power/working state. Click a row to highlight it on the grid.
Top-20 results panel
Appears as soon as SA reports a valid layout. Each slot shows worker number, age, and score. The TOP button toggles auto-follow — when on, the grid snaps to the best result as soon as it arrives.
Grid interaction
Click a placed component
Picks it up into carry mode. Wires drop and will recompute on placement.
Move mouse while carrying
The ghost follows the cursor pixel-by-pixel inside ±5 SVG units of a cell centre, and snap-aligns to the cell outside that zone.
R
Rotate the carried component to the next geometrically distinct orientation. Square components with directional ports (e.g. battery_2x2) get four rotations; symmetric components get fewer.
Click on grid while carrying
Drop at the current cell. Bounds + collisions are validated; wires recompute. Invalid drop → status bar warns, you keep carrying.
Delete or the floating 🗑 Delete button
Discard the carried component completely. Wires recompute for the remaining layout.
Esc
Cancel carry: restore the original position and the wires you had before pickup.
Settings (⚙)
SA worker thread count
How many parallel SA workers SMART spawns. Default is min(navigator.hardwareConcurrency, 6). Capped at 6 to keep the target machine responsive.
Export / Import
Encodes the current grid + every placement into a base64 string (~10–15 KB for a 35-component layout). Useful for transferring state between machines or sharing a layout. Import overwrites the local state after a confirm.
System reset
Removes every component and resets the grid to the default 3 × 4. Hard to recover from — there is no undo.
How a layout is scored
The optimizer ranks layouts with a single number (higher is better), built from four signals:
Signal
Weight
Why
Working Spinners
+ 50000 each
Most valuable atom — Spinners drive the game's idle production.
Powered free rectangles
+200 (2×2) → +60000 (5×5), ×2 at the bus
Rewards keeping open space accessible to power, so future batteries / clusters fit without rearranging.
Auto-routed wires
−5000 each
Penalty per wire cell. SA prefers layouts where ports sit directly on the bus.
Free-cell connectivity
+4 per free-neighbour pair
Fine-grained tiebreaker.
A layout is valid when every energy-bearing component is powered, every Spinner has its required Repeater adjacency, and every Repeater is port-matched to a Spinner or Pulser. Invalid layouts get a heavy penalty so SA gradually anneals away from them.
Privacy
This tool sends nothing to any server and collects no information about you. The page loads from Apache once, then everything — your layout, the Top-20 results panel, the thread-count setting — lives in your browser's localStorage and never leaves your machine. No analytics, no cookies, no tracking pixels, no third-party scripts. The optimizer's Web Workers run locally in your browser. Clearing your browser's site data for this domain wipes everything.
About the game & credits
IDLE_DIRECTIVE is a grid-based inventory and resource management idle game by kevinfu510. You scavenge ruins, manage a body inventory of components, and push back against a decaying world. The game is currently a demo; the full release is scheduled for 29 July 2026. This tool exists because hand-arranging the body grid by trial-and-error becomes painful once you own 20+ components.
This optimizer is an independent, unofficial fan project, built as a tribute and a thank-you to kevinfu510 for the demo. The interface design and visuals of this tool are our own work. The component shapes, names, and the in-project terminology follow the demo so layouts here map directly to the game's body grid — those belong to kevinfu510. If this tool saved you some clicks, please try the demo and wishlist the full release: