Page 1 of 1

Multiplayer testing by myself

Posted: Sat Sep 16, 2023 7:07 pm
by Ohead
I need to test the multiplayer compatibility of my mod, but I don't wanna pester my friends to do something stupid in Factorio over and over again. Is there a way I can have multiple clients on one system or something similar?

Re: Multiplayer testing by myself

Posted: Sat Sep 16, 2023 7:17 pm
by Loewchen
Use /c game.force_crc() or /toggle-heavy-mode.

Re: Multiplayer testing by myself

Posted: Sun Sep 17, 2023 7:14 am
by Pi-C
You also could try to run Factorio from two different user accounts on your machine. Host a multiplayer game from the first instance (make sure it's not a public game!), then switch over to the other user and join that game.

Caveat: This may not work if your computer is low on RAM. Even then, things may work really slow, so it may be a good idea to set up a testing environment while only one instance of the game is running and then join with the second player. Also, you probably should have a close look at your mod list. Throw out everything that isn't necessary for your tests! If possible, get rid of huge mods, or mods that pull in lots of other dependencies! (On my computer, starting the game alone takes a relatively long time when SE is active, so I wouldn't even try to run this on two instances of the game instantaneously.)

Re: Multiplayer testing by myself

Posted: Sun Sep 17, 2023 4:38 pm
by Silari
Don't need two accounts - you can just use the standalone version. You'll need to change settings so they use a different username and don't check accounts, but it works fine. Done it before.

Re: Multiplayer testing by myself

Posted: Sun Sep 17, 2023 4:53 pm
by Pi-C
Silari wrote:
Sun Sep 17, 2023 4:38 pm
Don't need two accounts - you can just use the standalone version. You'll need to change settings so they use a different username and don't check accounts, but it works fine. Done it before.
Thanks for making this more clear! I'm not using Steam etc. myself, but the stand-alone version. I didn't mean you should buy two keys for Factorio! But for some reason, I had trouble running two different instances of Factorio as the same Linux user. So I log in as user 'Pi-C' on my machine, start the first instance of Factorio, then log in as user 'test' and start the second instance, then switch back to the first account to host the local multiplayer game, and back again to connect to the game as 'test' (doing everything at once sometimes brings down my computer as I usually have a lot of stuff open in my main account, and things may get nasty if the computer starts to swap memory).

Re: Multiplayer testing by myself

Posted: Sun Sep 17, 2023 5:18 pm
by Silari
Definitely works on the same user account in Windows. Not sure why it wouldn't on Linux. Might have had issues if you tried to run the same instance twice. You need to use two different installs, otherwise factorio can't lock the files it needs.

Re: Multiplayer testing by myself

Posted: Sun Sep 17, 2023 6:02 pm
by dog80
just force your friends to help you - help developing a mod is propably a greater thing than whatever they do instead

Re: Multiplayer testing by myself

Posted: Sun Oct 29, 2023 10:00 pm
by Gweneph
In case you haven't gotten this working yet, you don't even need two separate installations, they can use the same installation, you just need two "write directories" and two config files (I usually put the config files in the usual ./config/config.ini location within the write directory)
the write directory setting within the config file must match the write directory location*
Then you can start facotrio with the -c option pointing to the config file, et. viola two separate instances can run at once.
For ease of use I'd make a shortcut for each installation.

Since you're making a shortcut anyway, I'd recommend adding the --mod-directory switch to point to a common mod directory so they're always kept in sync.

There's many other useful parameters: https://wiki.factorio.com/Command_line_parameters

*if you're lazy like me and like to copy and paste whole folders including the config file, you can actually write

Code: Select all

write-data=./
in your config file and Factorio will use the current working directory as the path, so then your shortcut just has to set the working directory to be your actual write directory, this allows your folders to be more portable/copyable.