syncronization problem when client and server run different resolutions

Hello.
In my 2d soccer game client sends position x and y of player to server. Have never thought of that before, but if one of them runs different resolution then the clients data wouldn’t be shown right in server. Either he will go off screen (if server has lower res) or couldn’t ever reach the screen (if server has higher res). How are these problems solved? Maybe sending an percentage where player is instead of absolute coordinates, but this could be inprecise?

In such a fast-paced game the server and the client should be ticking at exactly the same interval (like 25 or 50Hz) if you want the server to run accurately.

You should be more worried by lag, than anything else, I suppose.

well yes but that dosen’t solve this resolution problem :wink: … You kind off missed the whole question I asked.
btw. I game ticks at 20Hz for now (testing purposed).

[quote]Maybe sending an percentage where player is instead of absolute coordinates, but this could be inprecise?
[/quote]
yes, do that!
x goes from [0…10000]
y goes from [0…10000]
-> x and y would fit into a short.

do NOT send pixel coordinates!

Arg, I misinterpretated the word “resolution”, I thought clock-resolution, or anything to do with timing, as I think of a server as a headless system without a physical resolution. But you meant… oh well, you know what you meant :slight_smile:

To answer your question, yes, scale the thing appropriately, so that on higher resolutions you just see it bigger. You don’t need to worry about “imprecise” values, as float has more than enough accuracy between 0.0 and 1.0

It would make sense to use an extremely high resolution for the off-screen representation. I.e. 100,000 points on each side or more (unless you use floating points in which case it doesn’t matter). This might seem like overkill, but consider this:

player A moves at 1 unit/frame
player B moves at 2 units/frame

This is the smallest distinguishable speed difference! It amounts to 50 units per second (if you use a normal update rate, i.e. 50 Hz), and if that’s more than a few pixels then your possible speeds in the game are badly quantized!

tnx guys… so I guess I will make resoulution to scale from 0 to 1 using float and adjust game engine to work with that relative coordinates.