-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
feat(gameState): Add relevant players culling native #2998
base: master
Are you sure you want to change the base?
feat(gameState): Add relevant players culling native #2998
Conversation
void SET_PLAYER_CULLING_RELEVANT_PLAYERS(char* playerSrc, int playerTarget); | ||
``` | ||
|
||
Sets the culling relevent players list for the specified player. |
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.
"Relevent" typo
This reveals internal bits to the client which is already very bad since it would break expected behavior down the line if any of this ever changes, but on top of that this code is all wrong, which makes me thing that it wasn't actually tested. |
The purpose of this PR is to have feedback on what can be done. I already have open PR before https://github.com/citizenfx/fivem/pull/1896/files with non constructive discussion. |
I understand why some might find a functionality like this useful. However, I don't believe it's a viable solution to the core issue of the limited number of players a client can process. While the internal overhead introduced by the bit-tests might be acceptable, the overhead in ScRTs could be problematic. For instance, if someone uses this feature to implement custom culling with prioritization for players near a target client, it would necessitate high-frequency updates and checks. This would involve invoking different natives for each player, which could significantly impact performance on servers with higher player counts (where such functionality would be most needed). Given that these servers often already struggle to maintain the target tick rate, this approach could potentially only worsen the situation. |
The main issue is to not slow down the sync thread to prioritise culled players. you have more advanced knowledge on the subject. How we can achieve this decently ? Can we try in production with beta build like It’s done in experimental forum ? |
It will most likely create ownership issues for entities controlled by "out-of-scope" players |
We already have ownership issue with curling radius, and we deal with it with workarounds |
That isn't exactly a good reason to add something else that could lead to more unknown/weird issues. |
Goal of this PR
The game has a hard cap on displaying culled players (128 for FiveM, 32 for RedM).
This native allows server owners to control which players can be seen by others.
Since the culling radius does not prioritize displaying the closest players, this native allow server owners to implement their own logic to filter culled players.
How is this PR achieving the goal
Add native to set players net ids list for each players to be culled
This PR applies to the following area(s)
Server
Successfully tested on
Windows
Checklist