Fixed big lag spike with the chargejump#3
Open
TheSkerchh wants to merge 2 commits intoHyperboid:mainfrom
Open
Conversation
- The Player now stores a table of nearby climbareas every frame so that it wouldn't have to check every climbarea on the map each time it checks onClimb
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.
See I was making a really big room with like 100 climbareas and the climbing chargejump started lagging a lot.
I look into it and turns out the chargejump calls canClimb for every segment for every frame while you're charging it.
Since canClimb loops through every event (a hundred in my case) on the map to check if you can climb it, this causes a lot of lag.
So now this changes the Player hook to store a table of all of the climbareas in a certain range of the player, this reduces it from amount of segments loops to 1 loop(with one smaller one that goes through the closeby climbareas)
This seems to have reduced the amount of lag by a noticeable amount, to the point you almost cannot feel it at all.
Take this as your funnyfeline teaser of the month.