   Deterministic model
  Hi,I had implemented a frame synchronization system with variable stepping size, but this had a few annoying problems like not being deterministic and jittery network synchronization. So I decided to implement a system with a fixed stepping size using interpolation.It's running pretty smooth, but I'm not sure if im doing it completly right because when objects move really fast and collide they appear to be "inside" eachother. This is only a visual problem tho, the collision response is still like before.So because its a visual problem I might be doing the interpolation wrong, this is how I do it now:- objects have 2 positions. 1 physical and 1 visual position.- linear interpolation. (should I change to splines or something else?)After the physics are executed I calculate a new interpolation path (with lineair interpolation this just involves backing up the old visual position) and while drawing I interpolate between this backed up visual position and the new physical position.Is this how it should be done?Or should I try to interpolate between the backed up visual position and the "real" physical position(like when youd use a variable time step)?   
Quote:Original post by ronkfistHi,I had implemented a frame synchronization system with variable stepping size, but this had a few annoying problems like not being deterministic and jittery network synchronization. So I decided to implement a system with a fixed stepping size using interpolation.It's running pretty smooth, but I'm not sure if im doing it completly right because when objects move really fast and collide they appear to be "inside" eachother. This is only a visual problem tho, the collision response is still like before.So because its a visual problem I might be doing the interpolation wrong, this is how I do it now:- objects have 2 positions. 1 physical and 1 visual position.- linear interpolation. (should I change to splines or something else?)After the physics are executed I calculate a new interpolation path (with lineair interpolation this just involves backing up the old visual position) and while drawing I interpolate between this backed up visual position and the new physical position.Is this how it should be done?Or should I try to interpolate between the backed up visual position and the "real" physical position(like when youd use a variable time step)?You have your current position P and your Target position T and then your render position RR = P + T*(time interpolation)Like you said you could change it to this..R = Previous Position + P*(time interpolation)But this would mean the unit is lagging behind in time?The smart way to do it is to find your new position using your physics, then using your current velocity find the position the unit will be next frame and do the physics for that position as well.Basically you have to do the collision detection for the Target position aswell.;  After executing the physics, each object has a new "physical" position(T), then to render I should interpolate between the current "visual" position(P) and T right?The strange thing is when "vertical sync" is enabled it seems to jump a little, but when I turn it off it runs smooth, any idea why?   