[1.3.3087 Ideology + Royalty] Auto Slaughter menu lags with extra animals

Started by Kirona, August 11, 2021, 09:38:52 PM

Previous topic - Next topic

Kirona

I've found that with any mods that add in more animals, this results in decreasing performance whenever the auto-slaughter menu is open. With a straight vanilla game, I get 60FPS with it open, or with it closed. If I add any mods that increase the variety of animals though, this menu gets incredibly laggy.

The best example is with Alpha Animals, which adds a huge number of new animals. Performance generally remains at 60FPS with this mod enabled, but the auto-slaughter menu drops to a steady 9FPS. This doesn't seem to be related to the mod itself however, as other mods which add more animals have the same issue to varying degrees - it seems to depend only on how many animals are added.

I'm wondering if the auto-slaughter menu is iterating through the entire table of animals every tick instead of just once when it's opened, or something? I'm not sure, but it seems odd for this much lag to occur within one specific menu due to mod content, but not across the board.

HOW TO REPRODUCE:
The easiest method is to install and activate the Alpha Animals mod along with its prerequisites - Harmony, and the Vanilla Expanded Framework. Then start a new game, storyteller/worldgen/etc. doesn't matter. Once you're in, click the Animals menu, then Manage Auto-Slaughter. The framerate will drop considerably while this menu is open. Close the auto-slaughter menu and framerate will return to normal.

I've attached a log file after doing the above.

Canute

Hi,
yep it is prolly based on the Framework that Alpha Animal use. Other animal mods don't have these lag.
I made a comment at Github, but it isn't gamebreaking and the game pause anyway during that process, so no big deal to live with it until it is maybe fixed.

Kirona

As I've said in the original post, it doesn't just happen with Alpha Animals, just that it's most noticeable because of how many animals that mod adds. Simply adding the Vanilla Framework Extended mod doesn't generate this lag, either, so it's not the framework to blame.

However, since posting this I've found a mod on Steam that completely fixes the issue for me, found here, which describes an issue with optimization in list-type UIs in general, the worst offenders being the auto-slaughter menu and the "debug spawn item table."

SetArk

Hail!
Just dropping in to say that i'm having the same problem, but i found the mod Speed Up Ui (https://steamcommunity.com/sharedfiles/filedetails/?id=2572389073) to fix the problem
This mod says it's optimizing the code so, maybe it's something on how the animal list are gathered?

To be honest, i don't know why the Auto-Slaughter list must have all the animals loaded on the game.
I think most people would just set the Auto-Slaughter when they tamed some animals, so why not make the Auto-Slaughter only show maybe the animals on the map?

Kirona

Quote from: SetArk on August 16, 2021, 11:18:49 AM
Hail!
Just dropping in to say that i'm having the same problem, but i found the mod Speed Up Ui (https://steamcommunity.com/sharedfiles/filedetails/?id=2572389073) to fix the problem
This mod says it's optimizing the code so, maybe it's something on how the animal list are gathered?

To be honest, i don't know why the Auto-Slaughter list must have all the animals loaded on the game.
I think most people would just set the Auto-Slaughter when they tamed some animals, so why not make the Auto-Slaughter only show maybe the animals on the map?

That's the mod I linked in my last post x) But maybe Auto-slaughter lists all the animals in case someone wants to set it all up ahead of time? Either way, if this mod can fix the lag entirely without having to limit the menu in other ways that's good enough for me.