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

Map size limits #3347

Open jordskjelvv opened 7 months ago

jordskjelvv commented 7 months ago

Is your feature request related to a problem? Please describe.

map is limited to 16 000x 16 000 meters. Boat stops going for passanger glued on vehicle at 7 000 meters while it goes forward for driver

Describe the solution you'd like

We are developing Stars And Stripes, and hope to make it running in MTA. map is 12 times bigger than original map. Liberty city is located at 48 000 coordinates there

Describe alternatives you've considered

No response

Additional context

GTA-SS

Security Policy

NanoBob commented 7 months ago

For reference:

This issue exists because (player, among other) positions are sent in sync packets in a structure where every floating point number is encoded to 3 bytes, 14 bits for the integer part, and 10 for the fraction. This 14 bits integer part results in a limit of -8192 to 8191.

Interestingly MTA only does this "optimisation" for the X and Y coordinate in a vector, the Z coordinate is frequently sent as a full float (32 bits, 4 bytes).

Fixing this would require changing this among any place where we use this structure, potential fixes would include:

Changing this would most likely mean new bitstream version, meaning players need to update.
It might be worth making this configurable, so a server can choose for a lower limit but more accuracy, or just less bandwidth usage.

Some details on the limitations can be found here