Skip to main content

i-fetch-rocks-sim

A Python package for loading, inspecting, and simulating I Fetch Rocks save files.

The package reconstructs the in-game wire diagram from a save file as a Python object graph and lets you:

  • Inspect rooms, devices, and wires without loading the game.
  • Visualise the wire network as an interactive HTML graph (powered by pyvis).
  • Simulate the circuit tick-by-tick to capture signal values and trace behaviour.

Install

pip install ifetchrocks-sim

Or for local/editable development:

python -m venv .venv
.venv\Scripts\python -m pip install --upgrade pip
.venv\Scripts\pip install -e .[dev]

Reading a save file

Load a save and inspect the structured ship model:

from ifetchrocks_sim import SaveReader

reader = SaveReader()
save = reader.load_save_path("path/to/save.json")

print(save.ship.component_count())  # total component nodes
print(len(save.ship.rooms))         # room count
print(len(save.ship.floating))      # floating device count

summary = reader.load_path("path/to/save.json")
print(summary.room_count, summary.floating_count, summary.device_count)

Simulating ticks

from ifetchrocks_sim import Simulator

sim = Simulator()
with open("path/to/save.json") as f:
    sim.load_from_file(f)

# Record wire values across ticks
sim.capture_uuid("abcd1234-...")   # full UUID or unique prefix

for tick in range(20):
    sim.set_tick(tick)

# {tick: {wire_uuid: [values]}}
capture = sim.get_capture()
for tick, wires in sorted(capture.items()):
    for wire_uuid, values in wires.items():
        print(f"tick={tick}  wire={wire_uuid[:8]}  values={values}")

Wire tracing

# What drives this wire?
sim.print_backtrace("abcd1234")

# What does this wire feed?
sim.print_forwardtrace("abcd1234")

# Or use the module-level helpers directly
from ifetchrocks_sim import print_backtrace, print_forwardtrace
print_backtrace(sim, "abcd1234")

# Find a signal path between two wires
path = sim.find_signal_path("source-prefix", "target-prefix")

Wire diff

before = sim.snapshot_wire_values()
sim.set_tick(1)
after = sim.snapshot_wire_values()

for diff in sim.diff_wires(before, after):
    print(diff.uuid[:8], diff.before, "->", diff.after)

Labelling wires and devices

sim.set_wire_label("abcd1234", "program_counter")
sim.set_device_label("ffff0000", "alu_register")

sim.save_labels("my_labels.json")
sim.load_labels("my_labels.json")

Generating an HTML wire-graph

network = sim.build_graph_network(room_filters=["LIFE_SUPPORT", "HELM"])
network.write_html("wiring.html")

# All rooms, no power wires
network = sim.build_graph_network(room_filters=[], show_power_wires=False)

Open wiring.html in any browser to explore the interactive node graph.


Room and device inventory

# Find unimplemented/unknown devices in the save
for entry in sim.list_unknown_devices():
    print(entry.type_id, entry.uuid[:8], entry.room)

# Compare two saves
diff = sim.diff_saves("before.json", "after.json")
print(diff.device_count_deltas)

Package layout

ifetchrocks_sim/
├── simulator.py          # Simulator — main entry point
├── reader.py             # SaveReader — lightweight save-file parser
├── models.py             # SaveModel, ShipModel, ComponentNode, SaveSummary
├── backtrace.py          # backtrace_wire / forwardtrace_wire helpers
├── analysis.py           # signal-change analysis utilities
├── labels.py             # LabelRegistry — wire/device label store
├── recording.py          # WireRecorder — time-series wire capture
├── re_tools.py           # reverse-engineering probe utilities
├── validation.py         # health_check — wiring sanity checks
├── cli.py                # CLI entry point (python -m ifetchrocks_sim)
├── stub_generator.py     # generate device stub skeletons
├── _drive_loader.py      # internal: load drive .bin files for MemoryBaySignal
├── devices/              # all in-game device implementations
├── network/              # DataNetwork / LargeDataNetwork / DataNetworkManager
└── testing/              # CircuitBuilder and wire assertion helpers

Development

.venv\Scripts\pytest          # run tests
.venv\Scripts\ruff check .    # lint

License

MIT — see LICENSE.

Metadata

Release files for ifetchrocks-sim 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ifetchrocks-sim 0.1.0
File Size Uploaded Provenance Actions
ifetchrocks_sim-0.1.0.tar.gz 101.9 kB With provenance Details for ifetchrocks_sim-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ifetchrocks-sim 0.1.0
File Interpreter ABI Platform Actions
ifetchrocks_sim-0.1.0-py3-none-any.whl Python 3 none any Details for ifetchrocks_sim-0.1.0-py3-none-any.whl

Total release size: 271.4 kB

Release files / ifetchrocks_sim-0.1.0.tar.gz

Download URL ifetchrocks_sim-0.1.0.tar.gz
Size 101.9 kB
Tags Source
SHA-256 checksum
How to use checksums
3c621fc56a75619cb9142e931d1e3f4dcd805a4e997a74e7534891c2bb8324cb
BLAKE2b-256 checksum
How to use checksums
e8720ba6fd4b5e4e3bc7bfa4a216ba8b75e54a1b2cdb8e5ec1bf7d9cf8969443
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 28, 2026.

Transparency log

Release files / ifetchrocks_sim-0.1.0-py3-none-any.whl

Download URL ifetchrocks_sim-0.1.0-py3-none-any.whl
Size 169.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
534f6cb383926ebda576ff3e2090d9f56a630115f10c13f5a8c6e7e188fd4a98
BLAKE2b-256 checksum
How to use checksums
e3a36bb940a66950e40006a8acd5692eb9a51e770880d2c908b4ad43e49a4991
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 28, 2026.

Transparency log

Security for ifetchrocks-sim 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ifetchrocks_sim-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page