Page 1 of 1

Trying to understand the predictiveDrive() function

Posted: 18 Feb 2015, 13:32
by Aditya
Hello Guys,

I am working on lag compensation for my game. The physics for my game is pretty complex. Its a top down, realtime tank battle game. The controls are 2 virtual joysticks. The collision is done using Nape. Initially I wrote my own custom physics using SAT (separating axis theorem) and 2-d grid but I am not able to solve the tunneling (bullet through paper) problem. And hence I am now using Nape. So the approach I am trying, is to run the logic on client side only, as I cannot simulate physics on the server. Its similar to the example of SpaceRace. I am trying to understand the predictiveDrive() function or how they are predicting the path and eliminating the lag. Can anyone explain to me the basics of their algorithm...?!! I dont need the exact variable and function by function explanation but a general abstract algorithm will be enough. Or is there any other approach you would like to suggest in this scenario !!???

Any help would be great.

Re: Trying to understand the predictiveDrive() function

Posted: 20 Feb 2015, 18:36
by Lapo
Hi,
I am not sure what you are referring to with "predictiveDrive() function" but we have a detailed multi-part tutorial here about the SpaceWar game here:
http://docs2x.smartfoxserver.com/Exampl ... pacewar-p1

Hope it helps