Advertisement

What is the proper math to compress properly player position in a best possible way?

Started by June 08, 2023 07:34 PM
10 comments, last by hplus0603 1 year, 5 months ago

Alundra said:
The goal is to understand a proper or acceptable default for a game engine.

Unfortunately, you'll have to pick one mechanism, and implement that. That's never going to be acceptable for all games. This is why game engines end up having “flavors.”

For example, GGPO uses deterministic (re-)simulation, whereas Unreal Engine uses quantized player position replication.

There's also the question of how large your coordinate system is – a large streaming world that requires more than 32-bit floting point coordinates, will have a different solution.

It also depends on what your particular goal is – if you do 8-player matches with 30 updates per second, using doubles for X/Y and a float for Z, will take up 20 bytes per player, which will be (8*20*30) bytes per second per player, or about 4.5 KB/sec. That's not a particularly terrible data rate, so if that's the default for your engine, it'll work well enough for most cases, and has the benefit of being super simple to implement. Cutting that in half would be “nice” but not necessarily a top priority. Again, entirely depending on gameplay aims/needs.

enum Bool { True, False, FileNotFound };

This topic is closed to new replies.

Advertisement