Answer the question
In order to leave comments, you need to log in
ActionScript 3.0 and XMLSocket?
Good afternoon, I ran into a problem. we are writing a real-time game, two objects appear on the map, which the players control and move around it, one object - one player, control using the keyboard. Object coordinates are transferred between clients (players) using XMLSocket, the server part is written in Python
Everything is perfectly transmitted, objects move, but on the client, the object controlled by another client (that is, whose coordinates are received from the server to this client) “lags”, move in jerks, and this phenomenon is not constant, the movement is either smooth, as it should be, then “lags”, the coordinates of this object are updated when new data is received on the advice (sp Socket Data event). Data is sent when updating frames (Enter Frame event), 24 frames per second, I also sent it using the Timer, setting the value of sending coordinates up to 1 ms (1000 requests per server per second), which by the way gave a small positive effect, but that's all there are still podlagivanie.
Ping to the server is on average 30-33 ms, it seems to be all right. Has anyone encountered such a problem?
Answer the question
In order to leave comments, you need to log in
The problem is standard for any RealTime games.
1. Minimize traffic, use trajectory prediction.
2. Use the id of the event in the network and queue, maybe you have several events happening in a different order
Thanks to all. The problem turned out to be that the server delayed and accumulated data and then sent it in batches to another client, 2-12 pieces at a time.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question