Skip to content

Functions in storage make world saves impossible — mod-packaged variant for persistent servers #381

Description

@bdambrosio

Found while running FLE's Lua stack in an unusual regime: a persistent multiplayer server where an LLM agent cohabits the map with a human player in real time (no fast-mode, real walking). Setup: https://github.com/bdambrosio/Cognitive_workbench (factorio/). We carry build-time patches for each of the issues we're filing; happy to turn any into a PR.

Architectural: tool server.lua files register implementations as
storage.actions.<name> = function(...) (e.g. request_path/server.lua
line 6). Lua functions in storage are unserializable, so any world
running the injected stack cannot save — fine for episodic headless
runs, fatal for persistent-server use cases (long-horizon agents,
human-agent shared maps, crash recovery).

What we did: a build script that cribs the per-tool server.lua bodies +
shared libs into a single control.lua packaged as a regular mod, where
functions live in the mod's Lua state (globals recreated on load) and
storage stays data-only, exposed via
remote.add_interface("fle_bridge", ...). Same sources, save-safe.
Happy to share/upstream the approach if persistent-server support is of
interest — it also gives human players visible, normal interaction with
the agent character.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions