space-wizards / RobustToolbox

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

Consider making `EntityLookupSystem`'s `LookupFlags` non-optional #5235

Open ElectroJr opened 3 weeks ago

ElectroJr commented 3 weeks ago

The default LookupFlags argument used by EntityLookupSystem almost always returns far more entities than a specific lookup needs. After looking around for a bit, the cases where the default value gets used are typically just instances where I guess people forgot to or just didn't know they should have used them.

Forcing them to be specified should just help avoid trivial performance reducing mistakes.

metalgearsloth commented 3 weeks ago

So having look at a profile from CM14 the 2 biggest source of performance issues are not setting approximate and including containers.

Ideally we'd still keep "All" around, maybe removing contained entities from it, and then just make it non-optional I guess.