Skip to content

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
@Lpsd Lpsd mentioned this pull request Feb 15, 2025
1 task
@Dutchman101 Dutchman101 merged commit 682b02b into multitheftauto:master Feb 15, 2025
6 checks passed
@Dutchman101
Copy link
Member

Thanks, i gave the commit this description: Designed to fix #813 and #3985 (needs to be confirmed in practice). Soon, we will ask feedback from the people in those 2 related issues.

MTABot pushed a commit that referenced this pull request Feb 15, 2025
682b02b Fix bad streaming performance in some cases (#4013)
dcf3ee6 Update client en_US pot
TheNormalnij added a commit to TheNormalnij/mtasa-blue that referenced this pull request Feb 17, 2025
Dutchman101 pushed a commit that referenced this pull request Feb 17, 2025
* Revert "Fix bad streaming performance in some cases (#4013)"
This reverts commit 682b02b.

* Revert "Fix streaming crash (#4030)"
This reverts commit 003b001.
@TheNormalnij TheNormalnij deleted the TheNormalnij/fix_streamin_endless branch February 19, 2025 13:40
@Xenius97 Xenius97 mentioned this pull request Sep 21, 2025
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

3 participants