Skip to content

Fixed big lag spike with the chargejump#3

Open
TheSkerchh wants to merge 2 commits intoHyperboid:mainfrom
TheSkerchh:chargejump-lagspike-fix
Open

Fixed big lag spike with the chargejump#3
TheSkerchh wants to merge 2 commits intoHyperboid:mainfrom
TheSkerchh:chargejump-lagspike-fix

Conversation

@TheSkerchh
Copy link
Copy Markdown

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.

- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant