[StrangePan][2.0.21] SegmentedUnit very high CPU usage

Things that has been reported already before.
Sopel
Fast Inserter
Fast Inserter
Posts: 106
Joined: Mon Sep 24, 2018 8:30 pm
Contact:

[StrangePan][2.0.21] SegmentedUnit very high CPU usage

Post by Sopel »

SegmentedUnit at 1ms/tick for me. Asked someone else, they don't have it at all. I think it's some bug. Attaching a save.

https://drive.google.com/file/d/1j8RVHl ... sp=sharing
CodeNyuu
Manual Inserter
Manual Inserter
Posts: 1
Joined: Tue Nov 26, 2024 5:32 am
Contact:

Re: [2.0.21] SegmentedUnit very high CPU usage

Post by CodeNyuu »

Although I'm not sure exactly, I think it has something to do with the demolishers on Vulcanus. After loading a few saves, the entities labeled as SegmentedUnit and SmokeWIthTrigger only appear after landing on Vulcanus. Loading in new demolisher territories, these values increase very fast.



Before loading new chunks, SegmentedUnit was using 1.1 ms and SmokeWithTrigger using 0.37 ms.
Screenshot 2024-11-25 234739.png
Screenshot 2024-11-25 234739.png (192.67 KiB) Viewed 1274 times


And After loading new chunks, SegmentedUnit shot up to 3.7 ms and SmokeWithTrigger at 1.22 ms.
Screenshot 2024-11-25 235711.png
Screenshot 2024-11-25 235711.png (212.58 KiB) Viewed 1273 times

After running this kill all command,

/c local surface=game.player.surface
for key, entity in pairs(surface.find_entities_filtered({force="enemy"})) do
entity.destroy()
end

The usage dropped nearly down to zero. Although, SegmentedUnit is still at 0.42 ms because I don't think the command kills demolishers that are in unloaded chunks. In the screenshot, you can see spaces where there's still territories.
Screenshot 2024-11-26 000838.png
Screenshot 2024-11-26 000838.png (193.55 KiB) Viewed 1273 times


I do believe this is a bug as it's pretty unreasonable for demolishers to be using this much processing power just to roam around in their territories.
Last edited by CodeNyuu on Tue Nov 26, 2024 7:07 am, edited 1 time in total.
Sopel
Fast Inserter
Fast Inserter
Posts: 106
Joined: Mon Sep 24, 2018 8:30 pm
Contact:

Re: [2.0.21] SegmentedUnit very high CPU usage

Post by Sopel »

Yes, it is due to demolishers, that's why I have a mod that kills them, as a workaround to this problem. I should have been clearer, sorry.

Code: Select all

    local big_demolisher = data.raw["segmented-unit"]["big-demolisher"]
    local medium_demolisher = data.raw["segmented-unit"]["medium-demolisher"]
    local small_demolisher = data.raw["segmented-unit"]["small-demolisher"]
    big_demolisher.max_health = 1
    big_demolisher.healing_per_tick = -1
    medium_demolisher.max_health = 1
    medium_demolisher.healing_per_tick = -1
    small_demolisher.max_health = 1
    small_demolisher.healing_per_tick = -1
Sopel
Fast Inserter
Fast Inserter
Posts: 106
Joined: Mon Sep 24, 2018 8:30 pm
Contact:

Re: [2.0.21] SegmentedUnit very high CPU usage

Post by Sopel »

Loewchen wrote: Tue Nov 26, 2024 6:49 pm 120275
I don't see anything concerning SegmentedUnit in that thread, though yes, it's related.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14891
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.0.21] SegmentedUnit very high CPU usage

Post by Rseding91 »

Demolishers are segmented units.
If you want to get ahold of me I'm almost always on Discord.
manishearth
Burner Inserter
Burner Inserter
Posts: 10
Joined: Wed Jun 29, 2016 2:15 pm
Contact:

Re: [2.0.21] SegmentedUnit very high CPU usage

Post by manishearth »

I'm also facing this problem. I have low FPS when connecting to a multiplayer server. FPS seems to tank when using lots of bots, but I also have 4ms SegmentedUnit and 1ms SmokeWithTrigger that's just constant. The menu says I have 153 segmented units active.

Can upload map if necessary. My friend who lives closer to the server is not having FPS issues but still sees the 4ms SegmentedUnit costs.
Loewchen
Global Moderator
Global Moderator
Posts: 9730
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: [2.0.21] SegmentedUnit very high CPU usage

Post by Loewchen »

manishearth wrote: Thu Nov 28, 2024 6:54 pm I'm also facing this problem. I have low FPS when connecting to a multiplayer server. FPS seems to tank when using lots of bots, but I also have 4ms SegmentedUnit and 1ms SmokeWithTrigger that's just constant. The menu says I have 153 segmented units active.

Can upload map if necessary. My friend who lives closer to the server is not having FPS issues but still sees the 4ms SegmentedUnit costs.
Once the fix for this one is live and your issue persists, make a new report following 68653 please.
manishearth
Burner Inserter
Burner Inserter
Posts: 10
Joined: Wed Jun 29, 2016 2:15 pm
Contact:

Re: [2.0.21] SegmentedUnit very high CPU usage

Post by manishearth »

Thank you! Will do; do you have an estimate on which release I should be waiting for?
manishearth
Burner Inserter
Burner Inserter
Posts: 10
Joined: Wed Jun 29, 2016 2:15 pm
Contact:

Re: [2.0.21] SegmentedUnit very high CPU usage

Post by manishearth »

Ah, I can just watch the release logs for issue 120275, that works, thanks!
Musil
Inserter
Inserter
Posts: 21
Joined: Thu Mar 14, 2019 6:28 am
Contact:

Re: [2.0.21] SegmentedUnit very high CPU usage

Post by Musil »

same thing for me. wanted to make a thread but found this after looking up segmented unit.
I'm playing a game with an acquaintance.

We swap save files and host the saves on either computer, depending on who starts first.
Up until a few days back, either person could host the game without issue.
Now it's asymmetric.

If I'm hosting, he can play with no ups slowdown. He says his ups are at 60.

If he is hosting, the game that I can run at 56 ups drops down to 5.6 ups.

Save file:

https://drive.google.com/drive/folders/ ... eOYvxAMfDF

Screenshot with time usage attached.
Musil
Inserter
Inserter
Posts: 21
Joined: Thu Mar 14, 2019 6:28 am
Contact:

Re: [2.0.21] SegmentedUnit very high CPU usage

Post by Musil »

We fixed the performance issue for us using this admin tool and hiding explored parts of the map. Segmented unit time use went from 6 ms to 0.09.

https://mods.factorio.com/mod/Delete-Ch ... rom=search
GeoStyx
Inserter
Inserter
Posts: 21
Joined: Mon Nov 24, 2014 9:40 pm
Contact:

Re: [2.0.21] SegmentedUnit very high CPU usage

Post by GeoStyx »

Looking forward to this fix - I was really surprised when I checked time usage and it had gone up a ton after exploring for a while on Volcanus. SegemntedUnit is taking up 2.5ms
Enginenilla
Manual Inserter
Manual Inserter
Posts: 1
Joined: Sat Dec 21, 2024 8:32 pm
Contact:

Re: [2.0.21] SegmentedUnit very high CPU usage

Post by Enginenilla »

Sopel wrote: Tue Nov 26, 2024 4:50 pm Yes, it is due to demolishers, that's why I have a mod that kills them, as a workaround to this problem. I should have been clearer, sorry.

Code: Select all

    local big_demolisher = data.raw["segmented-unit"]["big-demolisher"]
    local medium_demolisher = data.raw["segmented-unit"]["medium-demolisher"]
    local small_demolisher = data.raw["segmented-unit"]["small-demolisher"]
    big_demolisher.max_health = 1
    big_demolisher.healing_per_tick = -1
    medium_demolisher.max_health = 1
    medium_demolisher.healing_per_tick = -1
    small_demolisher.max_health = 1
    small_demolisher.healing_per_tick = -1
as someone who never modded before, can you please explain how do i use this?
Sopel
Fast Inserter
Fast Inserter
Posts: 106
Joined: Mon Sep 24, 2018 8:30 pm
Contact:

Re: [2.0.21] SegmentedUnit very high CPU usage

Post by Sopel »

Enginenilla wrote: Sat Dec 21, 2024 8:35 pm
Sopel wrote: Tue Nov 26, 2024 4:50 pm Yes, it is due to demolishers, that's why I have a mod that kills them, as a workaround to this problem. I should have been clearer, sorry.

Code: Select all

    local big_demolisher = data.raw["segmented-unit"]["big-demolisher"]
    local medium_demolisher = data.raw["segmented-unit"]["medium-demolisher"]
    local small_demolisher = data.raw["segmented-unit"]["small-demolisher"]
    big_demolisher.max_health = 1
    big_demolisher.healing_per_tick = -1
    medium_demolisher.max_health = 1
    medium_demolisher.healing_per_tick = -1
    small_demolisher.max_health = 1
    small_demolisher.healing_per_tick = -1
as someone who never modded before, can you please explain how do i use this?
you need to make a data-stage mod
Locked

Return to “Duplicates”