Space Engineers

Space Engineers

Automated Inventory Sorting
Kiwa 17 May, 2016 @ 2:27pm
Bug? serious lag spikes
Hello tyrsis,

I am having some serious lag spike problems with one of my worlds, and (unfortunately?) have pinpointed them to this mod. "/sort manual" takes about 8 seconds, and I have further nailed down the problem to the Moon Base. SpaceEngineers version is 01_134_007 Win-64, mod version is the latest greatest, the only other mod in use is a Laser Range mod which doesn't make a difference.

In the original game, the base is a bit larger, with a sizable solar array and a space "elevator" (really just an armor+conveyor tube) attached, but for reproduction purposes, those are not essential -- it can be reproduced with just the reduced size Moon Base. For simplicity, I have also removed most other assets from the save. With one Moon Base, it takes 2 seconds, and with the 3 clones it's about the same as the original game (8 seconds for one "/sort manual"). When automatic sorting is enabled ("/sort toggle"), the lag spikes I am observing are in the same order of magnitude, and when combined with the default interval, make playing almost impossible. I have already tried changing the priorities of the containers to be sequential instead of sharing the same priority for ore, but I think it didn't improve the situation - if anything, it just got worse.

savegame is published here: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=686527066

Do you have any idea what might be going wrong? Do you need additional log files?

One hint my be that it actually also gets worse from simply attaching a long passive conveyor tube, i.e. no "active" parts like containers or sorters, just plain conveyors, so it looks like some... computation may not be scaling too well. And maybe something is computed too often (per sorted container instead of per ship -- the other base in the game, Asteroid Base, has a similar number of non-armor parts/conveyors but fewer containers with sort orders, and that one does not cause such long computation times.)


Best regards,
Kiwa
Last edited by Kiwa; 17 May, 2016 @ 2:38pm
< >
Showing 1-6 of 6 comments
Kiwa 17 May, 2016 @ 2:51pm 
I tried posting a debug log to pastebin, but even the smallest "/sort manual" is already 2 MB, significantly above the pastebin limit :GrumpyLavie:
And the log from 3 minutes auto sorting (at the default interval 5) is about 8.8 MB :rfacepalm:
tyrsis  [developer] 17 May, 2016 @ 9:09pm 
Hmm Keen changed something with definitions and caused this super nasty little issue. Thanks for the save I will fix it.
tyrsis  [developer] 17 May, 2016 @ 11:05pm 
I fixed it a lot, but I'm still not completely happy. Please note that /sort manual happens in the main thread, where as /sort toggle will occur in the background and shouldn't effect sim speed like manual does. Give it a try and see if it helps. For me it didn't touch my sim speed at all after the fixes.
Kiwa 18 May, 2016 @ 12:32am 
Hello tyrsis,

I can confirm the "/sort manual" is now down to about 800 ms, *much* better, thank you :)

Unfortunately I also still observe lag spikes. In the reduced save uploaded above they are only in the order of 2 seconds, but it seems the full save is suffering worse, there I counted one up to 23 seconds (to "measure" I tune up the sound volume and count the time the sound cuts out while sitting in the cockpit and reading a book).

Now, I'ld rather not openly publish the full save because other people have contributed to it, but I have uploaded it "friends only" here: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=686716469 and will send you a friend invite so you can get access to it.

And as always, a big Thank You for all the work that's going into this mod. Many people including me would probably go crazy managing the inventories without it :freesia:
tyrsis  [developer] 20 May, 2016 @ 6:54pm 
I will take a look at it when I can.
Xarniia 26 Jun, 2016 @ 12:28am 
Because I always disable/enable the mod in game, why not the option to sort only („one cycle“) every game save or other timed interval. Perhaps even with pausing the game. This does not fix the performance issue but it makes the mod less clunky to use.
< >
Showing 1-6 of 6 comments
Per page: 1530 50