Sign in to follow this  
all_names_taken

Networked physics with PhysX

Recommended Posts

How would one typically integrate PhysX for use with networked physics simulations? In this case, many old simulation frames must be saved, inputs may arrive later than the actual simulation step they belong to, and so on, and we may need to perform some client prediction and run a different simulation on clients than on the host in some cases. Does the PhysX simulation offer support for these things? Or should I use the PhysX SDK only for complex particle effects etc which can run entirely on a single computer and doesn't need much interaction with other computers or correction of small timing errors (for example, it's not disastrous if a smoke grenade is exploded 0.1 seconds later on one client), while using custom physics code for basic character movement and collision detection, which won't be overly complex anyway (basic FPS physics, and perhaps some simple vehicle physics)? Any sample code, links or tips would be appreciated.

Share this post


Link to post
Share on other sites

What it looks like frame by frame is less important than the results of a complex interaction happening (and final reasonably correct settling point). Accuracy and precision as shown to a client can be be somewhat off but still look pretty much the same (when it gets noticeably rediculous -- like things falling in curves when they should go straight down -- then that is the point where you have to be much tighter).

There are also game methods to incrementally correct movements to make up for late data (and temporal delays over the internet) where a predicttion is made and a sudden late change makes continuing that prediction wrong, the system then slowly adjusts the paths to bring the clients representation back to match the server state.

I have no idea what PhysX has built into it (especailly for prediction/correction) and its most likely you will have to do those things yourself.

I would assume that the server would need to have the PhysX running in it because it is the arbiter of the real game state, but there are likely plenty of cosmetic effects which dont effect game play that the client would make use of PhysX as well.


Generally games requiring split second corrections all the time dont work too well over the internet because the temporal distortions cause to much noticable anomalies (too many obvious corrections which impact player interactions).


Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this