Open Legende04 opened 3 weeks ago
You could try using the Simple Mod Profiling mod to try and determine the cause of the stutters. when you tell it to, it will collect and then display the amount of time each of the installed mods spent running their code which should give you a good indication of what's causing the most lag
I already did, thats why I found out it could be because of this particular mod
Profiling Complete!
Total: 2380,0201ms
├─[Benevolent Sprites] Total: 1279,3984ms
├───[BenevolentSprites.BenevolentSprites::Void Update()] = 1260,5227ms
├───[BenevolentSprites.SpriteRenderer::Void Update()] = 18,8757ms
├───[BenevolentSprites.Patch_GetLanguageIndex::Void Postfix(I2.Loc.LanguageSourceData, Int32 ByRef)] = 0ms
├─[Benevolent Sprites > Inventory Caching] Total: 391,3644ms
├───[BenevolentSprites.BenevolentSprites::Void Update() > Patch_GetItemCount::Void Prefix(Inventory, Item_Base, Int32 ByRef, Boolean ByRef)] = 386,3987ms
├───[BenevolentSprites.BenevolentSprites::Void Update() > Patch_GetItemCount::System.Exception Finalizer(System.Exception, Inventory, Item_Base, Int32, Boolean)] = 1,9859ms
├───[BenevolentSprites.BenevolentSprites::Void Update() > Patch_ItemInstance::Void ctor_Postfix(ItemInstance)] = 1,4903ms
├───[BenevolentSprites.BenevolentSprites::Void Update() > Patch_Slot::Void SetItem_Prefix(ItemInstance, Slot)] = 0,9928ms
├───[BenevolentSprites.BenevolentSprites::Void Update() > Patch_ItemInstance::Void set_Amount_Postfix(Int32 ByRef, ItemInstance)] = 0,4967ms
├───[BenevolentSprites.BenevolentSprites::Void Update() > Patch_ItemInstance::Void Clone_Postfix(ItemInstance)] = 0ms
├───[BenevolentSprites.BenevolentSprites::Void Update() > Patch_Slot::Void RefreshComponents_Prefix(Slot)] = 0ms
├─[Statistic Mod] Total: 299,4905ms
├───[StatisticMod.Patch_LookingUpdate::Void Postfix(Pickup)] = 267,2065ms
├───[StatisticMod.HealthBar::Void Update()] = 12,9119ms
├───[StatisticMod.HUDText::Void Update()] = 5,4661ms
├───[StatisticMod.SharkIndicator::Void Update()] = 4,9655ms
├───[StatisticMod.CenterPointer::Void Update()] = 2,4832ms
├───[StatisticMod.Patch_CanvasHelper::Void Update(CanvasHelper)] = 1,9865ms
├───[StatisticMod.StatDisplay::Void Update()] = 1,49ms
├───[StatisticMod.HUDEquipmentDisplay::Void Update()] = 1,4899ms
├───[StatisticMod.Compass::Void Update()] = 0,9938ms
├───[StatisticMod.TimeBar::Void Update()] = 0,4971ms
├───[StatisticMod.Patch_BatteryDisplayText::Void Prefix(System.String ByRef)] = 0ms
├───[StatisticMod.UILine::Void Update()] = 0ms
├─[Building Utilities] Total: 90,9015ms
├───[StackablePlaceables.Main::Void Update()] = 90,9015ms
├─[Wired Batteries] Total: 60,5881ms
├───[WiredBatteries.Patch_Battery::Void CanGiveElectricity(Battery, ItemInstance, Boolean ByRef)] = 50,6554ms
├───[WiredBatteries.MeshPathBaseParent::Void Update()] = 8,9394ms
├───[WiredBatteries.Patch_Battery::Void NormalizedBatteryLeft(Battery, Single ByRef)] = 0,9933ms
├───[WiredBatteries.Patch_Battery::Void BatteryUses(Battery, ItemInstance, Int32 ByRef)] = 0ms
├───[WiredBatteries.Patch_GetLanguageIndex::Void Postfix(I2.Loc.LanguageSourceData, Int32 ByRef)] = 0ms
├───[WiredBatteries.Patch_Battery::Boolean Update(Battery, ItemInstance, Int32)] = 0ms
├───[WiredBatteries.Patch_Battery::Void Update_post(Battery)] = 0ms
├─[Better Steering Wheel] Total: 33,2764ms
├───[Whitebrim.BetterSteeringWheel.BetterSteeringWheel::Void FixedUpdate()] = 33,2764ms
├─[ModUtils] Total: 27,8142ms
├───[ModUtils.Main::Void Update()] = 27,8142ms
├─[AutoSorter] Total: 13,9084ms
├───[pp.RaftMods.AutoSorter.CStorageBehaviour+1[System.ValueTuple
2[Item_Base,Item_Base]] ModUtils_BuildMenuItems()] = 0ms
├─[Statistic Mod > ModUtils > Pipe Through Blocks] Total: 0ms
├───[StatisticMod.Patch_CanvasHelper::Void Update(CanvasHelper) > ModUtils.ModHandler::Void int_ReloadBuildMenu() > PipeThroughBlocks.Main::System.Collections.Generic.List1[System.ValueTuple
3[Item_Base,Item_Base,System.Boolean]] ModUtils_BuildMenuItems()] = 0ms
├─[Glass Walls] Total: 0ms
├───[GlassWalls::Void Update()] = 0ms
├─[Wired Batteries > Electricity Mod > Wired Batteries] Total: 0ms
├───[WiredBatteries.Patch_Battery::Boolean Update(Battery, ItemInstance, Int32) > ElectricityMod.Patch_BatteryUpdateDisplay::Void Postfix(Battery) > WiredBatteries.Patch_Battery::Void NormalizedBatteryLeft(Battery, Single ByRef)] = 0ms
├─[Wired Batteries > Electricity Mod > Misc Cheats] Total: 0ms
├───[WiredBatteries.Patch_Battery::Boolean Update(Battery, ItemInstance, Int32) > ElectricityMod.Patch_BatteryUpdateDisplay::Void Postfix(Battery) > MiscCheats.Patch_ItemMaxUses::Void Postfix(Item_Base, Int32 ByRef)] = 0ms
├─[Wired Batteries > Electricity Mod] Total: 0ms
├───[WiredBatteries.Patch_Battery::Boolean Update(Battery, ItemInstance, Int32) > ElectricityMod.Patch_BatteryUpdateDisplay::Void Postfix(Battery)] = 0ms
├─[Wired Batteries > Misc Cheats] Total: 0ms
├───[WiredBatteries.Patch_Battery::Boolean Update(Battery, ItemInstance, Int32) > MiscCheats.Patch_ItemMaxUses::Void Postfix(Item_Base, Int32 ByRef)] = 0ms
├─[Mirrored Engines] Total: 0ms
├───[MirroredEngines.Main::Void Update()] = 0ms
├─[Pipe Through Blocks] Total: 0ms
├───[PipeThroughBlocks.Main::Void Update()] = 0ms
├─[SadPause] Total: 0ms
├───[SadPause::Void Update()] = 0ms
├─[ModUpdater] Total: 0ms
├───[ModUpdater+
how long did you run the profiling for? and what's your normal framerate
10 seconds framerate is about 50-60 right now (I have Vsync off and limited it to 60)
That was my Task manager yesterday, so I think it should not be the specs of my PC
ok yeah, that would mean the sprites mod is adding about 2.13 ms per frame. at 60 fps there's only 16.67 ms per frame so that's a big portion. how complex is your raft? and what types of sprites do you have
That was my Task manager yesterday, so I think it should not be the specs of my PC
the main spec that matters with unity games is the speed of an individual core of the CPU (yours is 4.3 GHz which is fine)
I have a pretty Big raft acc. to statistics mod 510 foundations, all kinds of sprites working, imma count them for you
if you've got a lot of objects the sprites can interact with then it's kinda expected that they'd cause more lag... that said, i've done a number of tests myself in regards to having really high numbers of sprites and objects for them to use for the purpose of stress testing and never got a significant dip in performance.
perhaps it's a specific machine(s) that cause more lag than others...
4 Fire (Cooking Pot) ones 7 Fire at a Grill (somehow they often forget to pick up the grilled items, even though the chest is empty) 4 Fire at the Smelter 3 cleaners at Fishing and Collection Nets 4 Cleaners for 3 Electric Dredgers 3 Gardeners for Trees 5 Animal (for abt 7 Animals) 5 Mechanics for Recyclers
I also have 56 Collection nets and 1 Fishing net, maybe that is important
that doesn't look like anything they would struggle with... if i had to guess, i'd assume the reflection overhead from trying to interact with the other modded blocks is probably the main cause of the performance issue
thanks for the info, i'll do some tests myself and see if i can narrow it down and/or fix it
My sprites interact with: 9 Advanced Large Crop Plots Juicer Cooking Pot Electric Grill(but the lags were at the advanced grill aswell) 3 Recycler 3 electric Dredger 2 electric Smelters
I use electric Engines so nothing there to do I also don't have things like refiners which could be interacted with even though I do not Intend them to
Should I send you the world to make testing easier? (if sending worlds works)
sending the world will help.
my theory of the dredger reflection being the issue appears to be incorrect
could that be the case because I increased its speed? I made the manuals 25/100 and the electrics 50/100 speed, usually both is at 5 2024.10.28-15.45.zip The world is called "Happy Island"
Mods:
the lag appears to mainly be occuring when the sprites are depositing items in their chest.
i suspect this is a side effect from another mod i made. i'll continue investigating, just giving you an update
nice, maybe because of the autosorter mod?
I mean, if I remember right, the lags were before I upgraded the chests to be an autosorter, but I am not sure
ok. most of the lag spikes occur when sprites are looking for new targets. it doesn't seem to always happen. but occasionally they take 200+ ms to check for a new target which is really high for a single frame. however most of the time they take less than 10 ms so the next thing is to figure out why they sometimes take a lot more time
Okay interesting, and does it happen to specific sprites do you know that?
Hey are there any news on that?
i've been a little busy recently so haven't had much time to work on it.
i've made improvements to some of the sprites but the cooking pot sprites are still getting big spikes that i'm trying to fix
I don't know why, but since I added the mod it started lagging, there are no remarkable FPS drops or sth, the game just freezes for a milisecond. my PC does have the specs to run raft with the mods easily and I also checked my task manager about the performance and in there everything seems fine, so maybe you can help me