Eneas


Above the clouds of Nauvis lies the ancient moon Eneas. Not only does it hold secrets concerning the history of this star system, it is also home to an enigmatic machine called unit-05. Eneas does not modify vanilla content, only adds new items and recipes. It also contains improvements to early game progression and a database for factorio lore enthusiasts. >Multiplayer is unstable at the moment. There are desync issues.

Content
30 days ago
2.0
2.36K
Planets

g [Unsolved] Multiplayer desync issues

a month ago

Hellow, i've enabled your planet on our server and after trying to join a bit later again i get the following message:

Cannot join. The following mod event handlers are not identical between you and the server. This indicates that the following mods are not multiplayer (save/load) safe. (See the log file for more details):

mod-moon-eneas

a month ago

Yes this is currently a problem. I have had trouble identifying exactly when and how this error starts occuring. We did extremely long multiplayer tests that were very stable before release with people coming and going all the time, but apparently there is some sort of window where a person has to join and afterwards this desync occurs.

The number of people also seems to play a role, as I was never able to reproduce this error on a two player server no matter the timing of the second player joining.

Sorry for this inconvenience, this is definitely the #1 issue i am working on at the moment

a month ago

The risk of trying out brand new mods, fault is with me.

I can tell for info that we have any planet start and where starting on another modded (Linox) planet.

a month ago
(updated a month ago)

Can you tell me a little about the amount of players present? Was there more than one player successfully connected at the start? And then another tried to join afterwards after some time passed and then it desynced?

a month ago

We where 3 in the beginning, i logged and tried to get on later at which point i was given the message.

at the point of trying to join there was 1 other online.

a month ago

Okay, at least that is consistent with the other reports, that narrows things down. Thank you! Will update as soon as I know more

28 days ago

Hello, I am eager to put this in my custom modpack, but I am waiting with that until the multiplayer issues are resolved.

Maybe I could offer some assistance in debugging whatever issue is causing it. Do you have anything more specific about the issues like runtime logs, reports, etc?

I’ll have a look at the code in your files later today.

27 days ago
(updated 27 days ago)

Hello, I have had a look, and I’ve found several issues that will cause desyncs, I have altered the code, no intended gameplay logic was changed.
The issue is with two things:

Script.on_nth_tick calls during runtime is bad and the major cause.
Calls to math.random() too is bad, this is lua’s internal rng, which is different for everyone.

I have changed 4 files, camera.lua, events.lua, message.lua and talk.lua to fix the issue.

report: https://pastebin.com/gNWYNUBX this mainly explains what was changed, why, and some information about Factorio's multiplayer handling
camera.lua: https://pastebin.com/ZwXavbiC
events.lua: https://pastebin.com/8gJMkyBd
message.lua: https://pastebin.com/GGs9LaPM
talk.lua: https://pastebin.com/DGwGJSqR

I have also included a solution to the other issue posted on the discussion thread with mining debris with full inventory, without causing an exploit.

23 days ago

TheBiky88 you are a champion. I'm not related to this mod in anyway but I want to say that your document with the changes, the cause of the issues, and explanations on what is happening at a code level are fantastic! I have done some very light modding of factorio before (mostly editing existing mods for minor changes) and this document is a boon to anyone who has any aspirations of taking that further.

23 days ago

Heads up, the changes in events.lua are causing server crashes. It looks like the storage.rng table isn't getting initialized when its getting added to an exsisting save.

To combat this I made the following change to the check_timed_events function (around line 788(I do not remove or edit the cleanup or pollution code):

local function check_timed_events(event)
-- This ensures storage is initialized even if on_init didn't run
if not storage.rng or not storage.events then
init_debris()
end

-- Check debris event
if storage.events.debris.enabled and 
   storage.events.debris.next_tick and 
   game.tick >= storage.events.debris.next_tick then

    local success = execute_debris_crash()

    if success then
        storage.events.debris.next_tick = game.tick + 
            storage.rng.debris(DEBRIS_CONFIG.min_interval, DEBRIS_CONFIG.max_interval)
    else
        -- If spawn fails, try again in 5-15 minutes
        storage.events.debris.next_tick = game.tick + storage.rng.debris(5 * 60 * 60, 15 * 60 * 60)
    end
end
22 days ago
(updated 22 days ago)

That's odd... I'll have a look into this

Edit:
Did you by any chance load the save with the original mod enabled, saved the game, then updated the files and reloaded(/ rebooted without changing the mod version)? Because that's the only scenario I can think of where this would happen.

When a mod is added to a save for the first time, on_configuration_changed fires and init_debris() runs, which creates the storage.rng tables. But if you swap out the files without bumping the mod version, Factorio doesn't see any change and won't call on_configuration_changed again, so storage.rng never gets initialized and you get exactly the crash you're describing.

We'll have to wait for Amelie to update the mod for official changes anyways.

22 days ago

I did exactly that. I swapped the files you updated without updating the version number. I was unaware it was required for on_configuration_changed to run again.

14 days ago

Same error on latest version. Seems like bug in another mod https://mods.factorio.com/mod/rigor-module/discussion/69a88fa134893aef7bc29ffd - you could check how it was fixed, maybe helps.

14 days ago

Same error on latest version. Seems like bug in another mod https://mods.factorio.com/mod/rigor-module/discussion/69a88fa134893aef7bc29ffd - you could check how it was fixed, maybe helps.

Already solved, waiting for update by Amelie. Please read the entire thread before posting anything.

New response