-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
INotifyCenterPositionChanged.CenterPositionChanged pass previous pos and layer #21287
Labels
Comments
AffectsShroud already reduces the amount of updates by caching the center position: OpenRA/OpenRA.Mods.Common/Traits/AffectsShroud.cs Lines 95 to 102 in 0741439
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Idea/Wishlist, Bug
Proposal to allow Shroud - possibly other listeners - to know what the past value of an actor center position was - when it is notified that the center position of an actor changed. If the position was updated - yet the value remained the same - then the Shroud may not require any (expensive) updates.
Or as an alternative do not call
SetCenterPosition
if the value did not change. Or as an alternative - only notify listeners of actual changes.Activities call
Mobile.SetCenterPosition
often/contineously without the position and layer having actually changed.This may be required - to notify players of updates without changes - or more likely a bug.
At the end of the
SetCenterPosition
function all listeners are notified that the center position changed. TheAffectsShroud
traits is one of the listeners which callsUpdateShroudCells
which is a quite expensive function as it needs to look up the projected cells of the actor.This function is called for all actors for each activity for each logic tick. Called often.
Calls to CenterPosition where pos and layer do not change. Last column is
WorldTick
. This is just the start of a bot game. Hence mostly harvesters. But on the shell map you also see it for other type of actors.OpenRA/OpenRA.Mods.Common/Traits/Mobile.cs
Lines 488 to 502 in 0e5447d
OpenRA/OpenRA.Mods.Common/TraitsInterfaces.cs
Lines 77 to 81 in 0e5447d
The text was updated successfully, but these errors were encountered: