[1.1.33] Strange game freeze when assigning force in script

We are aware of them, but they have low priority. We have more important things to do. They go here in order not to take space in the main bug thread list.
Post Reply
Honktown
Smart Inserter
Smart Inserter
Posts: 1025
Joined: Thu Oct 03, 2019 7:10 am
Contact:

[1.1.33] Strange game freeze when assigning force in script

Post by Honktown »

See file maps/journey/functions.lua function Public.wipe_offline_players(journey) - line 777, 778, 790 and 792 (ignoring one line, they are consecutive)

Save file:
journey_asooner.zip
(4.2 MiB) Downloaded 181 times
Open save file, and wait 15 seconds for the game to freeze. Check the log.

File with a command that does the same as the script code:
comfyjourney2.lua
(1.4 KiB) Downloaded 184 times
For whatever reason, assigning player 46, budar, the force enemy freezes the game in script, but not in command.
I have mods! I guess!
Link

posila
Factorio Staff
Factorio Staff
Posts: 5201
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [1.1.33] Strange game freeze when assigning force in script

Post by posila »

Thanks for the report.

It freezes due to the game searching for positions to spill the player's inventory due to it being downsized due to the new force not having the same character inventory bonus from toolbelt researches.

I think the game freezing when it can't find place for spilled out items is a problem, but I don't have good idea how to fix it, so I'll move this to minor issues and you'll have to handle it in the scenario script.
Ref: 64269

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: [1.1.33] Strange game freeze when assigning force in script

Post by eradicator »

posila wrote:
Wed May 19, 2021 3:39 pm
but I don't have good idea how to fix it
If spilling created one item_on_ground (with amount = n) per item type instead of one per singular item that might help :twisted: .
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Honktown
Smart Inserter
Smart Inserter
Posts: 1025
Joined: Thu Oct 03, 2019 7:10 am
Contact:

Re: [1.1.33] Strange game freeze when assigning force in script

Post by Honktown »

posila wrote:
Wed May 19, 2021 3:39 pm
Thanks for the report.

It freezes due to the game searching for positions to spill the player's inventory due to it being downsized due to the new force not having the same character inventory bonus from toolbelt researches.

I think the game freezing when it can't find place for spilled out items is a problem, but I don't have good idea how to fix it, so I'll move this to minor issues and you'll have to handle it in the scenario script.
Ref: 64269
Is there a reason why the command succeeds? Unless I'm mistaken, both assign budar to enemy, but only the script freezes.
I have mods! I guess!
Link

Hanakocz
Inserter
Inserter
Posts: 39
Joined: Sun Jun 24, 2018 7:06 pm
Contact:

Re: [1.1.33] Strange game freeze when assigning force in script

Post by Hanakocz »

Ahaha the famous cpu gobbler function to spill items. The enemy number one to eradicate any cases when it might happen so server might not get cpu overloaded. Still sucks that it does it automatically on so many cases, but well.
Luckily one can decrease the times when it happens by very cheaty methods, but not every action has pre-event to deny player do such lol.

posila
Factorio Staff
Factorio Staff
Posts: 5201
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: [1.1.33] Strange game freeze when assigning force in script

Post by posila »

Honktown wrote:
Wed May 19, 2021 5:25 pm
Is there a reason why the command succeeds? Unless I'm mistaken, both assign budar to enemy, but only the script freezes.
Good question ... the item spill happens on the surface on which was the player last registered, which in case of budar is surface 1 (nauvis). When I run the command before the scenario, the surface has chunks generated and the item spill is successful. When the scenario runs it, there are no chunks generated on the surface, and the item spill ends freezes in very long loop.

There are things to consider about spilling items from offline players ... maybe it shouldn't spill and destroy the items instead, since the player is not on the map (technically). Or maybe it shouldn't resize inventory for offline players and do it when the player re-connects.

However, whatever we would choose as a better bahavior, I don't think it would be satisfying for your scenario, and you just want to avoid the inventory down-size, which you can do by setting some large enough inventory size bonus to the enemy force.

Post Reply

Return to “Minor issues”