Page 1 of 1

[1.1.109] Landmines in range of worms drain UPS

Posted: Tue Aug 13, 2024 2:11 pm
by grzybk
Hello,
I've been playing a 1000x tech cost challenge with biters enabled and using land mines to clear nests. Over time, I've noticed a degradation in performance and I eventually traced the issue back to leftover landmines and worms. I presume they are stuck in a constant "combat state", while I expected them to enter a "sleep state", as worms cannot trigger or (intentionally) attack the mines. This happened every time I cleared a nest and left some worms, and each nest clearing accumulated.
Main screenshot
Main screenshot
1000xrail_ups.jpg (510.52 KiB) Viewed 812 times

I've managed to create a minimal save to demonstrate the issue, which already causes UPS to drop below 60 on my computer:
Minimal screenshot
Minimal screenshot
landmine_ups.jpg (893.94 KiB) Viewed 812 times

I fully understand that I might be the only person that is affected by this and it's simple to work around, but I figured I might as well report it after finding out what was causing it.

Re: [1.1.109] Landmines in range of worms drain UPS

Posted: Tue Aug 13, 2024 2:38 pm
by boskid

Re: [1.1.109] Landmines in range of worms drain UPS

Posted: Tue Aug 13, 2024 3:28 pm
by grzybk
Sorry, searched "mine", "mines", "landmine" but not "landmines".

Still, I also provide an organic save where this caused UPS drops. I was about to write it off as "just biters being slow" if show-time-usage and show-entity-time-usage didn't report completely different times (15ms / 3ms). If no optimizations can be done, then adding landmines to show-entity-time-usage (or somewhere adjacent) would at least be helpful in diagnosing instances of this issue.

Re: [1.1.109] Landmines in range of worms drain UPS

Posted: Tue Aug 13, 2024 3:41 pm
by boskid
Exposing time taken by landmines is not feasible because they are using WhenEnemyIsAround mode which makes them register on a chunk. Entities that are using other active modes are registering on a surface and here its cheap to have 80+ lists (one per entity type) and measure update time of an entire list. In case of landmines since they are registering per chunk, any measurements would have to be made explicitly each update by the land mine code itself which means additional overhead just for time statistics. Logic of landmines is just expensive so unless other dev has a clever solution for this, there is not much to be done. Some changes were applied to the WhenEnemyIsAround logic for 2.0 (as mentioned in the post linked in my previous post).

Put it simply: "debug settings are nice, but performance is nicer". I am not willing to make landmines even slower just so they report accurate time statistics.

Re: [1.1.109] Landmines in range of worms drain UPS

Posted: Wed Aug 14, 2024 8:14 pm
by Rseding91
Moving to minor issues. Nothing here is broken, but poor performance is not the goal. If we ever find a nice solution we'll address it then, but I don't see it happening.