[Sugar-devel] [Physics Activity] Saving contraptions
Gary C Martin
gary at garycmartin.com
Sun Jun 28 16:12:22 EDT 2009
On 18 Jun 2009, at 02:42, Asaf Paris Mandoki wrote:
> I've been doing some research and I think that the easiest way to
> save a world is by pickling. Pybox2d already supports it so it is
> pretty straightforward. I think this should be implemented at the
> level of Elements and not directly on the activity. Should I do it
> in the modified elements we have inside the activity or should we
> try to unify the different elements versions?
I guess working upstream would be best, is it a dead project now or do
the original authors still have some interest? The Elements site did
seem lacking in maintenance and love :-)
> I personally will prefer to unify the versions to get more benefit
> from the work.
Yes, makes sense.
> We should take into account that after I finish with "world saving"
> I will work on some new features for the activity that will require
> adding features to elements.
Yes, I noticed the layers between gtk+, sugar stuff, elements,
olpcgames, pygames was quite a nasty spaghetti stack to try and work/
look through and to know who could talk to what – found it pretty
tough myself to reference/access to anything useful from the actual
Activity code. Luckily I managed to re-work and trigger some pygame
events created by the toolbox code for the things I needed to add / fix.
> There are other alternatives for world saving. An objection to
> pickling is that is not human readable and we won't be able to edit
> scenes with a text editor but I think that it's better if we add and
> polish editing features directly in the activity. The odds that the
> end user will try to edit a scene with a text editor are minimal.
I can't imagine 98% of users ever considering manual editing, though
one thing to keep in mind is that pickling is Python specific, I guess
there could be a vague possibility of wanting to open a file with
another language (json implementations are widely available). But if
you have a pickling solution, I would not let that stand in you way!
We can't future proof everything :-)
Any other progress/ideas? Physics seems to have been quite a hit a
More information about the Sugar-devel