-
-
Notifications
You must be signed in to change notification settings - Fork 666
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
Refactors parallax subsystem #10924
base: master
Are you sure you want to change the base?
Refactors parallax subsystem #10924
Conversation
@@ -1,34 +1,47 @@ | |||
SUBSYSTEM_DEF(parallax) | |||
name = "Parallax" | |||
wait = 2 | |||
wait = 1 |
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.
It's even faster with wait = 1
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.
It also will get called 2x as frequently, although since its an SS_BACKGROUND system this will result in an increased CPU usage only when there is enough time to spare anyway. The idea for making it wait = 2
was that the slight delay is barely noticable at slow speeds
Going to test this for a round. I will see how this is different. |
Include what you actually did to improve the performance and the methodology behind it, reviewers need to be able to go in and immediately know what you are trying to do rather than be forced to read 500 lines to figure out the intentions |
I kinda forgot it. Addressed now. |
Round 48473, currently on. |
@@ -1,34 +1,47 @@ | |||
SUBSYSTEM_DEF(parallax) | |||
name = "Parallax" | |||
wait = 2 | |||
wait = 1 |
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.
It also will get called 2x as frequently, although since its an SS_BACKGROUND system this will result in an increased CPU usage only when there is enough time to spare anyway. The idea for making it wait = 2
was that the slight delay is barely noticable at slow speeds
wait = initial(wait) | ||
if(throttle_ghost_pop && length(GLOB.clients) >= throttle_ghost_pop) | ||
wait++ | ||
if(throttle_all_pop && length(GLOB.clients) >= throttle_all_pop) | ||
wait *= 2 |
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.
The throttling was probably the most important part of the entire subsystem, the lag mitigation from the enumeration is great, but at high-pops a good majority of the time was spent processing the parallax for ghosts. Ghosts are extremely problematic at high pop because they are extremely fast and extremely plentiful. They cause everyones parallax to get lag mitigated. You really, really, should not delete the freezing of parallax layers for ghosts at high-pop since it will just bring back parallax's running slowly for humans at higher population limits.
Tiny clean up left
I didn't check CPU usage correctly yet. |
Single testing on round |
About The Pull Request
Refactors parallax subsystem
Unless I didn't read the profile wrong, it is 200% efficient than old parallax code.
What's different?
screen_loc
and changing it directlyscreen_loc
has two issues:Initialize()
is enough to handle thistransform = matrix()
to change its location, andscreen_loc = "CENTER-7,CENTER-7"
will never be changedEffectiveness
NOTE
I have no data on how efficient this is on live servers, so I removed some frozen parallax code. I should change that later with gethered data.
Why It's Good For The Game
Bacon has been blaming it, and I figured it was actually awfully coded.
Testing Photographs and Procedure
https://www.youtube.com/watch?v=QhK7EflY1do&ab_channel=EvilDragon
Changelog
🆑
code: improved parallax code
/:cl: