Check if the vector is behind another or maybe opposite directions?
        Posted  
        
            by 
                Gilson
            
        on Game Development
        
        See other posts from Game Development
        
            or by Gilson
        
        
        
        Published on 2011-10-25T13:51:03Z
        Indexed on 
            2012/09/28
            15:52 UTC
        
        
        Read the original article
        Hit count: 277
        
networking
|vector
I'm doing a network game and on the client side, i interpolate the client position with the server sent extrapolated position. The client has its own physics simulation wich is corrected by the server in steps. The problem is when it laggs and i 'kick' the ball, the server gets a delayed message and sends me the position backwards of the client position wich makes the ball goes back and forth. I want to ignore those and maybe compensate that on the server, not sure though. The problem is the clock difference on those case are 0.07ms or 0.10 ms wich isn't that high to ignore the message i guess.
When i get the server position, i extrapolate with the clock interval * serverBallVelocity
Can i check if my new ball server position is behind my actual ball vector position? I tried to use the dot product after normalized the two vectors to check if they are opposite but it ain't working properly.
Any suggestions on checking that?
© Game Development or respective owner