-
Notifications
You must be signed in to change notification settings - Fork 1
Okay, what's the concept?
The best generic explanation of concept you will find here.
Below i will only explain only how things work in Rimworld and what is actually needed to make this work.
Not as much as you might expect. First of all, calls of methods, that are very close to user input handling, are hooked up and mocked to do NOTHING, until their time comes, and, together with their respective arguments, stored into command pool until their time comes, while command pool being distributed between clients. Their times comes whenever it's time for all clients to execute command pool. Command pool is executed at the same tick number between all clients, so, results are actually the same. This is how AOE-3 approach works. So, yes, there would be local latency between issuing a command and result, until some cosmetic changes would be made.
Other mods should work as well, while certain conditions are met. Those conditions are :
-
You should not issue new input methods. New gizmos, hotkeys and float panel entries might not catch up automatically. You would need testing.
-
You should not use Verse.Rand somewhere outside TickList entity. Using it outside TickList entity OR in a context of UI callback, hotkey callback or float panel callback, would cause session to desynchronize because it would move session to volatile state with internal RNG having different iteration count in different clients. tldr: in case automatic desync detection routines detect desync, just stick with System.Random or UnityEngine.Random. Or you might ask me in discord/create an issue in this repo and explain what's the problem. If I won't be too much busy, I would help.