The good news is I've got the clocks synched up between the client and server, and I've got all incoming messages to the client converted from server timestamp to client timestamp, so I know EXACTLY how old they are. Now I just need to adjust the lag-reading places in the code to use that age to adjust the packet instead of the average lag from server->client. It turns out there is a big difference in lag from packet to packet.
Ahh so that might be desyncing it then by sending the average lag since the lag fluctuates?
Yes, and it looks like the code doesn't really compensate for lag that much in some cases. I started looking at FIRETUBES before I went to sleep, and I noticed that the lag is not used to figure out how far the torp has gone since the server said it had been fired.
frameUsec = how long a frame lasts in usec (16500)
pktAge = Age of packet in uSec since it was created on server
x,y = where server said the torp was fired
xvel, yvel = server-assigned torp velocity
lagXdiff = xvel * (pktAge/frameUsec)
lagYdiff = yvel * (pktAge/frameUsec)
What I'm saying is going wrong is the initial position of the torp is being assigned as x,y instead of x+lagXDiff, y+lagYdiff, so I think the torps are always out of place.
I'm not sure if that's what other people are seeing as well. We should move this topic to dev discussion to get more descriptions of what the game looks like when it gets out of sync.