Game freezes

Anything that prevents you from playing the game properly. Do you have issues playing for the game, downloading it or successfully running it on your computer? Let us know here.
Dominiquini
Inserter
Inserter
Posts: 25
Joined: Tue Mar 26, 2019 6:13 pm
Contact:

Game freezes

Post by Dominiquini »

Every 1 minute or so, my game freezes for a few fractions of a second and then returns to normal. This is becoming a little irritating.
My computer is relatively good and my base is still small (I just launched my first rocket). But I have many mods installed! How can I find out if and what mod is causing this problem?
To clarify, the game runs well in general ... Only these occasional freezes from time to time.

Thank you.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Game freezes

Post by eradicator »

Press F4, enable "show-time-usage" on the "debug" tab. Press F4 again, then press F5. At the very bottom below "Script update" it shows what mod uses how much CPU time. Wait for a freeze and check if one of the numbers drastically changes. If it's not a mod the spike might also be in some of the other categories.

If it's none of the above it might be anything. Cooling problems, background programs, etcpp.
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.
Dominiquini
Inserter
Inserter
Posts: 25
Joined: Tue Mar 26, 2019 6:13 pm
Contact:

Re: Game freezes

Post by Dominiquini »

I had to record the game to be able to see anything, as the freeze lasts less than 1 second.
The only numbers that I noticed a significant increase right after the freeze were the parameters:
- Wait for update (2,950 -> 7,711)
- Game update (1,769 -> 6,493)
- Entity update (0.896 -> 5,623)

Normal data:
normal.png
normal.png (3.77 MiB) Viewed 4474 times
Soon after freeze:
freeze.png
freeze.png (3.72 MiB) Viewed 4474 times
Any idea what it might be?

Thanks,
Last edited by Dominiquini on Tue Sep 29, 2020 10:21 pm, edited 1 time in total.
Dominiquini
Inserter
Inserter
Posts: 25
Joined: Tue Mar 26, 2019 6:13 pm
Contact:

Re: Game freezes

Post by Dominiquini »

I checked if my GPU or CPU could be experiencing heating problems and slowing down periodically, but I didn't find any problems.
I also found no evidence of peak processing demand by any other application during gameplay.
The freezing occurs when I am moving or stopped. Me being in the middle of my base or in the middle of nowhere. It also happens in the map view!

Thanks.
User avatar
jodokus31
Smart Inserter
Smart Inserter
Posts: 1622
Joined: Sun Feb 26, 2017 4:13 pm
Contact:

Re: Game freezes

Post by jodokus31 »

Nanobots has a peak.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Game freezes

Post by eradicator »

Also the Nanobot spike is exactly as large as the Entity Update spike:

5.623-0.896 = 4.727 (Entity Update)
4.832-0.106 = 4.726 (Nanobot)

Which might imply that Nanobot interferes with entity update somehow.

YARM and GunEquipment are also taking a hefty chunk of processing time. Don't know either mod so that might be ok.
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.
Dominiquini
Inserter
Inserter
Posts: 25
Joined: Tue Mar 26, 2019 6:13 pm
Contact:

Re: Game freezes

Post by Dominiquini »

jodokus31 wrote: Tue Sep 29, 2020 10:36 pm Nanobots has a peak.
I hadn't noticed that! I will try to remove this mod and test here...

Thanks
Dominiquini
Inserter
Inserter
Posts: 25
Joined: Tue Mar 26, 2019 6:13 pm
Contact:

Re: Game freezes

Post by Dominiquini »

eradicator wrote: Tue Sep 29, 2020 10:46 pm Also the Nanobot spike is exactly as large as the Entity Update spike:

5.623-0.896 = 4.727 (Entity Update)
4.832-0.106 = 4.726 (Nanobot)

Which might imply that Nanobot interferes with entity update somehow.

YARM and GunEquipment are also taking a hefty chunk of processing time. Don't know either mod so that might be ok.
But their numbers are stable and the game's performance is good most of the time!

Thanks.
Dominiquini
Inserter
Inserter
Posts: 25
Joined: Tue Mar 26, 2019 6:13 pm
Contact:

Re: Game freezes

Post by Dominiquini »

The problem seems to be with the "Nanobots" mod!
I will report this problem to the author of the mod to see if he discovers the problem.

Thank you for your help!
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5207
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Game freezes

Post by eradicator »

Dominiquini wrote: Tue Sep 29, 2020 11:13 pm But their numbers are stable and the game's performance is good most of the time!
Yea, sure. There can be perfectly fine reasons for this. Just saying that GunEquipment is almost using as much cpu as your entire factory (entity update). From a quick glance at the code it looks mostly like the author basically never cared about performance. Seems like it's doing whatever it is doing - and all of it - repeatedly every single tick. Would probably be trivial to speed it up 60 times by simply reducing that to once per second.
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.
Dominiquini
Inserter
Inserter
Posts: 25
Joined: Tue Mar 26, 2019 6:13 pm
Contact:

Re: Game freezes

Post by Dominiquini »

eradicator wrote: Wed Sep 30, 2020 12:36 am
Dominiquini wrote: Tue Sep 29, 2020 11:13 pm But their numbers are stable and the game's performance is good most of the time!
Yea, sure. There can be perfectly fine reasons for this. Just saying that GunEquipment is almost using as much cpu as your entire factory (entity update). From a quick glance at the code it looks mostly like the author basically never cared about performance. Seems like it's doing whatever it is doing - and all of it - repeatedly every single tick. Would probably be trivial to speed it up 60 times by simply reducing that to once per second.
I will contact the mod's author about this.

Thank you for your help!
User avatar
jodokus31
Smart Inserter
Smart Inserter
Posts: 1622
Joined: Sun Feb 26, 2017 4:13 pm
Contact:

Re: Game freezes

Post by jodokus31 »

Dominiquini wrote: Tue Sep 29, 2020 11:22 pm The problem seems to be with the "Nanobots" mod!
I will report this problem to the author of the mod to see if he discovers the problem.

Thank you for your help!
IIRC there is a nanobots mod setting, where you can tame the cpu usage a bit. It could also be, that you have something on your map, where nanobots spends alot of time on. F.e. monstrous amounts of ghosts or such.
Might be a good performance savegame for the author to inspect.
Dominiquini
Inserter
Inserter
Posts: 25
Joined: Tue Mar 26, 2019 6:13 pm
Contact:

Re: Game freezes

Post by Dominiquini »

jodokus31 wrote: Wed Sep 30, 2020 10:36 am
Dominiquini wrote: Tue Sep 29, 2020 11:22 pm The problem seems to be with the "Nanobots" mod!
I will report this problem to the author of the mod to see if he discovers the problem.

Thank you for your help!
IIRC there is a nanobots mod setting, where you can tame the cpu usage a bit. It could also be, that you have something on your map, where nanobots spends alot of time on. F.e. monstrous amounts of ghosts or such.
Might be a good performance savegame for the author to inspect.
I was using the features "Mark items on ground", "Deconstruct finish miners" and "Find all the fish" provided via signals. The problem goes away if I disable these signals!
Maybe, every 1 minute, "Nanobots" starts to process these signals and causes the freeze that I was experiencing...
About the mod settings, I didn’t try to tamper with it because I’m not sure what many of those parameters are for. Maybe I’ll test other settings later...

Thanks.
DeznekCZ
Burner Inserter
Burner Inserter
Posts: 11
Joined: Fri Sep 23, 2016 12:56 pm
Contact:

Re: Game freezes

Post by DeznekCZ »

Hi all,

GunEquipment can take that much time how much grids (equipment grids) are on map. In version 0.0.11 was some optimalization, but it can not handle all. For now it contain many loops, specially in OnRobotBuildEntity and in OnBuildEntity. If there was build many entities in one tick, may cause a freeze. Every bullet shoot may cause same problem, because every time the magazine is low, the equipment is replaced inside grid.

If I can help in that way, I will try it.

For GunEquipment, DeznekCZ

PS: 0.0.12: Krastorio 2 magazines fix, projectile magazines now available.
DeznekCZ
Burner Inserter
Burner Inserter
Posts: 11
Joined: Fri Sep 23, 2016 12:56 pm
Contact:

Re: Game freezes

Post by DeznekCZ »

I got an idea to solution how to make it more efficient. There could be queue with all guns and every tick will be updated only some of them instead checking of all grids. In first tick after load will be queue constructed and in any call of entity will be equiped or unequiped, this queue will be checked. If weapon is valid, then load if not remove from queue. So it needs to be implemented and tested.
Dominiquini
Inserter
Inserter
Posts: 25
Joined: Tue Mar 26, 2019 6:13 pm
Contact:

Re: Game freezes

Post by Dominiquini »

DeznekCZ wrote: Fri Oct 02, 2020 1:42 am I got an idea to solution how to make it more efficient. There could be queue with all guns and every tick will be updated only some of them instead checking of all grids. In first tick after load will be queue constructed and in any call of entity will be equiped or unequiped, this queue will be checked. If weapon is valid, then load if not remove from queue. So it needs to be implemented and tested.
I do not understand enough to give an opinion on the matter. I only linked you here because I thought it might be of interest to you to hear this comments about your mod.
Anyway, good mod.

Thanks.
Post Reply

Return to “Technical Help”