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
Overhaul MapPreview rule loading #19317
Conversation
I realized while writing the PR description that I have forgotten to add a new lint rule to enforce the new World and Player inheritance restrictions. |
dbfc997
to
07ffecd
Compare
81b8ca7
to
14d6b7b
Compare
Updated. I have added the missing lint test and also bumped the orders protocol to avoid breakage from the alternative server implementation. |
Hm, not on my system, opening the mission browser in RA is virtually instant here with no noticable lag on UI or shellmap afterwards (Win10, Ryzen 3600, 16GB DDR4-3200, SATA SSDs only). Doesn't change that this overhaul is certainly justified, I just won't be able to test the performance difference since I can't reproduce the perf issue on bleed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't see any issues glancing over the code and mission/skirmish browsers still work fine for me
Hmm, odd. This is what it looks like for me on current bleed: Screen.Recording.2021-04-05.at.13.29.40.movThis only started relatively recently, not sure if it was due to the switch to .NET5, due to all the new missions we've merged over the last year, or something else. In any case, this PR puts an end to it. |
14d6b7b
to
01261e4
Compare
Updated:
|
Needs rebase. |
01261e4
to
f628e3a
Compare
Rebased. |
Now needs a rebase/update for #19239. |
f628e3a
to
181e554
Compare
Rebased. |
This allows text to be displayed earlier in the loading screen.
181e554
to
ce2ed6a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also looks like public enum MapRuleStatus
in MapPreview is not used.
The previous asynchronous approach did not work particularly well, leading to large janks when switching to custom maps or opening the mission browser. This commit introduces two key changes: * Rule loading for WorldActorInfo and PlayerActorInfo is made synchronous, in preparation for the next commit which will significantly optimize this path. * The full ruleset loading, which is required for map validation, is moved to the server-side and managed by a new ServerMapStatusCache. The previous syntax check is expanded to include the ability to run lint tests.
ce2ed6a
to
b637415
Compare
Updated. |
This PR reworks the way MapPreview handles custom rules, with two major goals in mind:
Fix the atrocious performance issues with the mission browser. On my system, and I suspect most others, opening the mission browser will trigger unusable performance on the shellmap for 10+ seconds while the mission rules are cached in the "background" (doesn't feel very background to me).
Require maps to pass the lint checks before dedicated servers will allow them to be used. This is responding to the flood of crash reports and complaints from the competitive community caused by copying the previous generation RAGL maps into release-20210321 without verifying that they were actually compatible (they weren't).
The first point is achieved by replacing the general Ruleset parsing with focused parsing for just the world and player definitions, which cuts the parse time for mission/custom maps from ~250ms to ~25ms each. This is small enough to get away with removing the asynchronous code completely, and load the rules up-front at the cost of only 1-2s of additional startup time in RA (less in the other mods).
The previous (very limited) rule syntax checks in the lobby were not compatible with this new approach, so they are moved to the server using a new
LobbyInfo.GlobalSettings.MapStatus
field to relay the result back to the clients. This decoupled approach makes it easy to add additional and longer checks, so I scope creeped a solution to the second point while I was here.If we can get this merged within a reasonable timeframe I expect to work on a second PR that would bring the "map not available on server" handling
under the same system(edit: ended up taking a different approach), which would then naturally extend to supporting server-side map allow/deny lists to make @ubitux's life easier with managing the map pool on the competitive servers.I strongly recommend reviewing by commit, which makes it a lot easier to understand the different parts of this.