[Sugar-devel] GSoC Groupthink Update: SharedTextDemo-4
Gary C Martin
gary at garycmartin.com
Sat Jul 18 12:44:48 EDT 2009
On 18 Jul 2009, at 16:36, Benjamin M. Schwartz wrote:
> Gary C Martin wrote:
>> I just want to raise a note of interest. I've been pondering future
>> possibilities for collaboration in Physics:
>>
>> http://wiki.sugarlabs.org/go/Activities/Physics
>>
>> Still early days for making a call, but Asaf has made great strides
>> in
>> getting Physics storing its world state to Journal.
>
> That's very interesting. It would nicely avoid the solving the really
> hard problem of maintaining real-time coherence between two
> nondeterministic physics engines over a slow link (which is really a
> problem of chaos prevention!).
>
> The first step is to ask: what form does the world state take? If it
> can
> be represented, for example, as a dict of object names and properties,
> then you can simply use the shared-dict from groupthink.
Asaf was already able to integrate with a new Box2D which supports
python pickling of the world state, this works real well already for
saving state to Journal. But, before an official Physics-3 release, we
wanted to be sure Physics has some control over the file format incase
Box2Ds pickeled structures change and potentially break backwards
compatibility for Physics Journal entries. Asaf is now almost done
with a re-work using json, just including the specific scene
properties Physics need, from yesterdays IRC chat:
<asaf> FWIW for each body i'm storing its position, userData, angle,
angularVelocity, linearVelocity and shapes it's attached to
<asaf> if the shape is a circle I store radius, density, restitution,
friction and position relative to body
<asaf> if the shape is a polygon I store the same stuff but insted of
radius I store vertices
<asaf> That for now takes care of everythin drawn, I still have to
take care of joints and controllers
> Of course, getting changes in and out of the model is not so easy.\
Yea... My worry is that at each otherwise simple user edit, many of
the world object properties will have changed (well, certainly most of
the positions/angles/angularVelocities/linearVelocities), so they will
all require transmission and relatively a large merge. Still trying to
get my head around it :-)
Regards,
--Gary
More information about the Sugar-devel
mailing list