Sign in to follow this  
Followers 0
Telanor

Network input handling

124 posts in this topic

I doubt any physics engine would be able to handle rewinding in our situation. We have a dynamic world. Rewinding would mean saving and recreating the world itself. It's already expensive enough just creating it the first time. Recreating it several times in a single tick.... would be impossible. Not to mention the memory requirement of storing the world state.

I feel that a delta correction could certainly work in our situation *if* we could reliably get a list of all positions the client has moved through between the time the calculation error occurred and the time it received the proper location from the server. I just can't figure out how to do that given the client's tendency to have the current tick jump around. I guess part of the problem is that I don't know what issues it should be able to handle and what issues are external problems that need to be fixed in order for this system to work correctly.
1

Share this post


Link to post
Share on other sites
[quote]just can't figure out how to do that given the client's tendency to have the current tick jump around.[/quote]

If the client's tick jumps around, you do not have sufficient de-jitter buffering. You can take a clock skew as a signal to not let input happen until the clock is re-synchronized. The server telling you to jump ahead 1 tick or back 1 tick can be solved by just stepping twice, or delay one step; any bigger corrections (once initial sync has happened) means you're doing something wrong, or running on an incredibly terrible network infrastructure (at which point: more de-jitter buffering!)
1

Share this post


Link to post
Share on other sites
Well, I'd probably guess I'm doing something wrong then. Connecting to the server from the same computer, I get tick offsets of around +/-4 when moving around. Probably due to loading that occurs as you move further out. I'll play around with trying to reduce that. What do you mean by de-jitter buffering though?
0

Share this post


Link to post
Share on other sites
[quote]What do you mean by de-jitter buffering though? [/quote]

A de-jitter buffer is a queue of incoming messages. The server then asks the queue "get me all messages for step X" and gets those for processing.
The time adjustment sent to the client is such that messages go into this buffer slightly earlier than they are asked for. How much earlier is a tunable parameter, and the earlier you send messages from the client (i e, the more lag compensation you apply in the queue, not just for the transmission time,) the more jitter your server can take without "running out" of packets for timestamp.
Same thing on the client receiving side.
The draw-back of this buffering is that it adds artificial lag, to compensate for jitter and get a smooth delivery of packets.
If the server or client code cannot keep up with your given step rate, and hitching because of loading or whatnot is common, then more de-jitter buffer is exactly what you need, because the end-to-end system (including processing of steps) is very jittery, and to get a smooth experience, you need to have sufficient buffering to cover that.
1

Share this post


Link to post
Share on other sites
[quote name='hplus0603' timestamp='1355685960' post='5011326']
[quote]What do you mean by de-jitter buffering though? [/quote]

A de-jitter buffer is a queue of incoming messages. The server then asks the queue "get me all messages for step X" and gets those for processing.
The time adjustment sent to the client is such that messages go into this buffer slightly earlier than they are asked for. How much earlier is a tunable parameter, and the earlier you send messages from the client (i e, the more lag compensation you apply in the queue, not just for the transmission time,) the more jitter your server can take without "running out" of packets for timestamp.
Same thing on the client receiving side.
The draw-back of this buffering is that it adds artificial lag, to compensate for jitter and get a smooth delivery of packets.
If the server or client code cannot keep up with your given step rate, and hitching because of loading or whatnot is common, then more de-jitter buffer is exactly what you need, because the end-to-end system (including processing of steps) is very jittery, and to get a smooth experience, you need to have sufficient buffering to cover that.
[/quote]

This system could work, but wouldnt work well for pvp type of situations...
0

Share this post


Link to post
Share on other sites
[quote]wouldnt work well for pvp type of situations[/quote]

Note that the problem is the network, not the implementation. The implementation gives you as good an implementation as your network allows, assuming you use an adaptive de-jitter buffer size. PvP doesn't work well on poor networks.
1

Share this post


Link to post
Share on other sites
[quote name='hplus0603' timestamp='1355769025' post='5011792']
[quote]wouldnt work well for pvp type of situations[/quote]

Note that the problem is the network, not the implementation. The implementation gives you as good an implementation as your network allows, assuming you use an adaptive de-jitter buffer size. PvP doesn't work well on poor networks.
[/quote]

True enough... i suppose
0

Share this post


Link to post
Share on other sites
Well, we switched to a much speedier compression algorithm, offloaded the decompression on the client to a thread and fixed a loading bug that made the server hit 100% cpu usage. And yet there's still issues with the prediction. If you rapidly tap A and D, you jitter around a lot. The ticks are still going out of sync a little bit once in a while but it still has issues even when there hasn't been a desync for a little while.

In the log below you can see it goes for a couple seconds without a desync and yet continues to have prediction errors fairly frequently. Is a de-jitter buffer and/or locking input a requirement for fixing this up, even though this is happening locally?

[CODE]
[12/17/2012 11:24:29 PM]: Tick offset for tick 8165 was -1
[12/17/2012 11:24:29 PM]: Adjusting. Current = 8169, New = 8170
[12/17/2012 11:24:29 PM]: Tick offset for tick 8166 was -1
[12/17/2012 11:24:30 PM]: Tick offset for tick 8167 was -1
[12/17/2012 11:24:30 PM]: Tick offset for tick 8168 was -1
[12/17/2012 11:24:30 PM]: Tick offset for tick 8170 was 0
[12/17/2012 11:24:30 PM]: Position error for tick 8170. Client: [X:1069.422 Y:1000 Z:-1055.922], Server: [X:1070.326 Y:1000 Z:-1074.743], Diff: [X:-0.9041748 Y:0 Z:18.82068]
[12/17/2012 11:24:30 PM]: Adjusting position at tick 8171 from [X:1070.25 Y:1000 Z:-1073.157] to [X:1071.154 Y:1000 Z:-1091.978]
[12/17/2012 11:24:30 PM]: Adjusting position at tick 8172 from [X:1069.517 Y:1000 Z:-1057.908] to [X:1070.422 Y:1000 Z:-1076.729]
[12/17/2012 11:24:30 PM]: Adjusting position at tick 8173 from [X:1068.696 Y:1000 Z:-1040.802] to [X:1069.6 Y:1000 Z:-1059.622]
[12/17/2012 11:24:30 PM]: Tick offset for tick 8171 was 0
[12/17/2012 11:24:30 PM]: Position error for tick 8171. Client: [X:1071.154 Y:1000 Z:-1091.978], Server: [X:1071.925 Y:1000 Z:-1108.034], Diff: [X:-0.7711182 Y:0 Z:16.05652]
[12/17/2012 11:24:30 PM]: Adjusting position at tick 8172 from [X:1070.422 Y:1000 Z:-1076.729] to [X:1071.193 Y:1000 Z:-1092.785]
[12/17/2012 11:24:30 PM]: Adjusting position at tick 8173 from [X:1069.6 Y:1000 Z:-1059.622] to [X:1070.371 Y:1000 Z:-1075.679]
[12/17/2012 11:24:30 PM]: Adjusting position at tick 8174 from [X:1069.582 Y:1000 Z:-1059.261] to [X:1070.354 Y:1000 Z:-1075.318]
[12/17/2012 11:24:30 PM]: Tick offset for tick 8172 was 0
[12/17/2012 11:24:30 PM]: Tick offset for tick 8173 was 0
[12/17/2012 11:24:30 PM]: Tick offset for tick 8174 was 0
[12/17/2012 11:24:30 PM]: Position error for tick 8174. Client: [X:1070.354 Y:1000 Z:-1075.318], Server: [X:1069.526 Y:1000 Z:-1058.094], Diff: [X:0.8272705 Y:0 Z:-17.22363]
[12/17/2012 11:24:30 PM]: Adjusting position at tick 8175 from [X:1070.148 Y:1000 Z:-1071.042] to [X:1069.321 Y:1000 Z:-1053.818]
[12/17/2012 11:24:30 PM]: Adjusting position at tick 8176 from [X:1069.515 Y:1000 Z:-1057.863] to [X:1068.688 Y:1000 Z:-1040.639]
[12/17/2012 11:24:30 PM]: Adjusting position at tick 8177 from [X:1068.763 Y:1000 Z:-1042.213] to [X:1067.936 Y:1000 Z:-1024.99]
[12/17/2012 11:24:30 PM]: Tick offset for tick 8175 was 0
[12/17/2012 11:24:30 PM]: Tick offset for tick 8176 was 0
[12/17/2012 11:24:30 PM]: Tick offset for tick 8177 was 0
[12/17/2012 11:24:30 PM]: Tick offset for tick 8178 was 0
[12/17/2012 11:24:30 PM]: Position error for tick 8178. Client: [X:1067.966 Y:1000 Z:-1025.608], Server: [X:1066.328 Y:1000 Z:-991.5042], Diff: [X:1.638184 Y:0 Z:-34.1037]
[12/17/2012 11:24:30 PM]: Adjusting position at tick 8179 from [X:1067.217 Y:1000 Z:-1010.029] to [X:1065.579 Y:1000 Z:-975.9248]
[12/17/2012 11:24:30 PM]: Adjusting position at tick 8180 from [X:1067.136 Y:1000 Z:-1008.342] to [X:1065.498 Y:1000 Z:-974.2383]
[12/17/2012 11:24:30 PM]: Adjusting position at tick 8181 from [X:1067.136 Y:1000 Z:-1008.342] to [X:1065.498 Y:1000 Z:-974.2383]
[12/17/2012 11:24:30 PM]: Tick offset for tick 8179 was 0
[12/17/2012 11:24:30 PM]: Tick offset for tick 8180 was 0
[12/17/2012 11:24:30 PM]: Tick offset for tick 8181 was 0
[12/17/2012 11:24:30 PM]: Tick offset for tick 8182 was 0
[12/17/2012 11:24:30 PM]: Tick offset for tick 8183 was 0
[12/17/2012 11:24:30 PM]: Tick offset for tick 8184 was 0
[12/17/2012 11:24:30 PM]: Position error for tick 8184. Client: [X:1067.097 Y:1000 Z:-1007.527], Server: [X:1067.927 Y:1000 Z:-1024.796], Diff: [X:-0.8295898 Y:0 Z:17.26898]
[12/17/2012 11:24:30 PM]: Adjusting position at tick 8185 from [X:1067.845 Y:1000 Z:-1023.104] to [X:1068.675 Y:1000 Z:-1040.373]
[12/17/2012 11:24:30 PM]: Adjusting position at tick 8186 from [X:1068.676 Y:1000 Z:-1040.389] to [X:1069.505 Y:1000 Z:-1057.658]
[12/17/2012 11:24:30 PM]: Adjusting position at tick 8187 from [X:1069.419 Y:1000 Z:-1055.867] to [X:1070.249 Y:1000 Z:-1073.136]
[12/17/2012 11:24:30 PM]: Tick offset for tick 8185 was 0
[12/17/2012 11:24:30 PM]: Tick offset for tick 8186 was 0
[12/17/2012 11:24:30 PM]: Position error for tick 8186. Client: [X:1069.505 Y:1000 Z:-1057.658], Server: [X:1068.735 Y:1000 Z:-1041.622], Diff: [X:0.7703857 Y:0 Z:-16.03638]
[12/17/2012 11:24:30 PM]: Adjusting position at tick 8187 from [X:1070.249 Y:1000 Z:-1073.136] to [X:1069.479 Y:1000 Z:-1057.1]
[12/17/2012 11:24:30 PM]: Adjusting position at tick 8188 from [X:1070.231 Y:1000 Z:-1072.771] to [X:1069.461 Y:1000 Z:-1056.734]
[12/17/2012 11:24:30 PM]: Adjusting position at tick 8189 from [X:1070.975 Y:1000 Z:-1088.262] to [X:1070.205 Y:1000 Z:-1072.225]
[12/17/2012 11:24:30 PM]: Tick offset for tick 8187 was 0
[12/17/2012 11:24:30 PM]: Position error for tick 8187. Client: [X:1069.479 Y:1000 Z:-1057.1], Server: [X:1070.326 Y:1000 Z:-1074.738], Diff: [X:-0.84729 Y:0 Z:17.63806]
[12/17/2012 11:24:30 PM]: Adjusting position at tick 8188 from [X:1069.461 Y:1000 Z:-1056.734] to [X:1070.308 Y:1000 Z:-1074.372]
[12/17/2012 11:24:30 PM]: Adjusting position at tick 8189 from [X:1070.205 Y:1000 Z:-1072.225] to [X:1071.052 Y:1000 Z:-1089.863]
[12/17/2012 11:24:30 PM]: Adjusting position at tick 8190 from [X:1070.255 Y:1000 Z:-1073.265] to [X:1071.102 Y:1000 Z:-1090.903]
[12/17/2012 11:24:30 PM]: Tick offset for tick 8188 was 0
[12/17/2012 11:24:30 PM]: Tick offset for tick 8189 was 0
[12/17/2012 11:24:30 PM]: Tick offset for tick 8190 was 0
[12/17/2012 11:24:30 PM]: Position error for tick 8190. Client: [X:1071.102 Y:1000 Z:-1090.903], Server: [X:1072.725 Y:1000 Z:-1124.681], Diff: [X:-1.622559 Y:0 Z:33.77771]
[12/17/2012 11:24:30 PM]: Adjusting position at tick 8191 from [X:1071.121 Y:1000 Z:-1091.284] to [X:1072.743 Y:1000 Z:-1125.062]
[12/17/2012 11:24:30 PM]: Adjusting position at tick 8192 from [X:1070.371 Y:1000 Z:-1075.674] to [X:1071.993 Y:1000 Z:-1109.452]
[12/17/2012 11:24:30 PM]: Adjusting position at tick 8193 from [X:1069.548 Y:1000 Z:-1058.543] to [X:1071.17 Y:1000 Z:-1092.32]
[12/17/2012 11:24:30 PM]: Tick offset for tick 8191 was 0
[12/17/2012 11:24:30 PM]: Tick offset for tick 8192 was 0
[12/17/2012 11:24:30 PM]: Position error for tick 8192. Client: [X:1071.993 Y:1000 Z:-1109.452], Server: [X:1073.516 Y:1000 Z:-1141.149], Diff: [X:-1.522583 Y:0 Z:31.69714]
[12/17/2012 11:24:30 PM]: Adjusting position at tick 8193 from [X:1071.17 Y:1000 Z:-1092.32] to [X:1072.693 Y:1000 Z:-1124.017]
[12/17/2012 11:24:30 PM]: Adjusting position at tick 8194 from [X:1071.141 Y:1000 Z:-1091.698] to [X:1072.663 Y:1000 Z:-1123.395]
[12/17/2012 11:24:30 PM]: Adjusting position at tick 8195 from [X:1070.228 Y:1000 Z:-1072.697] to [X:1071.75 Y:1000 Z:-1104.394]
[12/17/2012 11:24:30 PM]: Tick offset for tick 8193 was 0
[12/17/2012 11:24:30 PM]: Tick offset for tick 8194 was 0
[12/17/2012 11:24:30 PM]: Tick offset for tick 8195 was 0
[12/17/2012 11:24:30 PM]: Tick offset for tick 8196 was 0
[12/17/2012 11:24:30 PM]: Position error for tick 8196. Client: [X:1071.683 Y:1000 Z:-1102.996], Server: [X:1069.526 Y:1000 Z:-1058.095], Diff: [X:2.15686 Y:0 Z:-44.90027]
[12/17/2012 11:24:30 PM]: Adjusting position at tick 8197 from [X:1070.936 Y:1000 Z:-1087.443] to [X:1068.779 Y:1000 Z:-1042.543]
[12/17/2012 11:24:30 PM]: Adjusting position at tick 8198 from [X:1070.214 Y:1000 Z:-1072.402] to [X:1068.057 Y:1000 Z:-1027.502]
[12/17/2012 11:24:30 PM]: Adjusting position at tick 8199 from [X:1069.392 Y:1000 Z:-1055.3] to [X:1067.235 Y:1000 Z:-1010.4]
[12/17/2012 11:24:30 PM]: Tick offset for tick 8197 was 0
[12/17/2012 11:24:31 PM]: Tick offset for tick 8198 was 0
[12/17/2012 11:24:31 PM]: Tick offset for tick 8199 was 0
[12/17/2012 11:24:31 PM]: Tick offset for tick 8200 was 0
[12/17/2012 11:24:31 PM]: Tick offset for tick 8201 was 0
[12/17/2012 11:24:31 PM]: Tick offset for tick 8202 was 0
[12/17/2012 11:24:31 PM]: Tick offset for tick 8203 was 0
[12/17/2012 11:24:31 PM]: Tick offset for tick 8204 was 0
[12/17/2012 11:24:31 PM]: Tick offset for tick 8205 was 0
[12/17/2012 11:24:31 PM]: Tick offset for tick 8206 was 0
[12/17/2012 11:24:31 PM]: Position error for tick 8206. Client: [X:1068.765 Y:1000 Z:-1042.243], Server: [X:1067.927 Y:1000 Z:-1024.802], Diff: [X:0.8378906 Y:0 Z:-17.44116]
[12/17/2012 11:24:31 PM]: Adjusting position at tick 8207 from [X:1069.588 Y:1000 Z:-1059.385] to [X:1068.75 Y:1000 Z:-1041.944]
[12/17/2012 11:24:31 PM]: Adjusting position at tick 8208 from [X:1070.415 Y:1000 Z:-1076.597] to [X:1069.577 Y:1000 Z:-1059.155]
[12/17/2012 11:24:31 PM]: Adjusting position at tick 8209 from [X:1071.18 Y:1000 Z:-1092.521] to [X:1070.342 Y:1000 Z:-1075.08]
[12/17/2012 11:24:31 PM]: Tick offset for tick 8207 was 0
[12/17/2012 11:24:31 PM]: Tick offset for tick 8208 was 0
[12/17/2012 11:24:31 PM]: Tick offset for tick 8209 was 0
[12/17/2012 11:24:31 PM]: Tick offset for tick 8210 was 0
[12/17/2012 11:24:31 PM]: Position error for tick 8210. Client: [X:1070.365 Y:1000 Z:-1075.551], Server: [X:1071.135 Y:1000 Z:-1091.58], Diff: [X:-0.7700195 Y:0 Z:16.02966]
[12/17/2012 11:24:31 PM]: Adjusting position at tick 8211 from [X:1071.23 Y:1000 Z:-1093.553] to [X:1072 Y:1000 Z:-1109.583]
[12/17/2012 11:24:31 PM]: Adjusting position at tick 8212 from [X:1071.887 Y:1000 Z:-1107.237] to [X:1072.657 Y:1000 Z:-1123.266]
[12/17/2012 11:24:31 PM]: Adjusting position at tick 8213 from [X:1071.942 Y:1000 Z:-1108.375] to [X:1072.712 Y:1000 Z:-1124.404]
[12/17/2012 11:24:31 PM]: Tick offset for tick 8211 was 0
[12/17/2012 11:24:31 PM]: Tick offset for tick 8212 was 0
[12/17/2012 11:24:31 PM]: Tick offset for tick 8213 was 0
[12/17/2012 11:24:31 PM]: Position error for tick 8213. Client: [X:1072.712 Y:1000 Z:-1124.404], Server: [X:1073.525 Y:1000 Z:-1141.331], Diff: [X:-0.8131104 Y:0 Z:16.92664]
[12/17/2012 11:24:31 PM]: Adjusting position at tick 8214 from [X:1072.645 Y:1000 Z:-1123.016] to [X:1073.458 Y:1000 Z:-1139.942]
[12/17/2012 11:24:31 PM]: Adjusting position at tick 8215 from [X:1071.871 Y:1000 Z:-1106.901] to [X:1072.684 Y:1000 Z:-1123.827]
[12/17/2012 11:24:31 PM]: Adjusting position at tick 8216 from [X:1071.129 Y:1000 Z:-1091.463] to [X:1071.942 Y:1000 Z:-1108.389]
[12/17/2012 11:24:31 PM]: Tick offset for tick 8214 was 0
[12/17/2012 11:24:31 PM]: Tick offset for tick 8215 was 0
[12/17/2012 11:24:31 PM]: Tick offset for tick 8216 was 0
[12/17/2012 11:24:31 PM]: Tick offset for tick 8217 was 0
[12/17/2012 11:24:31 PM]: Position error for tick 8217. Client: [X:1071.871 Y:1000 Z:-1106.911], Server: [X:1070.326 Y:1000 Z:-1074.742], Diff: [X:1.545288 Y:0 Z:-32.16858]
[12/17/2012 11:24:31 PM]: Adjusting position at tick 8218 from [X:1071.095 Y:1000 Z:-1090.756] to [X:1069.55 Y:1000 Z:-1058.588]
[12/17/2012 11:24:31 PM]: Adjusting position at tick 8219 from [X:1071.143 Y:1000 Z:-1091.742] to [X:1069.597 Y:1000 Z:-1059.573]
[12/17/2012 11:24:31 PM]: Adjusting position at tick 8220 from [X:1071.143 Y:1000 Z:-1091.742] to [X:1069.597 Y:1000 Z:-1059.573]
[12/17/2012 11:24:31 PM]: Tick offset for tick 8218 was 0
[12/17/2012 11:24:31 PM]: Position error for tick 8218. Client: [X:1069.55 Y:1000 Z:-1058.588], Server: [X:1070.326 Y:1000 Z:-1074.738], Diff: [X:-0.7758789 Y:0 Z:16.1499]
[12/17/2012 11:24:31 PM]: Adjusting position at tick 8219 from [X:1069.597 Y:1000 Z:-1059.573] to [X:1070.373 Y:1000 Z:-1075.723]
[12/17/2012 11:24:31 PM]: Adjusting position at tick 8220 from [X:1069.597 Y:1000 Z:-1059.573] to [X:1070.373 Y:1000 Z:-1075.723]
[12/17/2012 11:24:31 PM]: Adjusting position at tick 8221 from [X:1069.684 Y:1000 Z:-1061.388] to [X:1070.46 Y:1000 Z:-1077.538]
[12/17/2012 11:24:31 PM]: Tick offset for tick 8219 was 0
[12/17/2012 11:24:31 PM]: Position error for tick 8219. Client: [X:1070.373 Y:1000 Z:-1075.723], Server: [X:1069.526 Y:1000 Z:-1058.094], Diff: [X:0.8469238 Y:0 Z:-17.62952]
[12/17/2012 11:24:31 PM]: Adjusting position at tick 8220 from [X:1070.373 Y:1000 Z:-1075.723] to [X:1069.526 Y:1000 Z:-1058.094]
[12/17/2012 11:24:31 PM]: Adjusting position at tick 8221 from [X:1070.46 Y:1000 Z:-1077.538] to [X:1069.613 Y:1000 Z:-1059.908]
[12/17/2012 11:24:31 PM]: Adjusting position at tick 8222 from [X:1070.491 Y:1000 Z:-1078.183] to [X:1069.644 Y:1000 Z:-1060.553]
[12/17/2012 11:24:31 PM]: Tick offset for tick 8220 was 0
[12/17/2012 11:24:31 PM]: Tick offset for tick 8221 was 0
[12/17/2012 11:24:31 PM]: Tick offset for tick 8222 was 0
[12/17/2012 11:24:31 PM]: Tick offset for tick 8223 was 0
[12/17/2012 11:24:31 PM]: Position error for tick 8223. Client: [X:1069.71 Y:1000 Z:-1061.923], Server: [X:1071.925 Y:1000 Z:-1108.035], Diff: [X:-2.215088 Y:0 Z:46.11157]
[12/17/2012 11:24:31 PM]: Adjusting position at tick 8224 from [X:1070.484 Y:1000 Z:-1078.032] to [X:1072.699 Y:1000 Z:-1124.143]
[12/17/2012 11:24:31 PM]: Adjusting position at tick 8225 from [X:1070.444 Y:1000 Z:-1077.201] to [X:1072.659 Y:1000 Z:-1123.312]
[12/17/2012 11:24:31 PM]: Adjusting position at tick 8226 from [X:1069.714 Y:1000 Z:-1062.011] to [X:1071.93 Y:1000 Z:-1108.123]
[12/17/2012 11:24:31 PM]: Tick offset for tick 8224 was 0
[12/17/2012 11:24:31 PM]: Position error for tick 8224. Client: [X:1072.699 Y:1000 Z:-1124.143], Server: [X:1071.925 Y:1000 Z:-1108.039], Diff: [X:0.7736816 Y:0 Z:-16.10425]
[12/17/2012 11:24:31 PM]: Adjusting position at tick 8225 from [X:1072.659 Y:1000 Z:-1123.312] to [X:1071.885 Y:1000 Z:-1107.208]
[12/17/2012 11:24:31 PM]: Adjusting position at tick 8226 from [X:1071.93 Y:1000 Z:-1108.123] to [X:1071.156 Y:1000 Z:-1092.018]
[12/17/2012 11:24:31 PM]: Adjusting position at tick 8227 from [X:1071.81 Y:1000 Z:-1105.641] to [X:1071.037 Y:1000 Z:-1089.537]
[12/17/2012 11:24:31 PM]: Tick offset for tick 8225 was 0
[12/17/2012 11:24:31 PM]: Position error for tick 8225. Client: [X:1071.885 Y:1000 Z:-1107.208], Server: [X:1072.725 Y:1000 Z:-1124.684], Diff: [X:-0.8394775 Y:0 Z:17.47571]
[12/17/2012 11:24:31 PM]: Adjusting position at tick 8226 from [X:1071.156 Y:1000 Z:-1092.018] to [X:1071.995 Y:1000 Z:-1109.494]
[12/17/2012 11:24:31 PM]: Adjusting position at tick 8227 from [X:1071.037 Y:1000 Z:-1089.537] to [X:1071.876 Y:1000 Z:-1107.013]
[12/17/2012 11:24:31 PM]: Adjusting position at tick 8228 from [X:1070.993 Y:1000 Z:-1088.628] to [X:1071.833 Y:1000 Z:-1106.104]
[12/17/2012 11:24:31 PM]: Tick offset for tick 8226 was 0
[12/17/2012 11:24:31 PM]: Tick offset for tick 8227 was 0
[12/17/2012 11:24:32 PM]: Tick offset for tick 8228 was 0
[12/17/2012 11:24:32 PM]: Tick offset for tick 8229 was 0
[12/17/2012 11:24:32 PM]: Tick offset for tick 8230 was 0
[12/17/2012 11:24:32 PM]: Position error for tick 8230. Client: [X:1072.586 Y:1000 Z:-1121.794], Server: [X:1071.126 Y:1000 Z:-1091.391], Diff: [X:1.460449 Y:0 Z:-30.40393]
[12/17/2012 11:24:32 PM]: Adjusting position at tick 8231 from [X:1073.401 Y:1000 Z:-1138.761] to [X:1071.941 Y:1000 Z:-1108.357]
[12/17/2012 11:24:32 PM]: Adjusting position at tick 8232 from [X:1073.432 Y:1000 Z:-1139.399] to [X:1071.971 Y:1000 Z:-1108.995]
[12/17/2012 11:24:32 PM]: Adjusting position at tick 8233 from [X:1072.708 Y:1000 Z:-1124.323] to [X:1071.247 Y:1000 Z:-1093.919]
[12/17/2012 11:24:32 PM]: Tick offset for tick 8231 was 0
[12/17/2012 11:24:32 PM]: Tick offset for tick 8232 was 0
[12/17/2012 11:24:32 PM]: Tick offset for tick 8233 was 0
[12/17/2012 11:24:32 PM]: Position error for tick 8233. Client: [X:1071.247 Y:1000 Z:-1093.919], Server: [X:1072.725 Y:1000 Z:-1124.683], Diff: [X:-1.477783 Y:0 Z:30.76343]
[12/17/2012 11:24:32 PM]: Adjusting position at tick 8234 from [X:1071.328 Y:1000 Z:-1095.611] to [X:1072.806 Y:1000 Z:-1126.375]
[12/17/2012 11:24:32 PM]: Adjusting position at tick 8235 from [X:1072.068 Y:1000 Z:-1111.001] to [X:1073.546 Y:1000 Z:-1141.765]
[12/17/2012 11:24:32 PM]: Adjusting position at tick 8236 from [X:1072.843 Y:1000 Z:-1127.147] to [X:1074.321 Y:1000 Z:-1157.91]
[12/17/2012 11:24:32 PM]: Tick offset for tick 8234 was 0
[12/17/2012 11:24:32 PM]: Position error for tick 8234. Client: [X:1072.806 Y:1000 Z:-1126.375], Server: [X:1071.925 Y:1000 Z:-1108.036], Diff: [X:0.8809814 Y:0 Z:-18.33862]
[12/17/2012 11:24:32 PM]: Adjusting position at tick 8235 from [X:1073.546 Y:1000 Z:-1141.765] to [X:1072.665 Y:1000 Z:-1123.426]
[12/17/2012 11:24:32 PM]: Adjusting position at tick 8236 from [X:1074.321 Y:1000 Z:-1157.91] to [X:1073.44 Y:1000 Z:-1139.572]
[12/17/2012 11:24:32 PM]: Adjusting position at tick 8237 from [X:1074.212 Y:1000 Z:-1155.636] to [X:1073.331 Y:1000 Z:-1137.297]
[12/17/2012 11:24:32 PM]: Tick offset for tick 8235 was 0
[12/17/2012 11:24:32 PM]: Tick offset for tick 8236 was 0
[12/17/2012 11:24:32 PM]: Tick offset for tick 8237 was 0
[12/17/2012 11:24:32 PM]: Tick offset for tick 8238 was 0
[12/17/2012 11:24:32 PM]: Tick offset for tick 8239 was 0
[12/17/2012 11:24:32 PM]: Position error for tick 8239. Client: [X:1072.554 Y:1000 Z:-1121.118], Server: [X:1073.525 Y:1000 Z:-1141.329], Diff: [X:-0.9709473 Y:0 Z:20.21155]
[12/17/2012 11:24:32 PM]: Adjusting position at tick 8240 from [X:1071.809 Y:1000 Z:-1105.611] to [X:1072.78 Y:1000 Z:-1125.823]
[12/17/2012 11:24:32 PM]: Adjusting position at tick 8241 from [X:1070.985 Y:1000 Z:-1088.458] to [X:1071.956 Y:1000 Z:-1108.67]
[12/17/2012 11:24:32 PM]: Adjusting position at tick 8242 from [X:1070.163 Y:1000 Z:-1071.348] to [X:1071.134 Y:1000 Z:-1091.56]
[12/17/2012 11:24:32 PM]: Tick offset for tick 8240 was 0
[12/17/2012 11:24:32 PM]: Tick offset for tick 8241 was 0
[12/17/2012 11:24:32 PM]: Position error for tick 8241. Client: [X:1071.956 Y:1000 Z:-1108.67], Server: [X:1071.126 Y:1000 Z:-1091.392], Diff: [X:0.8299561 Y:0 Z:-17.27844]
[12/17/2012 11:24:32 PM]: Adjusting position at tick 8242 from [X:1071.134 Y:1000 Z:-1091.56] to [X:1070.304 Y:1000 Z:-1074.281]
[12/17/2012 11:24:32 PM]: Adjusting position at tick 8243 from [X:1071.036 Y:1000 Z:-1089.534] to [X:1070.207 Y:1000 Z:-1072.255]
[12/17/2012 11:24:32 PM]: Adjusting position at tick 8244 from [X:1070.272 Y:1000 Z:-1073.623] to [X:1069.442 Y:1000 Z:-1056.344]
[12/17/2012 11:24:32 PM]: Tick offset for tick 8242 was 0
[12/17/2012 11:24:32 PM]: Position error for tick 8242. Client: [X:1070.304 Y:1000 Z:-1074.281], Server: [X:1071.126 Y:1000 Z:-1091.388], Diff: [X:-0.8217773 Y:0 Z:17.1062]
[12/17/2012 11:24:32 PM]: Adjusting position at tick 8243 from [X:1070.207 Y:1000 Z:-1072.255] to [X:1071.028 Y:1000 Z:-1089.362]
[12/17/2012 11:24:32 PM]: Adjusting position at tick 8244 from [X:1069.442 Y:1000 Z:-1056.344] to [X:1070.264 Y:1000 Z:-1073.451]
[12/17/2012 11:24:32 PM]: Adjusting position at tick 8245 from [X:1069.465 Y:1000 Z:-1056.822] to [X:1070.287 Y:1000 Z:-1073.928]
[12/17/2012 11:24:32 PM]: Tick offset for tick 8243 was 0
[12/17/2012 11:24:32 PM]: Tick offset for tick 8244 was 0
[12/17/2012 11:24:32 PM]: Position error for tick 8244. Client: [X:1070.264 Y:1000 Z:-1073.451], Server: [X:1068.727 Y:1000 Z:-1041.447], Diff: [X:1.537354 Y:0 Z:-32.0033]
[12/17/2012 11:24:32 PM]: Adjusting position at tick 8245 from [X:1070.287 Y:1000 Z:-1073.928] to [X:1068.75 Y:1000 Z:-1041.925]
[12/17/2012 11:24:32 PM]: Adjusting position at tick 8246 from [X:1070.22 Y:1000 Z:-1072.533] to [X:1068.682 Y:1000 Z:-1040.53]
[12/17/2012 11:24:32 PM]: Adjusting position at tick 8247 from [X:1069.469 Y:1000 Z:-1056.899] to [X:1067.932 Y:1000 Z:-1024.896]
[12/17/2012 11:24:32 PM]: Tick offset for tick 8245 was 0
[12/17/2012 11:24:32 PM]: Tick offset for tick 8246 was 0
[12/17/2012 11:24:32 PM]: Tick offset for tick 8247 was 0
[12/17/2012 11:24:32 PM]: Position error for tick 8247. Client: [X:1067.932 Y:1000 Z:-1024.896], Server: [X:1066.328 Y:1000 Z:-991.506], Diff: [X:1.603882 Y:0 Z:-33.38995]
[12/17/2012 11:24:32 PM]: Adjusting position at tick 8248 from [X:1068.05 Y:1000 Z:-1027.361] to [X:1066.446 Y:1000 Z:-993.9715]
[12/17/2012 11:24:32 PM]: Adjusting position at tick 8249 from [X:1068.806 Y:1000 Z:-1043.109] to [X:1067.203 Y:1000 Z:-1009.719]
[12/17/2012 11:24:32 PM]: Adjusting position at tick 8250 from [X:1069.522 Y:1000 Z:-1058.015] to [X:1067.919 Y:1000 Z:-1024.625]
[12/17/2012 11:24:32 PM]: Tick offset for tick 8248 was 0
[12/17/2012 11:24:32 PM]: Tick offset for tick 8249 was 0
[12/17/2012 11:24:32 PM]: Tick offset for tick 8250 was 0
[12/17/2012 11:24:32 PM]: Position error for tick 8250. Client: [X:1067.919 Y:1000 Z:-1024.625], Server: [X:1068.727 Y:1000 Z:-1041.446], Diff: [X:-0.8079834 Y:0 Z:16.82141]
[12/17/2012 11:24:32 PM]: Adjusting position at tick 8251 from [X:1068.037 Y:1000 Z:-1027.092] to [X:1068.845 Y:1000 Z:-1043.913]
[12/17/2012 11:24:32 PM]: Adjusting position at tick 8252 from [X:1067.267 Y:1000 Z:-1011.064] to [X:1068.075 Y:1000 Z:-1027.886]
[12/17/2012 11:24:32 PM]: Adjusting position at tick 8253 from [X:1066.385 Y:1000 Z:-992.6888] to [X:1067.193 Y:1000 Z:-1009.51]
[12/17/2012 11:24:32 PM]: Tick offset for tick 8251 was 0
[12/17/2012 11:24:32 PM]: Tick offset for tick 8252 was 0
[12/17/2012 11:24:32 PM]: Position error for tick 8252. Client: [X:1068.075 Y:1000 Z:-1027.886], Server: [X:1069.515 Y:1000 Z:-1057.867], Diff: [X:-1.440186 Y:0 Z:29.9812]
[12/17/2012 11:24:32 PM]: Adjusting position at tick 8253 from [X:1067.193 Y:1000 Z:-1009.51] to [X:1068.633 Y:1000 Z:-1039.491]
[12/17/2012 11:24:32 PM]: Adjusting position at tick 8254 from [X:1067.157 Y:1000 Z:-1008.768] to [X:1068.597 Y:1000 Z:-1038.749]
[12/17/2012 11:24:32 PM]: Adjusting position at tick 8255 from [X:1067.985 Y:1000 Z:-1026.018] to [X:1069.426 Y:1000 Z:-1055.999]
[12/17/2012 11:24:32 PM]: Tick offset for tick 8253 was 0
[12/17/2012 11:24:32 PM]: Tick offset for tick 8254 was 0
[12/17/2012 11:24:32 PM]: Tick offset for tick 8255 was 0
[12/17/2012 11:24:32 PM]: Position error for tick 8255. Client: [X:1069.426 Y:1000 Z:-1055.999], Server: [X:1067.938 Y:1000 Z:-1025.029], Diff: [X:1.487671 Y:0 Z:-30.96985]
[12/17/2012 11:24:32 PM]: Adjusting position at tick 8256 from [X:1069.334 Y:1000 Z:-1054.101] to [X:1067.847 Y:1000 Z:-1023.131]
[12/17/2012 11:24:32 PM]: Adjusting position at tick 8257 from [X:1068.632 Y:1000 Z:-1039.488] to [X:1067.145 Y:1000 Z:-1008.518]
[12/17/2012 11:24:32 PM]: Adjusting position at tick 8258 from [X:1067.886 Y:1000 Z:-1023.958] to [X:1066.399 Y:1000 Z:-992.988]
[12/17/2012 11:24:32 PM]: Tick offset for tick 8256 was 0
[12/17/2012 11:24:32 PM]: Position error for tick 8256. Client: [X:1067.847 Y:1000 Z:-1023.131], Server: [X:1069.526 Y:1000 Z:-1058.094], Diff: [X:-1.679443 Y:0 Z:34.96252]
[12/17/2012 11:24:32 PM]: Adjusting position at tick 8257 from [X:1067.145 Y:1000 Z:-1008.518] to [X:1068.824 Y:1000 Z:-1043.48]
[12/17/2012 11:24:32 PM]: Adjusting position at tick 8258 from [X:1066.399 Y:1000 Z:-992.988] to [X:1068.078 Y:1000 Z:-1027.95]
[12/17/2012 11:24:32 PM]: Adjusting position at tick 8259 from [X:1066.456 Y:1000 Z:-994.1709] to [X:1068.135 Y:1000 Z:-1029.133]
[12/17/2012 11:24:32 PM]: Tick offset for tick 8257 was 0
[12/17/2012 11:24:33 PM]: Tick offset for tick 8258 was 0
[12/17/2012 11:24:33 PM]: Tick offset for tick 8259 was 0
[12/17/2012 11:24:33 PM]: Position error for tick 8259. Client: [X:1068.135 Y:1000 Z:-1029.133], Server: [X:1067.127 Y:1000 Z:-1008.152], Diff: [X:1.007935 Y:0 Z:-20.98187]
[12/17/2012 11:24:33 PM]: Adjusting position at tick 8260 from [X:1068.024 Y:1000 Z:-1026.817] to [X:1067.016 Y:1000 Z:-1005.836]
[12/17/2012 11:24:33 PM]: Adjusting position at tick 8261 from [X:1068.711 Y:1000 Z:-1041.119] to [X:1067.703 Y:1000 Z:-1020.137]
[12/17/2012 11:24:33 PM]: Adjusting position at tick 8262 from [X:1069.702 Y:1000 Z:-1061.75] to [X:1068.694 Y:1000 Z:-1040.768]
[12/17/2012 11:24:33 PM]: Tick offset for tick 8260 was 0
[12/17/2012 11:24:33 PM]: Tick offset for tick 8261 was 0
[12/17/2012 11:24:33 PM]: Position error for tick 8261. Client: [X:1067.703 Y:1000 Z:-1020.137], Server: [X:1066.339 Y:1000 Z:-991.7363], Diff: [X:1.36438 Y:0 Z:-28.401]
[12/17/2012 11:24:33 PM]: Adjusting position at tick 8262 from [X:1068.694 Y:1000 Z:-1040.768] to [X:1067.33 Y:1000 Z:-1012.367]
[12/17/2012 11:24:33 PM]: Adjusting position at tick 8263 from [X:1068.699 Y:1000 Z:-1040.866] to [X:1067.334 Y:1000 Z:-1012.465]
[12/17/2012 11:24:33 PM]: Adjusting position at tick 8264 from [X:1068.1 Y:1000 Z:-1028.394] to [X:1066.735 Y:1000 Z:-999.9934]
[12/17/2012 11:24:33 PM]: Tick offset for tick 8262 was 0
[12/17/2012 11:24:33 PM]: Tick offset for tick 8263 was 0
[12/17/2012 11:24:33 PM]: Tick offset for tick 8264 was 0
[12/17/2012 11:24:33 PM]: Position error for tick 8264. Client: [X:1066.735 Y:1000 Z:-999.9934], Server: [X:1068.715 Y:1000 Z:-1041.214], Diff: [X:-1.980225 Y:0 Z:41.22034]
[12/17/2012 11:24:33 PM]: Adjusting position at tick 8265 from [X:1066.771 Y:1000 Z:-1000.733] to [X:1068.751 Y:1000 Z:-1041.953]
[12/17/2012 11:24:33 PM]: Adjusting position at tick 8266 from [X:1066.01 Y:1000 Z:-984.8849] to [X:1067.99 Y:1000 Z:-1026.105]
[12/17/2012 11:24:33 PM]: Adjusting position at tick 8267 from [X:1066.709 Y:1000 Z:-999.4551] to [X:1068.69 Y:1000 Z:-1040.676]
[12/17/2012 11:24:33 PM]: Tick offset for tick 8265 was 0
[12/17/2012 11:24:33 PM]: Position error for tick 8265. Client: [X:1068.751 Y:1000 Z:-1041.953], Server: [X:1067.127 Y:1000 Z:-1008.153], Diff: [X:1.623657 Y:0 Z:-33.79968]
[12/17/2012 11:24:33 PM]: Adjusting position at tick 8266 from [X:1067.99 Y:1000 Z:-1026.105] to [X:1066.366 Y:1000 Z:-992.3055]
[12/17/2012 11:24:33 PM]: Adjusting position at tick 8267 from [X:1068.69 Y:1000 Z:-1040.676] to [X:1067.066 Y:1000 Z:-1006.876]
[12/17/2012 11:24:33 PM]: Adjusting position at tick 8268 from [X:1068.511 Y:1000 Z:-1036.96] to [X:1066.887 Y:1000 Z:-1003.161]
[12/17/2012 11:24:33 PM]: Tick offset for tick 8266 was 0
[12/17/2012 11:24:33 PM]: Tick offset for tick 8267 was 0
[12/17/2012 11:24:33 PM]: Tick offset for tick 8268 was 0
[12/17/2012 11:24:33 PM]: Tick offset for tick 8269 was 0
[12/17/2012 11:24:33 PM]: Position error for tick 8269. Client: [X:1066.92 Y:1000 Z:-1003.848], Server: [X:1067.946 Y:1000 Z:-1025.2], Diff: [X:-1.025757 Y:0 Z:21.35236]
[12/17/2012 11:24:33 PM]: Adjusting position at tick 8270 from [X:1066.918 Y:1000 Z:-1003.799] to [X:1067.944 Y:1000 Z:-1025.152]
[12/17/2012 11:24:33 PM]: Adjusting position at tick 8271 from [X:1066.15 Y:1000 Z:-987.8042] to [X:1067.176 Y:1000 Z:-1009.157]
[12/17/2012 11:24:33 PM]: Adjusting position at tick 8272 from [X:1065.289 Y:1000 Z:-969.8939] to [X:1066.315 Y:1000 Z:-991.2463]
[12/17/2012 11:24:33 PM]: Tick offset for tick 8270 was 0
[12/17/2012 11:24:33 PM]: Position error for tick 8270. Client: [X:1067.944 Y:1000 Z:-1025.152], Server: [X:1068.727 Y:1000 Z:-1041.446], Diff: [X:-0.7827148 Y:0 Z:16.29443]
[12/17/2012 11:24:33 PM]: Adjusting position at tick 8271 from [X:1067.176 Y:1000 Z:-1009.157] to [X:1067.958 Y:1000 Z:-1025.451]
[12/17/2012 11:24:33 PM]: Adjusting position at tick 8272 from [X:1066.315 Y:1000 Z:-991.2463] to [X:1067.098 Y:1000 Z:-1007.541]
[12/17/2012 11:24:33 PM]: Adjusting position at tick 8273 from [X:1066.254 Y:1000 Z:-989.9637] to [X:1067.036 Y:1000 Z:-1006.258]
[12/17/2012 11:24:33 PM]: Tick offset for tick 8271 was 0
[12/17/2012 11:24:33 PM]: Tick offset for tick 8272 was 0
[12/17/2012 11:24:33 PM]: Position error for tick 8272. Client: [X:1067.098 Y:1000 Z:-1007.541], Server: [X:1067.927 Y:1000 Z:-1024.795], Diff: [X:-0.8288574 Y:0 Z:17.2547]
[12/17/2012 11:24:33 PM]: Adjusting position at tick 8273 from [X:1067.036 Y:1000 Z:-1006.258] to [X:1067.865 Y:1000 Z:-1023.513]
[12/17/2012 11:24:33 PM]: Adjusting position at tick 8274 from [X:1067.026 Y:1000 Z:-1006.034] to [X:1067.854 Y:1000 Z:-1023.289]
[12/17/2012 11:24:33 PM]: Adjusting position at tick 8275 from [X:1067.042 Y:1000 Z:-1006.387] to [X:1067.871 Y:1000 Z:-1023.642]
[12/17/2012 11:24:33 PM]: Tick offset for tick 8273 was 0
[12/17/2012 11:24:33 PM]: Tick offset for tick 8274 was 0
[12/17/2012 11:24:33 PM]: Position error for tick 8274. Client: [X:1067.854 Y:1000 Z:-1023.289], Server: [X:1068.727 Y:1000 Z:-1041.445], Diff: [X:-0.8721924 Y:0 Z:18.15625]
[12/17/2012 11:24:33 PM]: Adjusting position at tick 8275 from [X:1067.871 Y:1000 Z:-1023.642] to [X:1068.744 Y:1000 Z:-1041.798]
[12/17/2012 11:24:33 PM]: Adjusting position at tick 8276 from [X:1067.836 Y:1000 Z:-1022.915] to [X:1068.709 Y:1000 Z:-1041.072]
[12/17/2012 11:24:33 PM]: Adjusting position at tick 8277 from [X:1067.011 Y:1000 Z:-1005.742] to [X:1067.884 Y:1000 Z:-1023.898]
[/CODE]
1

Share this post


Link to post
Share on other sites
What does the tick offset mean? Did you check on the server if inputs are used at the ticks they are intended for?
1

Share this post


Link to post
Share on other sites
The offset is how much the client is ahead or behind according to the server. The server only processes inputs for the current tick or previous ticks. Input "from the future" is left to be processed later. Just as a test I had the server output if the input was ahead or behind. I was able to get the jittering to start on the client and the whole time I did that, the server had no complaints.
0

Share this post


Link to post
Share on other sites
I think that involving a second thread for decompressing data is going to hurt more than help, because it introduces an additional source of unpredictable jitter.
It's also inconceivable to me that any kind of compression of network data would be a CPU performance problem, so a "speedier compression algorithm" does not feel like something that would impact this, because network throughput is so low compared to RAM and CPU. Did you actually profile it before/after to see any difference?

When these kinds of problems happen, it typically ends up being one of a few problems:
- Some typo in the implementation substitutes a - for a + or a / for a *
- Some mis-use of data from different domains -- what tick stamps are values relative to, etc
- Some fundamentally missed assumption about how the hardware/clocks/compiler/whatever works

The only way to really track these down is to start with a batch of focused unit tests, testing assumptions, and then add a batch of very detailed logging and going over it with a fine-tooth comb. Which is a lot of work :-(

That being said: If you have no packet loss, and the client is not cheating, there should be no client snapping, because client and server should agree. If they don't agree for some particular time stamp, you need to dive into the simulation state for the tick before the difference, as well as the tick of the difference, and figure out what went wrong.
If you have a "save game" feature, calling that *every step* or at least every 10 steps to record baseline information for debugging might be very helpful.
0

Share this post


Link to post
Share on other sites
I probably should have mentioned that that compression is for the world data, which doesn't need to arrive in nearly as timely of a manner as the player state. We were using the built-in gzip before and profiling showed it was where the cpu was spending the most time for both the client and server.

That aside, I guess I'll start poking around and see if I can find what's causing this. I wouldn't be surprised if it is a matter of a + instead of a - or something similar. Edited by Telanor
0

Share this post


Link to post
Share on other sites
I think I may have found the problem. The interpolated position of the player was being used instead of its actual position (the position property returned the interpolated position). This is kind of off-topic for this thread but where should the interpolated position be used? Solely for the rendering of that entity? Or should it be used for pretty much everything besides the net code?
0

Share this post


Link to post
Share on other sites
You should use the "actual" position for all simulation, and the interpolated position for basically just rendering and UI interaction (e.g. ray picking).
1

Share this post


Link to post
Share on other sites
Just seeing visual behavior is usually not enough to diagnose things at this level in my experience; it takes analyzing the code and the raw numbers to see what's not lining up.
1

Share this post


Link to post
Share on other sites
It may be that I'm just focusing on the wrong details, but it seems to me like the interpolation is at least partially wrong. If interpolation is working correctly, you should smoothly transition between positions [i]even if the positions themselves jitter due to latency correction[/i]. As it appears in the stream, your agents are snapping back and forth at regular intervals, which I assume means they're "popping" in sync with tick updates from the network code.

As an experiment, you should have a mechanism which lets you inject artificial ticks of latency into your compensation algorithm. (This is typically as trivial as adding a constant to the expected tick delta between client and server.) Crank this up to some relatively large value, like 1 second worth of ticks. Then move around a bit locally and verify that the interpolation is doing what it should be.

Once you've ruled out interpolation as a problem, you can look back at the latency correction and dejitter buffering to see if there's a bug in there. Generally, being able to artificially expand your latency is very handy for finding those kinds of issues as well.
1

Share this post


Link to post
Share on other sites
Another useful debugging tool is to render shadow copies of objects for different states: Last-received state, current-simulated state, and current-predicted state. Perhaps also "previous tick state" and things like that. Pick a color for each of the different sources of entity position, and have them each be turn-on/off-able through a menu. Render each player more than once, colorized accordingly.
This will let you see where things pop and get an idea of how the different sources of data behave.
1

Share this post


Link to post
Share on other sites

So, if we wanted to test if the network stuff is the issue, how would we do that? WHat is the best method to see if the problem is the network code or if it is the game logic? We are kinda at a loss.... my only thought was to take the network code and put it into another project but that really seems like a lot of useless work for something we could test in another method. Anyway, any help would be appreciated.

0

Share this post


Link to post
Share on other sites
WHat is the best method to see if the problem is the network code or if it is the game logic?

By rendering all three different states for each object. Differences should then become more visible.

Another option is to print out logs of timestamps, entity IDs, and positions sent/received/rendered for each timestep for each host, and compare them for some time window when you think you have a problem. Using Excel or a similar tool is pretty much required for this, as it's a lot of very dense data to sift through.
1

Share this post


Link to post
Share on other sites

*nods* Telanor has been dreading doing this, but I am not sure there is any other option at this point! Anyway, thanks, I will get him going on this and see what happens.

0

Share this post


Link to post
Share on other sites
This problem really seems to come down to 1 of 2 issues. Occasionally, the client will take a little bit longer on a tick than it should, usually around 40-90ms. I've tried timing various methods and it never seems to come from any specific one. Profiling it is useless since it's a small, infrequent spike. It seems to occur at random.

It wouldn't really be a problem except that after the spike, the client tries to catch up by simulating 2-3 ticks at once, which means the server usually ends up with a couple update packets all at the same time, but it can only process 1 per tick because of the rewinding problem again.

So, the issue is: random spikes throw off the sync (should a game really be expected to run in perfect sync with the server 99.99% of the time, barring network issues?) and the server can't deal with the client playing catchup. I'm really not sure what to do at this point. Are we going to have to just start letting the client tell the server its position and just do some anti-cheat checking on that? Or is there some way to get this to work with this method? Edited by Telanor
0

Share this post


Link to post
Share on other sites
Those 90 milliseconds likely come from some background task, or some driver with a poor DPC implementation, or maybe even a garbage collector somewhere if any managed/dynamic runtime is involved.

If you increase the de-jitter buffer size on the server, it will soak up those 90 milliseconds of time. Add 100 milliseconds of de-jitter on receipt, and a 90 millisecond delay won't cause any harm.

But, anyway, if this is rare, then why not just use the correction mechanism to bring the client into order? Assuming you timestamp inputs correctly, a 90 millisecond delay will cause inputs from the client to be deemed "late" and discarded on the server, which means the client and the server will de-sync, so you have to fix the client entity in place on the server until the new, authoritative client state can be sent to the client.
2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0