AI Player

by ob_105

Adds an autonomous AI player that uses LM Studio/Open ai to play Factorio. The AI can build, mine, craft, fight, and interact with the world.

Utilities
14 days ago
2.0
409
Logistics Combat Character Enemies Logistic network Manufacturing

g RCON not connecting to factorio

12 days ago

it says RCON connect failed: Failed to establish a connection to the server

11 days ago

this could be fixed only if to run a headless server. Just download from factorio.com, extract and maybe create some configs if you wish.

Now you should be really patient because it's crucial
1. locate your factorio.exe in factorio server dir
2. launch cmd
3. drag-n-drop factorio.exe in cmd
4. add next parameter: --start-server. this parameter requires to add path to the save_file.zip that you wish to run, in my case it's _autosave2.zip. drag-n-drop save file in cmd.
5. add next parameter: --rcon-bind 127.0.0.1:27015
6. next: --rcon-password '' (by default mod trying to connect without password)
7. ???
8. PROFIT! Server is running with RCON enabled

Launch LM Studio and load prefered model (would suggest qwen3-vl-4b for faster responses on low vram cards)
Now connect to the server and run lm_studio_bridge.py in cmd. (drag-n-drop into new cmd window)

Should see few new lines in server console something like:

1.321 Info RemoteCommandProcessor.cpp:126: Starting RCON interface at IP ADDR:({127.0.0.1:27015})
26.651 Info RemoteCommandProcessor.cpp:245: New RCON connection from IP ADDR:({127.0.0.1:44546})
26.651 Info RemoteCommandProcessor.cpp:245: New RCON connection from IP ADDR:({127.0.0.1:44560})

and in lm_studio_bridge should be just a succesful connection or something.

This bridge will request for completing prompt in LM Studio and then it will send rcon request to move player and interact with a map.
Altough this ai works no better than a script with some cycle inside to cut trees. Just moves to the east or wherever it prefer at first requests and dies when there is enemies.

11 days ago

does not work at all for me

New response