Sign in to follow this  
VitaliBR

Physics in Multiplayer

Recommended Posts

Hi!

I have the basic structure of my server and client ready (I'm using RakNet).
I'm torn over repaying do the basics (the update of the positions of players). But I do not know how to do this, I'm using the PhysX and can not find anything to help me (article/books/tutorials..)

For the player to walk, I apply a force on the axis chosen.
but how do I move that the player is also in the other clients?


Can I leave my server without physics (physX)?

Thanks

Share this post


Link to post
Share on other sites
Yes guy,
i read the faq :) and read that article very interesting:
http://gafferongames.com/

but needed to know how to do exactly with the PhysX because it possesses character controllers for the players, and I have questions regarding the performance (if I use character controller on all clients, or the server)
I'm kinda lost about this :(

Share this post


Link to post
Share on other sites
If you want to know how a particular piece of software performs, then I suggest you set up a scene with 100 characters walking in circles or something, and simply measure how fast or slow that runs.

For character controller networking, there are two options: Send inputs, or send state snapshots. Even if you choose to send inputs (a la Gaffer), you have to send state snapshots every so often to compensate for any deviations that will inevitably creep in.

Share this post


Link to post
Share on other sites
If you're sending the position data over the network, then all you would really have to do is:
1. Receive new connection message.
2. Create player on all clients.
3. Apply simple physics on that object
4. Send Position Data

Then everything should be taken care of since your applying you're force thru the actual program, then when you send you're data it should reflect those changes on all clients.

Share this post


Link to post
Share on other sites
As I understand from reading the http://gafferongames.com/game-physics/networked-physics/ is that each customer will have only your character controller (physx) and the server will create all the character controllers, right?

Share this post


Link to post
Share on other sites
Quote:
Original post by hplus0603
All clients will have all character controllers for entities they see.


but then the only advantage of the server to do physics calculations, it was because the cheats?

and for example, my character controller floor, I apply a force using player-> addForce (1.0,0.0,0.0), I do this in the server or the client?

[Edited by - VitaliBR on November 19, 2010 6:03:48 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by VitaliBR
but then the only advantage of the server to do physics calculations, it was because the cheats?

and for example, my character controller floor, I apply a force using player-> addForce (1.0,0.0,0.0), I do this in the server or the client?


No, you still need to do it in both places. The reason you do it on the server is so you can send periodic state updates ("baselines") to all viewers, to compensate against sync drift over time.

You add the force both on client and server, so that they simulate the same thing.

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