nicolas-lang / Factorio.LongWarehouses

A mod for the game Factorio
Other
3 stars 3 forks source link

Game lag/Dropping player on join #5

Closed elementalistic closed 9 months ago

elementalistic commented 1 year ago

So we've been using the mod for a while now with TSM for our train stops. Each station module has 1 to 4 long warehouses used in it. Now on top of that we are playing with Space Exploration so we have a lot of plants/orbits/stars (surfaces).

When a player joins, the server will lag and start to drop any player on the server, before resuming and running fine. Using F4's Show-Time-Usage option, I got this screenshot https://i.imgur.com/gcRpnRR.jpeg which shows the line

mod-nco-LongWarehouses: 0.000/0.000/2884.442

Time is shown as average/min/max of the last 100 ticks

So a tick took 2.8seconds to be processed by the mod.

I've tried saving the map and loading it in single player, on the loading bar it does sit at 100% for about 3s and then loads in.

While this is only causing a bit of lag when someone first joins the game, as we expand to more surfaces (we've only just gotten to building on a second planet), this will reach a point on connect the server will lag to the point we get dropped from it. Atm it's hitting about 1/3 of the drop bar.

On rough count, we have 120 production stations, so that should mean roughly 360 long warehouses used there, plus ones we've used for mines and fluid production stations. We could be nearing 450-500.

nicolas-lang commented 1 year ago

Thanks for the report.

I am quite sure I know what causes this. I took a shortcut in the on-load validation, assuming that I don't need to throttle it because it will be fast enough as it is.

I will probably look into this later today and I see two steps:

with the workaround you will probably need to validate manually from time to time

nicolas-lang commented 1 year ago

I have added the workaround as previously mentioned. In order for it to apply you have to manually disable the validation in the mod settings.

I hope this resolves your immediate problems.

If it is configured correctly you should get a message __"Long Warehouses: Warning, automatic warehouse validation is disabled, remember to /wh_check regularly"__ on player join instead