[NxOgre 0.9] How to simulate on client

xadh00m

07-05-2008 10:16:15

Hi!

I have a client server application where both parts simulate the physical behaviour of objects.
My problem is that the server has the authority to change the current pose of all objects on the client. How should I do this correction right with nxOgre bodies?
I know the Gaffer site which says a lot about networking physics, but I just want to know how I should intercept the pose and force information of a body on the client right.

betajaen

07-05-2008 13:07:59

You can directly set the pose of the object directly, but you should also set the angular/linear velocity at the same time. However I would just make the all of the Actors kinematic so they won't move on their own. Better still, I would drop NxOgre on the client side and just move the SceneNodes by hand.

Bleeding will have a better solution to this though, but your using 0.9 which I can't do anything about.

xadh00m

07-05-2008 14:36:13

Thanks for your reply.

I think I understand the problem with just sending the pose data. With a local force left on the client there could
still "nag some force on the cube" where it shouldnt.
:wink:

Are angular and linear velocity the only physical information (per body) which determines its physical state at the given frame?

May I ask how bleeding manages this task?

I agree with you to just simulate the physic on the server and send the results to the clients, but unfortunately I need some kind of prediction and the most accurate one would be to simulate the next physical frame on the client locally... Maybe I could just use angular and linear velocity and predict the next frame manually. but then I would miss collisions...

betajaen

07-05-2008 15:51:10

Bleeding, will eventually have a class called "SceneSource" which allows you to transmit or receive all or some of the Scene to another client(s). It operates on the same principal as the RenderingSystem (infact the RenderSystem in Bleeding can be adapted to a network library).

NickM

07-05-2008 20:17:05

I'd be interested to see how you get on doing this as it's something that I'll be looking at for my game very soon, please keep us informed about what works and what doesn't. :D

betajaen

07-05-2008 20:35:51

If you meant that reply to me.

Then it certainly isn't a priority at the moment, there are a few things to sort out first; My BitStream compression class concept I have planned out, some sort of RenderSystem abstract like interface to a network library, I cannot be partial to which network lib to use, and of course plenty of testing and theory to be planned.

Once I've sorted out serialisation, the resource system and the million of other requests and fixes, I'll have a small stab at it.


But don't feel I don't want it. I do, infact the game I want to start in a few months depends on such a thing.

NickM

08-05-2008 06:12:10

I actually meant both of you, keep up the good work. :)

xadh00m

08-05-2008 08:59:37

If you meant that reply to me.

My BitStream compression class concept I have planned out, some sort of RenderSystem abstract like interface to a network library, I cannot be partial
to which network lib to use, and of course plenty of testing and theory to be planned.


We currently work with RakNet. It provides a good flexibility and performance. Maybe you could find some interesting concepts there,
especially for bitstream, and networking concepts (server/client, PeerToPeer, RPCs etc.).

betajaen

08-05-2008 09:03:49

I've been looking at RakNet too, it's a nice library. I even took the BitStream compression idea from it. But like I said, I cannot specify which network library to use in NxOgre, at the most. I can only provide some sort of interface, like I do currently with the RenderSystem.

I will get into this properly when I start my new game in a few months, it requires networking and NxOgre at the same time.