Hi,
it has been a long time i didn't played with my old project, now i think it is time to end it.
I was playng to syncornise jbox2d ower the network, sending only the start position and the force/torque added to the object.
If the engine is determinist, and the action executed at the same step, we get a fully sincronized world with minimal badwidth usage.
I'm starting to play with a client/server implementation, taht work this way:
Every user has at least an Actor, that is composed by a bosy and at least a Sensor (body with fisturedex.isSendor = true)
every body (physical and sensor) has in it's userData the pointer to his Actor witch has a pointer to the player wuth, finally has a pointer to its socket.
Also every player has a list on action to do on its Actor, and actor has a list of action executed on itself this step.
now, this is the main server loop:
1. for each player, for each Actor, clear action list, then take the pending action for this step (or for older step) and if valid execute them. That way the action is moved on the Actors's action list, and some torque/force is added to the body.
2. physic step
3. for each collision follow this rule:
sensor - sensor: do nothing (or game-logic code, like a trigger)
body - body: do nothing (or game-logic code, like an explosion)
body - sensor: put the body's Actor actiolist to the sensor's player socket.
if this is a new collision, or a collision end, also send a special "createActor" or "destroyActor" action.
actually the only problem is that actual World listener give only new and end collision list, but not the "persistence collision", is there a performance issue, or i can request this feature? 😁
What do you think? As you can see i'm tryng to build a scheletron with other can build up their own logic.
it has been a long time i didn't played with my old project, now i think it is time to end it.
I was playng to syncornise jbox2d ower the network, sending only the start position and the force/torque added to the object.
If the engine is determinist, and the action executed at the same step, we get a fully sincronized world with minimal badwidth usage.
I'm starting to play with a client/server implementation, taht work this way:
Every user has at least an Actor, that is composed by a bosy and at least a Sensor (body with fisturedex.isSendor = true)
every body (physical and sensor) has in it's userData the pointer to his Actor witch has a pointer to the player wuth, finally has a pointer to its socket.
Also every player has a list on action to do on its Actor, and actor has a list of action executed on itself this step.
now, this is the main server loop:
1. for each player, for each Actor, clear action list, then take the pending action for this step (or for older step) and if valid execute them. That way the action is moved on the Actors's action list, and some torque/force is added to the body.
2. physic step
3. for each collision follow this rule:
sensor - sensor: do nothing (or game-logic code, like a trigger)
body - body: do nothing (or game-logic code, like an explosion)
body - sensor: put the body's Actor actiolist to the sensor's player socket.
if this is a new collision, or a collision end, also send a special "createActor" or "destroyActor" action.
actually the only problem is that actual World listener give only new and end collision list, but not the "persistence collision", is there a performance issue, or i can request this feature? 😁
What do you think? As you can see i'm tryng to build a scheletron with other can build up their own logic.