multitheftauto / mtasa-blue

Multi Theft Auto is a game engine that incorporates an extendable network play element into a proprietary commercial single-player game.
https://multitheftauto.com
GNU General Public License v3.0
1.41k stars 438 forks source link

Controlling player synchronization #658

Open CrosRoad95 opened 6 years ago

CrosRoad95 commented 6 years ago

Is your feature request related to a problem? Please describe. For big server ( with 100+ players ) default synchronization players cause unnecessary lags

Describe the solution you'd like Introduce function for controlling this things. functions for:

  1. enable / disable default synchronization player with player
  2. setting which player should sync with which player ( normal,lightweight, none )
  3. manual synchronization, player A now become synchronized with player B ( once )

Describe alternatives you've considered /

Additional context Example usage, problems with current

  1. you have RPG server with jobs system in interiors, why X players in interiors need to by synced with others outside interior ?
  2. race server, you have X races at one time, players from Race 1 don't need know where are players on Race 2, 3 etc.
  3. dayz server, i had many of theirs, and when someone sniper scoping, they saw player teleporting,
Addlibs commented 6 years ago

Unoccupied vehicle sync is only sent to clients in the vehicle's dimension[1]. Perhaps player sync could be done in a similar way (with exceptions like element data sync). These might require a resync packet like vehicles[2], when changing dimensions, to sync up any changes that weren't synced to the clients of the new dimension.

I believe this would be sufficient to disable sync between players of different lobbies/gamemodes on the same server.

Einheit-101 commented 6 years ago

manually changing sync method would be good because on my server there is a high draw distance and players in large vehicles (ships, bombers) should be synced "normal" with everyone around up to 1500m distance.

msonnemans commented 6 years ago

A worst case scenario with a lot of players spread out in the same dimension would also have unnecessary syncing, but not only with players. Peds and unoccupied vehicles are synced even across the map, so perhaps just the dimension as a seperation isn't enough and distance would be a neat optional feature.

This would extend your 3 functions to also include peds and unoccupied vehicles besides players