This object is in archive! 

Lag on connector lock/unlock and rotor head attach/detach due to grid group changes

Guest shared this bug 2 years ago
Reported

Game version: 1.200.027

Reproducibility: 100%

Test world and dotTrace analysis available. Root cause determined.

Problem: Lag on connector lock/unlock and rotor head attach/detach due to grid group changes causing massive main thread workload, which could easily be deferred to worker threads with minimal consequences.

How to reproduce:

  1. Load any of the test worlds. They contain two heavy production blocks connecting/disconnecting every second (2 seconds time period in total). One world connects them with two connectors, the other one with a single advanced rotor. Same story.
  2. Just stay next to the grid and watch the simulation thread load (Shift-F11).
  3. Fly around and feel the lag.
  4. Run dotTrace and sample for 10 seconds.
  5. Look for the methods marked in yellow on the attached screenshot.

Solution: Disable MyResourceDistributorComponent.UpdateBeforeSimulation while moving grids between grid groups. Same story for all other related updates which can be triggered by on add/remove event handers. They should be marked for recalculation and a worker thread would do it later. Nobody dies if the conveyor network is not up to date for a few frames.

Replies (2)

photo
1

Test worlds with the timers already enabled. Please use these.

photo
1

Hello, Viktor,

thanks for letting us know. Issue was reported internally.

Kind Regards

Keen Software House: QA Department

Leave a Comment
 
Attach a file