Conversation
|
The only issue right now is that the server start command for loading save and loading scenario:
Can’t be used together for the headless server. When we load a scenario first and create a save using rcon So we need to do a dry run with the scenario first, generate a save, and then switch to -l for subsequent restarts. This flow makes sense to me, though I’d prefer something cleaner, as I’m unsure how much implicit behavior we should assume without risking weird assumptions. |
|
ive refactored FactorioInstance. my reasoning for the changes:
All the changes other than the following are syntactical sugar, moving code around to places that seem to own the functionality better. Changes that might affect functionality:
|
|
right now, FLE couples agent sessions (factorio instance) to servers by loosely getting ips and tcp ports and mapping them 1:1 on the sessions. this is an ordered mapping, so its only loose in concept (while running experiments/episodes the agent always receives the same server before/after resets). my factorio native save & load implementation needs a save directory to bind 1:1 to a server. the save directory binds the servers and couples them with the current running session of an agent in a more strict manner. if we want to use factorio native saves and loads we need to: 1.) spawn servers from saves. 2.) attach save volumes to access different saves 3.) couple server lifecycle with factorio instance
we can mitigate it by letting instance own the server spawning logic and strictly coupling it with the server:
|
|
change-logs: 1. decoupled FactorioInstance into:
This lets me decouple agent level resets and instance level resets, and expose downstream classes like GameSession and AgentSession to only the bits they would touch. Instances own complete & pure FLE coupled logic, its the core bits of the FLE designed API and its interfaces with Factorio 2. Added Sessions:
|
|
Would need to move script loading done over rcon to modular scripts embedded into the scenario's control.lua because whenever the server restarts we would need to load all the scripts again over rcon which is slow (5-10 seconds). This would add up with every restart for game reset. |
|
I like the increased modularity and separation of concerns in the instance and session levels. I also like the additional structure with new classes like You mentioned that "there is a minor connection error when running evals, so that is still unstable." Can you clarify what the issue is and do you think you know the fix for it? The unit tests should definitely pass before we merge this but also I think we should have functional tests in the form of running eval trajectories to completion and getting expected performance levels from agents |
Changes to make cluster/local work with saves
1:1 saves directories created for n instance in range(1,n) at repo root
.fle/saves/{n-1}/