Skip to content
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

Update frozen actors only when required. #20156

Merged
merged 1 commit into from Aug 7, 2022

Conversation

RoosterDragon
Copy link
Member

Previously, actors that were visible would refresh their frozen actor state every tick in preparation for the actor becoming hidden, and the frozen actor appearing as a placeholder instead.

By using ICreatesFrozenActors.OnVisibilityChanged when can avoid refreshing the state constantly, and instead just refresh it the moment the frozen actor needs to appear. This provides a nice performance improvement on the cost on managing frozen actors.


On the RA shellmap, reduces CPU time spent in UpdateFrozenActor from 5.1% to <0.1%.

I have also tested that when using the starting a game with Explored Map enabled, that pre-existing frozen structures are visible and targetable, e.g. engineers can be ordered to capture an oil derrick under the fog. We shouldn't have a repeat of the bug fixed in #16194 despite the similar code.

Mailaender
Mailaender previously approved these changes Aug 3, 2022
Copy link
Member

@Mailaender Mailaender left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't spot problems in-game.

Previously, actors that were visible would refresh their frozen actor state every tick in preparation for the actor becoming hidden, and the frozen actor appearing as a placeholder instead.

By using ICreatesFrozenActors.OnVisibilityChanged when can avoid refreshing the state constantly, and instead just refresh it the moment the frozen actor needs to appear. This provides a nice performance improvement on the cost on managing frozen actors.
@abcdefg30 abcdefg30 merged commit bbf5970 into OpenRA:bleed Aug 7, 2022
@abcdefg30
Copy link
Member

Changelog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants