-
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
Combine Shroud.(Add|Remove)Source into UpdateSource #21403
Labels
Comments
The source should only be removed and re-added when the position of the actor changes (afaik we already do that), and in that case we do need to since the revealed area changes. |
Here it doesn't. Results in full removal and addition. OpenRA/OpenRA.Mods.Common/Traits/AffectsShroud.cs Lines 132 to 133 in c63be29
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Profiling shows that rougly 2-3% of time is spent updating Shroud. They are hotspots next to running move activitied.
RemoveSource
andAddSource
and are typically called in sequence.Remove
removes the source from a hashmap andAdd
directly adds it again after.Proposal to add
UpdateSourceCells
method inAffectsShroud
and similar traits to take advantage of this method.Benefit:
Some profile results of a 16x16 replay:
The text was updated successfully, but these errors were encountered: