Multiplayer Ode

Blitz3D Forums/Blitz3D Userlibs/Multiplayer Ode

Santiworld(Posted 2009) [#1]
hi, i working in multiplayer game using jv-ode

first i wan't to know the experiencies, if you have, using ode with multiplayer lan...

i made some advances using netblitz library, for multiplayer..
works fine.. but i need to lear more about ode first to do something good.

for the moment, the mayor problems i have, is to re-positions sometimes the ode objetcs...

how is the correct way to put a ode car in a position, using XYZ and rotation..

i use this command, but donsent work like i want..

	dbodysetposition(car\body,x,y,z)
	dbodysetrotation(car\body,ax,ay,az)
	dBodySetForce(car\body,0,0,0)
	dBodySetTorque(car\body,0,0,0)
	dBodySetAngularVel(car\body,0,0,0)
	dBodySetLinearVel(car\body,0,0,0) 

       ;żżż i need to aplly this code to reset and update the ode data???
	;dSpaceCollide(Space,World,ContactGroup)
	;dWorldQuickStep(World,0.1)
	;dJointGroupEmpty(ContactGroup)




my concept, is, send keys information of all player, and update car position somethimes, like a each second or more.


RifRaf(Posted 2009) [#2]
Keypresses will get you out of sync fast without some sort of syncing every few frames with absolute coordinate value packets. At least thats my eperience.

What ive found to work best so far is,

Client sending packets to server containing XYZ, PITCH,YAW,ROLL. and velocities.

Server broadcasts these to everyone else

Remote players get packet, and check the current packet xyz to where they think you are.. If its way off, then simply interpolate the difference in a very short time, and process the next packet.

But ODE complicates things a bit it think, unless you have one core physics object per vehicle wich all other objects for that vehicle can be cacluated ,once you know that one objects properties.


KimoTech(Posted 2009) [#3]
One very important thing, is to secure, that your update time in the ode update command fits the elapsed time since the last update. if the update time is correct, and all of the othe r computers is too, you will minimize the amount of different calculations between each computer, and like RifRaf said, syncronise the xyz, pitch yaw roll, and important!, the velocity xyz ;)


Santiworld(Posted 2009) [#4]
i don't know how to know the ode car velocitys, xyz vectors, to send to another computer..

when i send the xyz position of one car to another computer, the ode, works like the car have the new velociti of the resposition xyz diference..

i need to send xyz, and ode vectors to re-position a car in the other computer...

with the keys send (very fast) works fine, and the resposition somethimes, the ode can work perfect with lan networks.. i think.. :)

maibe have some problems with the wheels information, maibe the ode needs about wheel position, and data...


RifRaf(Posted 2009) [#5]
I think you are going to hit one hurdle after another , if you didnt plan and code this as a multiplayer game from day one, my one attempt to retrofit multiplayer into a large project was not fun.

I hope you get it sorted though , as the game looks nice.. An alternative is to put in split screen multiplayer.


Santiworld(Posted 2009) [#6]
yes, i rewrite the program from cero the last weekend...

but i don't see to much information about the netblitz library....

i don't know what to do...

i think i can make something for a few player. nothing complex.

about the split screen, yes, that is one option i have to play multiplayer in the same computer..

the other option, is make a multiplayer gosth mode, that is very easy, becouse i don't use ode physics for the cars of net users....
something like trackmania style...

but is ugly, all time, the fun is crash the other cars..