From: <no...@so...> - 2001-11-26 22:37:22
|
Patches item #485796, was opened at 2001-11-26 14:08 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=303248&aid=485796&group_id=3248 Category: BZFlag Group: None >Status: Closed >Resolution: Accepted Priority: 6 Submitted By: Frank Thilo (chestal) Assigned to: Tim Riker (timriker) Summary: reduce number of MsgGrab msgs Initial Comment: Whenever a tank drives over a flag it sends a MsgGrab message to the server. When the server thinks it is ok for the player to have the flag, it responds with another MsgGrab message. Due to network latency the client may send additional MsgGrab pleas before the server reply is received. On average lag / framerate messages will be sent, where lag is round-trip time for the messages. For very fast clients with high framerates and some lag this can cause lots of messages to be sent for a single flag (e.g. framerate = 200 fps and lag = 500ms -> 100 messages). Obviously, this is not a good idea. My patch fixes this with a simpel heuristic. As usual, all flags are checked for being pickup-able and a MsgGrab msg is sent for each for which this holds true (usually none or a single flag, but on rare ocassions, it might be 2 or mroe flags). After that, no more MsgGrab msgs will be sent for another 0.2 seconds. So, at most 5 messages per second will be sent; depending on the lag, no more than 1 or 2 messages will be sent for most players. The constant 0.2s was chosen arbitrarily. Increasing it reduces the number of messages, but making it too large could affect gameplay. ---------------------------------------------------------------------- >Comment By: Tim Riker (timriker) Date: 2001-11-26 14:37 Message: Logged In: YES user_id=8134 was not against CVS.... ;-) applied anyway. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=303248&aid=485796&group_id=3248 |