network and determinism

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.
Please check the FAQ. https://code.google.com/p/box2d/wiki/FAQ
Time ago we already discussed this on this forum 🙂

i'm confident about java's math determinism on different system, but i know for sure we can use strictfp

Actually i've developed a basic implementation (https://github.com/lestofante/testFisica), now it is time to develop another basic implementation of network system (using netty) and i'll add this in my game.

let's see if we can be deterministic without have to step all the history of the world!

but i have a pair of question:
-deleted- my bad sorry

edit: the old discussion viewtopic.php?f=3&t=4614&start=0
i have a new big question.

As the client have only a part of the body on server, i don't know if the contact are executed on the same order as in the clients! if not, then multiple contatac can result in different result (a little example in fixed point (precision 2.1), but similar (worse) will happen on flaoting)
11.1 * (0.1 *0.1) = 11.1 * 0 = 0
(11.1 * 0.1) *0.1 = 1.1 * 0.1 = 0.1

edit: the idea are or to syncornize the Contact result's on body(taht somehow break the idea of full-delta-sync), or to send to the client all the island (full-delta-sync BUT possibility to hack on the client side.....

Original thread: https://box2d.org/forum/viewtopic.php?t=9540