space-wizards / RobustToolbox

Robust multiplayer game engine, used by Space Station 14
https://spacestation14.io
Other
529 stars 394 forks source link

PauseTime is getting serialized for every entity #3870

Open metalgearsloth opened 1 year ago

metalgearsloth commented 1 year ago

@ElectroJr

Looking at a pausing test failure issue (the map is unpaused but isn't yielding any unpaused spawnpoints) though not sure if it's related. https://github.com/space-wizards/space-station-14/pull/14846

ElectroJr commented 1 year ago

Oh. I forgot mapping causes pause time to just accumulate. I guess a fix for this would be to just make pause time not be saved if an entity is in the pre-map-init lifestage?

Or to make IsPaused directly check the lifestage, rather than setting the pause time?

metalgearsloth commented 1 year ago

Could we just add a pausedtime datafield to maps and not serialize the metadatacomponent one? For entities their paused time should always match the map paused time.

Ideally we could just query the map to see if it's paused but I think our ecs is too slow for that.

Edit: Or even have a pausedcomponent and just query that archetype?

ElectroJr commented 1 year ago

Could we just add a pausedtime datafield to maps and not serialize the metadatacomponent one? For entities their paused time should always match the map paused time.

You can currently pause individual entities. Is the plan to remove that & just always tie pausing to the map?