Trying to understand the predictiveDrive() function

Post here your questions about the Flash / Flex / Air API for SFS2X

Moderators: Lapo, Bax

Aditya
Posts: 16
Joined: 15 Jul 2014, 11:23

Trying to understand the predictiveDrive() function

Postby Aditya » 18 Feb 2015, 13:32

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.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Trying to understand the predictiveDrive() function

Postby Lapo » 20 Feb 2015, 18:36

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
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “SFS2X ActionScript 3 API”

Who is online

Users browsing this forum: No registered users and 14 guests