Helmod: Assistant for planning your factory

by Helfima

Assistant for planning your factory. Can calculate required ingredients, products, machines, modules, and beacons. Can also calculate power production / consumption.

Utilities
10 days ago
0.14 - 1.1
373K

b Desync in Multiplayer

4 years ago

When the person that does not host the game klicks on "Add Recipe" the game crashes for that person. The host is not effected and can use the Mod. We tried "ResetCashes" but it did not show any results. Hoping for a fix.

4 years ago

I've changed the ingame setting for the debug mode to trace, but does anyone know where I could find the file it is being written to?
I've got the same issue as above.

4 years ago

I found 2 bad lines in the my code
I hope it will solve the problem, after i can't do more, I have removed all local variable
wait the next release

4 years ago

Hi Helfima,
first of all, nice mod. Appreiciate your work!
Unfortunately, the fix didnt help. Desync still happens, when anyone tries to add recipe.
Hope you find a good fix for it.

4 years ago

@DJTomKid: if i could have the save or the list of mods, I already had the problem caused by another mod

4 years ago

I gonna try the new update in a bit. gonna share my save if its still happening

4 years ago
(updated 4 years ago)

Still happening. Here you go: https://drive.google.com/open?id=1OmUx0OzxZHyWSFKqzEprQTQ467m4kMSo

We found out that "Angel's Petro Chemical Processing" ( https://mods.factorio.com/mod/angelspetrochem ) is causing this issue for us.
All mods from this save file were enabled (in a new game ofc) except for infinite ores, bio processing, Refining and Pressure Tanks.
As soon as we added PetroChem the issue started appearing. Note that we also synced startup settings from this save everytime we added a new mod to the list.

Not sure why tho.

4 years ago

thx for your test
I have test your save but I don't reproduce desync with 2 factorio on my computer
When I open your save the trace debug of my mod was activate, you must disable that. we can't see nothing with debug when desync problem.
if is a desync problem there are a report, I can check it to find something

what is OS of server? Windows/Linux
same question for the client?
is it a desync problem? not the connexion lost by latency from my MOD?

4 years ago

Hi Helfima,
we use every mod which is listet in this modpack "Foltik's Spaghetti Modpack".
Except DeadlockCrating, because it is not available for newer versions.
You can download savefile here https://we.tl/t-4r45xmZ0Po
I would like to give you more Info, but my debugging skills are limited :)

what is OS of server? Windows/Linux
-> Client host from Windows
same question for the client?
-> We all use Windows
is it a desync problem? not the connexion lost by latency from my MOD?
-> Well now that you say it, most of the times it is a lost connection due to latency. Somtimes tho there is a desync.

Thanks again for your support.

4 years ago

We are on Factorio version 0.17.79 I believe and are playing via Win10 with a ingame hosted session (not using the server)
Alright I'll disable the trace in the debug then.
Next time this happens I will use the report function.
But I'll try setting up a dedicated server and see if this works for the time being for us.

4 years ago

This sounds exactly the problem I was having during my Twitch stream this morning - every time I clicked on a recipe I got a disconnect message from the server. I was playing on Factorio 0.18.3 with the latest version of Helmod - 0.10.2. Let me know if you would like to see video of this, and also my mod list

4 years ago
(updated 4 years ago)

I mean there are too many loop in one tick when there are many recipe or computer run too slower
I have create a schema of all loop to build the Recipe Selector

step 1 and 2 are running only one time when there no mod update

now I'm going to have to think about how to reduce the number of loops and the impact on one tick, I see 2 solutions
1) try to merge step 3,4,5 to get only the loop of step 3 if it's possible
2) try to run each step on few ticks if it's possible

Step 1 only if list_ingredients is empty
  LOOP recipe FROM all recipes
    LOOP product FROM all recipe.products
      list_products[product.name][recipe.name]=recipe
      list_translate[product.name]=product.localised_name
    LOOP ingredient FROM all recipe.ingredients
      list_ingredients[ingredient.name][recipe.name]=recipe
  LOOP recipe FROM all fluids
    LOOP product FROM all recipe.products
      list_products[product.name][recipe.name]=recipe
      list_translate[product.name]=product.localised_name
    LOOP ingredient FROM all recipe.ingredients
      list_ingredients[ingredient.name][recipe.name]=recipe
  LOOP recipe FROM all resources
    LOOP product FROM all recipe.products
      list_products[product.name][recipe.name]=recipe
      list_translate[product.name]=product.localised_name
    LOOP ingredient FROM all recipe.ingredients
      list_ingredients[ingredient.name][recipe.name]=recipe

step 2 only if not(User.isTranslate())
  LOOP localised_name FROM list_translate
    Player.request_translation(localised_name)

step 3
  LOOP key,recipe FROM list_ingredients or list_products
    if filter=null or key LIKE filter
      list_group[recipe.group]=recipe.group
      list_subgroup[recipe.subgroup]=recipe.subgroup
      list_group_elements[recipe.group][recipe.subgroup][recipe.name]=recipe
  list_item = list_group_elements[group_selected]

step 4
  LOOP group FROM list_group
    build menu group

step 5
  LOOP subgroup, list FROM list_item ORDER BY list_subgroup
    LOOP recipe FROM list
      build recipe icon button

4 years ago

hmm... I must admit that the game frezzes on my end (as a host) as well, as soon as my friend opens the recipes and desyncs after ...
but this got me thinking: does the desync really happen because of this?

How does the caching function exactly work? I mean like saving the cache until changes are detected?

4 years ago

Would it be possible to use the final data stage (data-final-fixes) to produce a table of recipes so that all the heavy lifting was done on initialisation rather than on the fly??

It's a while since I checked the mod initialisation procedure so if that isn't possible could you not build the table of recipes straight after the data stage is complete??

If this is a silly idea please just ignore it :)

4 years ago
(updated 4 years ago)

I have updated the mod, it's little better in step 5 (10-20% faster)
@AstralBlader the cache is creating when you open recipe selector, if you open one time recipe selector before your friend come, i mean it's ok
@ChurchOrganist yes, it’s because I’m dragging a history that didn’t allow it to be loaded, but it’s going to require a bit of work

4 years ago

Still desyncs me and anyone else that clicks the icon in multiplayer (I'm the host, dedicated server, has the mod and my settings copied over)

4 years ago
(updated 4 years ago)

I have the issue too, also on a dedicated server on 0.17.79 Helmod 0.9.29, and a sizeable modpack (angelbob, ScienceCostTweaker, LTN, FARL & RSO, ...): any time I open the recipes panel, I get dropped from the server, and can't join again (getting dropped soon after I enter the game, with the Helmod panels still open from before being kicked).

I've had success getting Helmod working on the server with the following workaround:
- Load the multiplayer save in single-player.
- Open Helmod and the recipes panel,
- Wait for it to load completely, then save.
- Restart your server using that new savegame.

Helmod works like a charm on my dedicated server now :)

4 years ago

madmath, tried your workaround, and it worked for the first two recipes I selected on the server, and then returned to the same desync crash on the third.

4 years ago

I pushed a update, you can try
the cache is generate on game initialization
you can check the cache in the admin tab if you are admin, it must be similar of this screen in the first column
https://imgur.com/a/ngyD7Ly
careful dont delete or refresh nothing

4 years ago

Thanks so much for your quick response and push! You're awesome!

So is there a way to refresh that cache during an already running game? Ideally so I can add it to the server we have in-progress?

4 years ago

just update my mod and restart server, cache is automatically refresh when you update any mod

4 years ago
(updated 4 years ago)

So I did that, and it still crashed. So I tried madmath's method with the new version, and it worked perfectly. I was able to test out multiple different recipes and it all worked great. A friend then asked "You finally get that mod you're raving about working" and I said "Yes, hop in". He hopped in, and as soon as he opened the Helmod window, he got desync'd and dropped from the server. Had to remove the mod from the server for him top be able to log in.

4 years ago

ok, step 1 "common cache" is not the problem, but step 2 "translation cache" can't build in the game initializing but can be disable in Mod Setting->Map->Filter with translated string
if you can try that

4 years ago

Thanks for your massive support.
We all can use your wonderful mod now.
Unfortunately there is a little bug or our savegame is broken.
When i restartet the game with the newest version the recipes did not show up.
I have to enable "show hidden" to see any recipes.

4 years ago

just for information I created a discord https://discord.gg/mKEeAKb

4 years ago
(updated 4 years ago)

i have similar problem that starts several months ago - don't remember exact time. when server person click on "add recipe" button - client person freeze. we don't have desyncs - just freeze. client can click on "add recipe" button without any problems. before that moment we use helmod in our games about a year without any problems.

update: i find an answer - it's setting for solo game that stop game when you open Helmod. in multiplayer game this button even don't exist and when you open Helmod all works fine - nothing stops. but when you press recipe button this bugged setting somehow fire and freeze everything for client... i load map in solo and turn setting off. then load game in multuplayer and problem solved.

4 years ago

I will fix that in the next release

New response