Websockets?

Place to post guides, observations, things related to modding that are not mods themselves.
Post Reply
NightmareInfinity
Inserter
Inserter
Posts: 21
Joined: Mon Nov 17, 2014 3:53 pm
Contact:

Websockets?

Post 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.
This is my Signature. There are others like it but this one is mine.

Plorntus
Burner Inserter
Burner Inserter
Posts: 14
Joined: Mon Nov 24, 2014 10:43 am
Contact:

Re: Websockets?

Post 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.
Last edited by Plorntus on Sat Jul 22, 2017 2:55 pm, edited 2 times in total.

NightmareInfinity
Inserter
Inserter
Posts: 21
Joined: Mon Nov 17, 2014 3:53 pm
Contact:

Re: Websockets?

Post by NightmareInfinity »

Could you link it please? Id really love to check it out.
This is my Signature. There are others like it but this one is mine.

Plorntus
Burner Inserter
Burner Inserter
Posts: 14
Joined: Mon Nov 24, 2014 10:43 am
Contact:

Re: Websockets?

Post 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.)

Post Reply

Return to “Modding discussion”