Multiplayer
Multiplayer copied to clipboard
Improvements to VTR implementation
The current implementation is working fine, but it could use some possible improvements. Here's a list of possible improvements/changes we could add (that I could think of):
- [ ] Expose Multiplayer's VTR handling to the API
- Perhaps our implementation of
GenTicks.GetCameraUpdateRatemethod, as well as a an additional method that checks if any player is on the world map, with perhaps some others? (Extra method with map position as an argument?)
- Perhaps our implementation of
- [ ] Track players on the world map, and apply VTR appropriately if there's at least 1 player viewing the world
- Currently, everything on the world (except for gravships and transport pods/shuttles/etc.) is using a VTR of 15. This will allow us to always apply highest VTR rate on the world, and dropping it to 1 if the world is open.
- This would also ensure we don't need special compatibility for different mods whose world objects would misbehave when actively observed with VTR of 15
- [ ] Replace tracking of player counts with tracking on players
- For the sake of extra safety, we could add checks for things like - each player is assigned to the world/a specific map, none of the players is assigned to two of them, checking if a disconnected player is assigned, a client could check if they are assigned to a correct location, etc.
- [ ] (A bit of a long shot, but...) Keep track of camera positions of each player (perhaps with an option to disable it?), updating their camera data periodically, and using it for determining if VTR should apply to a specific Thing or not
- This would allow us to benefit more from VTR, especially in a single map situations. Only the things that are visible would would have VTR disabled.
- We could also apply this to the Anomaly's Unnatural Corpse event
- [x] Rename all references from map index to map ID (
InvalidMapIndex), since our implementation uses map IDs rather than indices