Skip to content
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

Fix bad streaming performance in some cases #4013

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

TheNormalnij
Copy link
Member

@TheNormalnij TheNormalnij commented Feb 9, 2025

Fixes #813 and #3985

This PR disables streaming for elements that are outside of the current dimension. This increases performance for servers that have a lot of elements in different dimensions.

This PR fixes this bugged scenario too:

  1. A player spawns at 0, 0, 3 position
  2. The gamemode creates a lot of objects
  3. The player has random fps drops on some map positions.

Why it happens:
MTA creates elements in 0, 0, 0 position by default. CClientStreamer adds these elements to the m_ActiveElements list.
MTA updates element positions BUT doesn't remove elements from the m_ActiveElements list.
This causes the situation when m_ActiveElements holds all possible elements and CClientStreamer requests huge O(N*M) operations.

This PR needs some testing.

@TheNormalnij TheNormalnij added the bugfix Solution to a bug of any kind label Feb 9, 2025
@Xenius97
Copy link
Contributor

Xenius97 commented Feb 9, 2025

Sadly this doesn't solve #3985

Debug
https://streamable.com/mxd937

Release - same as before:
https://streamable.com/8zs2m8

@TheNormalnij
Copy link
Member Author

Ok, I optimized element streaming in different dimensions too.

@TheNormalnij TheNormalnij linked an issue Feb 11, 2025 that may be closed by this pull request
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Solution to a bug of any kind
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Huge FPS drops Multiple objects in other dimension cause game stuttering
2 participants