What if you could define mod to use threading? Some mod that just calculate remaining ore or just monitor something and display text output to GUI don't need to fight for precious update time they could run independently right?
Also factorissimo mod, it runs lot of independent worlds that just transfer resources to main world, but inside of a factory can run in separate thread and do its thing.
How it would work?
Main loop Update ->
Factory 1 thread -> Sync inputs and outputs to finalize -> next cycle
Factory 2 thread ->
Or as you would thread minecraft overworld nether and end you can run main loop independently then just wait for all updates to finish and sync transfers between them.
You could even include big warning like: You are using mods that use threading: mod 1 mod 2 mod 3, continue on your own risk!
Mod threading for increased performance
Moderator: ickputzdirwech
Re: Mod threading for increased performance
Tbh for this to work there is a need to have dev's created entities to transfer items, fluids and power between surfaces. Potentially also pollution.
After that it should be possible to run each surface sim on separate thread and then sync resource transfers in the end.
That would quickly lead to a mod where you would build factory on few concurrent surfaces to build much bigger factory
After that it should be possible to run each surface sim on separate thread and then sync resource transfers in the end.
That would quickly lead to a mod where you would build factory on few concurrent surfaces to build much bigger factory
Re: Mod threading for increased performance
I don't think any mod with gameplay effects can use threading and also be multiplayer compatible, since Factorio multiplayer uses lockstep simulation (= all players must calculate gameplay the same way, and agree on the same sequence of events, or desync occurs).
Re: Mod threading for increased performance
As i was saying those will be 2 different worlds running 2 and more locksteps side by side and just swap power/items/fluid/entities at main thread so other worlds can be threaded.