Page 1 of 1
Websockets?
Posted: Mon May 08, 2017 6:29 pm
by NightmareInfinity
Would it be possible to do something like having websockets in Factorio?
I think it would be really cool to write a mod that connects to a service that has that and have it come back and do things in the game itself based on what the socket server says.
I have some ideas but i don't know if its possible.
Re: Websockets?
Posted: Sat Jul 22, 2017 2:23 pm
by Plorntus
They have said they will not be putting sockets in the game as it breaks determinism. To me thats unfortunate as I feel as long as you don't perform any changes to the game state it should be fine and the amount of cool mods you could make with them would make it worthwhile. That being said you can write to a file and read the output and have a separate program pick up the output . and send it over websockets.
I did actually make something called FactorIO (on github) which was able to wrap the client and server and run arbitrary lua and access the result. Eg. so you could get data out to send over a socket without intermediate files.
Re: Websockets?
Posted: Sat Jul 22, 2017 2:27 pm
by NightmareInfinity
Could you link it please? Id really love to check it out.
Re: Websockets?
Posted: Sat Jul 22, 2017 2:56 pm
by Plorntus
NightmareInfinity wrote:Could you link it please? Id really love to check it out.
https://github.com/TomCaserta/FactorIO
Unfortunately its more of a proof of concept at the moment. It's not complete but I was planning on working on it this weekend some more.
Here is a video of it:
https://www.youtube.com/watch?v=4IS67LTZ6kQ where I serialized the game data and wrote it to a file (the file was created by the external application and not factorio.)