Step Time

gugus

02-05-2007 15:50:22

Hello.NxOgre is fine.But i have a question(very inportant for me:i am trying to develop a multiplayer game):how is updated the time for physic?Does It depend of Ogre or not?
I hope you understood me with my poor english.

betajaen

02-05-2007 16:00:19

NxOgre depends on Ogre for injecting the time, you can override it though.


World* mWorld = World(mRoot, SIMTYPE_CUSTOM);

...

mWorld->simulate(time to inject);
mWorld->render(same time to inject);


I wouldn't use NxOgre for the server though; using PhysX directly in a console type application with a networking library would be perfect.

gugus

02-05-2007 16:38:32

Ok thank.But how do i do i one of the player have a slow PC (for exemple he have 20 FPS and the other have 40 FPS)?The simulation will be all wrong for him...

betajaen

02-05-2007 16:45:03

Perhaps, but if the PhysX simulation is on the server and is handed out equally to each client every x times a second, then it's more fair.

It's something you should plan out before jumping into though.

gugus

02-05-2007 17:23:49

It's something you should plan out before jumping into though:that's what i am doing! :D

but if the PhysX simulation is on the server and is handed out equally to each client every x times a second, then it's more fair:The client who run at 20 FPS need to be re-sincronized each second.And if the client doesn't have a good enought badwitch?

betajaen

02-05-2007 18:09:33

That's unfortunately the thing with networked games; "Lag" is unavoidable and something people will have to put up with.

But simulating the simulation completely on the server is the most fairest and secure way of handling the multi-player world.

Amotea

02-05-2007 18:49:16

This is a very good article to read before starting to plan and code:
http://www.valve-erc.com/srcsdk/general ... rking.html

The following image, taken from the article, pretty much sums it up:

It all relies on the idea that the server is a fraction of time ahead of everyone.

gugus

03-05-2007 11:38:11

thank a lot!It is very interesting!