Space Engineers

Space Engineers

Taleden's Inventory Manager
Reducing script complexity (avoiding script complexity errors with cycle=11)
The basic advice for resolving script complexity errors with TIM is to split up the workload using the cycle argument. With this argument, TIM will split up 11 segments of tasks into separate runs, tasks like reading tags, managing inventory panels, managing production, etc. The maximum number of cycles is 11, where each segment of tasks is run independently. This discussion is for users encountering script complexity errors within a single segment (and thus even when cycle=11 is specified).

In my scenario, I have a base. The base is certainly not small (16 lg. cargo, 18 refinery, 18 assembler, for reference), and is connected to many ships (4 small fighters, 2 small utility ships, 2 large complex ships with their own TIM system). Small ships have TIM tags to allow for certain actions on docking to the base (like refilling ice and uranium, draining ore, and refilling weapons), large ships (with their own TIM) are set up with priorities to allow the same depending on their purpose (mining ship is emptied of ore and filled with uranium, exploration transport is filled with components, uranium, and ice, etc.).

From my work to try and resolve this issue, it seems certain actions taken by TIM based on tags and ship setup drag the script down far more than others. For example, one of the largest performance hits I see is where the script cannot move items, such as 88mm ammo into Mexpex Mk1 Batteries. I've tried to solve this with [TIM FORCE:Mk1_Battery_Small_Mag:200], but with no luck. And it's during the calculation of limited item requests (tag quotas) that TIM locks up. Removing those tags on difficult containers reduces load considerably.

So, one tip to resolving performance issues is to just use [TIM LOCKED] on difficult containers like modded weapons and manually reload. Another is to try and resolve any errors on the debug screen, because errors take more processing than successful tasks. I'm curious what other tips exist (or if anyone's gotten Mk1 Batteries or Light Cannons to load properly).