Use Array.IndexOf to speed up Shroud.Tick.#21185
Merged
Merged
Conversation
PunkPun
reviewed
Nov 4, 2023
PunkPun
left a comment
Member
There was a problem hiding this comment.
Using /all a second time now blinds you. Even when you have explored map option enabled
6c751dd to
1af2c7a
Compare
Member
Author
Looks like an existing issue on bleed, as using the |
1af2c7a to
179bfa2
Compare
As the `touched` cell layer uses Boolean values, Array.IndexOf is able to use a fast vectorised search. Most values in the array are false, so the search is able to significantly improve the performance of finding the next true value in the array.
Disabling the shroud is sufficient to allow seeing the map. This fixes a game with the "Explored Map" option enabled. Previously using the `/all` command twice to toggle it on and off again would also reset the shroud, causing the map to no longer be explored. Now, using it twice will cause the map to remain explored, as intended when the "Explored Map" option is enabled.
179bfa2 to
18d4ce9
Compare
Member
|
Oh hmm, it looks like this issue in in the current release as well |
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As the
touchedcell layer uses Boolean values, Array.IndexOf is able to use a fast vectorised search. Most values in the array are false, so the search is able to significantly improve the performance of finding the next true value in the array.Review with ignore whitespace for a cleaner diff.
Running this replay at max speed on commit 5157bc3 gives the following performance improvement. ra-2023-11-04T105726Z.zip
Before
After