Section for known desync mods.
-
- Burner Inserter
- Posts: 11
- Joined: Sun Jul 17, 2016 4:19 pm
- Contact:
Section for known desync mods.
Is there any way we could have a section on the forum added for the Multiplayer side.
Where people can post mod names that are known or they have found to be causing desyncs?
-Matt
Where people can post mod names that are known or they have found to be causing desyncs?
-Matt
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: Section for known desync mods.
Just create a topic in MP forum and start listing the mods (and their versions). I'm sure mod authors would also want to know if their mod causes desync.
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Re: Section for known desync mods.
just create a bug report. mods should not be able to cause a desync
no yes yes no yes no yes yes
Re: Section for known desync mods.
Thats entirely not true, there are numerous ways a bad script can cause a desynckinnom wrote:just create a bug report. mods should not be able to cause a desync
Re: Section for known desync mods.
such as?Klonan wrote:Thats entirely not true, there are numerous ways a bad script can cause a desynckinnom wrote:just create a bug report. mods should not be able to cause a desync
no yes yes no yes no yes yes
Re: Section for known desync mods.
kinnom wrote:such as?Klonan wrote:Thats entirely not true, there are numerous ways a bad script can cause a desynckinnom wrote:just create a bug report. mods should not be able to cause a desync
Setting variables outside of events is a typical one, storing global variables not in the global.table is another, something as simple as this will desync the game:
Code: Select all
index = 1
script.on_event(defines.events.on_tick, function (event)
index = index + 1
if index == 10 then game.print("Hello") end
if index == 20 then game.print("Goodbye") index = 1 end
end)
However when someone else joins the game, index will be initialised as 1 for that player, regardless of the index in the first players game state, which means when the event runs, the index will be different, and different actions will occur, aka a desync.
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: Section for known desync mods.
Why does player 2 cause the script to reinitialise? I thought in MP there was one instance of the mod running for all players? Or does a copy of the mod run on every client (and also the server)?
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Re: Section for known desync mods.
A copy of the mod runs on every client (and the server) independently from each other. That's the reason desyncs occur in the first place: two peers end up with different gamestates.aubergine18 wrote:Why does player 2 cause the script to reinitialise? I thought in MP there was one instance of the mod running for all players? Or does a copy of the mod run on every client (and also the server)?
If there was only one instance of the mod running then all variables/tables and every action the mod took would have to be sent to other peers over the network (possibly every tick) and with mods that aggregate and process a lot of data and entities this would cause a lot of traffic.
This is also true for vanilla games as the game data itself is also considered a mod, the base mod.
- aubergine18
- Smart Inserter
- Posts: 1264
- Joined: Fri Jul 22, 2016 8:51 pm
- Contact:
Re: Section for known desync mods.
Very well explained, thank you! I've been trying to wrap my head around how mods work in MP for ages and I think I finally get it!
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
- GoldenPorkchop80
- Fast Inserter
- Posts: 117
- Joined: Fri Nov 20, 2015 10:27 pm
- Contact:
Re: Section for known desync mods.
daniel34 wrote:A copy of the mod runs on every client (and the server) independently from each other. That's the reason desyncs occur in the first place: two peers end up with different gamestates.
So, what i'm getting from all of this is that [most] factorio multiplayer runs off of a peer-to-peer system; There is no real host server, every system is connected to every other system, and a desync is a domino effect (although that when it comes to Factorio, this isn't true, since when my friend desyncs, there isn't a catastrophic network failure; other players will continue to play normally, since their seperate downloaded gamestate are isolated from the failure.)Klonan wrote:Now when player 1 starts the game, the index will be initialized from the script, and each tick it will go up by 1, and when it reaches 20 it will go back to 1,
However when someone else joins the game, index will be initialized as 1 for that player, regardless of the index in the first players game state, which means when the event runs, the index will be different, and different actions will occur, aka a desync.
But that is also the reason why desyncs happen. As the system the mods put in place may be the most relevant atm, it also causes the desync issue.
So, I was going to recommend a client-server model; all players are connected to a central server. That central server hosts the only gamestate running, everyone connecting only sees the current snapshot of the game and the area that the player is in. Every area that the players arn't in is saved to the Process ROM and dumped from RAM cache, and then de-rendered (except for processes that require the area to be rendered so that it will function even if the players arn't there.). Once they re-enter that area, callback for that area is activated; ROM gives RAM the latest data and creates a cache, and the area is subsequently rendered from RAM data, including all non-active processes. (Kinda like Minecraft's Render system.)
This system would eliminate desyncs, because as I mentioned earlier, the "game" that the player is running is just a snapshot of the current gamestate; the actual game running on the server does all of the work.
Which is its downfall, unfortunately.
If one person was connecting from, let's say, really far away, any actions that that person would do, like walking forward, would take a really long time to reach the server and once the data reached the server, it would take another long time to respond to that command. By the time that server data reached the player, it could take as much as 2 seconds to preform an action, which would really be annoying for something as simple as walking.
Plus, this would also affect everyone else that connected to the server, since the server would need every system's consent to move onto the next frame.
So, I was possibly thinking something along the lines of the Client-Server model, but with something along the lines of a message queue system. I'll leave a link for you guys to read about here: https://en.wikipedia.org/wiki/Message_queue
Also, please correct me if i'm wrong. I actually prefer constructive criticism. Just don't be an as*hole.
Contact me:
telnet.Telehack.com (My username is gpc80)
Steam
Twitch.tv
Reddit
Email:redrouster2000@gmail.com (Mods, Admins, and Game Devs ONLY! Anyone else will be blocked on my email, and on this forum)
Hamachi VPN: Please send me a PM for network info.
Forums: Send me a PM
telnet.Telehack.com (My username is gpc80)
Steam
Twitch.tv
Email:redrouster2000@gmail.com (Mods, Admins, and Game Devs ONLY! Anyone else will be blocked on my email, and on this forum)
Hamachi VPN: Please send me a PM for network info.
Forums: Send me a PM
Re: Section for known desync mods.
Hm, What's really needed is some kind of player simulation, so that a modder can test the game, as if there are other players online.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Re: Section for known desync mods.
remember this?ssilk wrote:Hm, What's really needed is some kind of player simulation, so that a modder can test the game, as if there are other players online.
no yes yes no yes no yes yes