I'm building a cross platform multiplayer game. I'm using pixel graphics and starting at a small 256x144 16:9 aspect ratio That gets scaled up to larger 16:9 resolutions. The graphics look ok however the movement is off. I'm publishing the players x,y coordinates and having other clients subscribe and render the entity based on these. This works in the case of same resolution clients however if the client is at a different scale the movement is off. It does seem consistent though when moving to a 0,0 position.

I've tried taking the published coordinates and applying the scale of the local client to them which seems more accurate. How can I equalize the coordinates across many clients?

  • 1
    \$\begingroup\$ There is not enough information in the question. We could only guess what might be wrong, which would not be very constructive. How are you scaling the coordinates and can you explain what do you mean when you say the movement is off (maybe with pictures)? \$\endgroup\$ – msell May 13 '13 at 5:51

Separate your screen coordinates from your world coordinates. Pick a coordinates system that will accurately represent your position with enough detail. For example, if you're using a 256x144 int coordinate system for your positions, you only have 144 different positions available to you, even when the screen size can display 1080.

You may want to use a floating point coordinate system for more accuracy across larger screens. Whatever coordinate system you use, you'll need to scale it appropriately to the screen size just like you do for your graphics.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.