I can now output XML(yuck..) using pugi for it. hehe.xml:
<?xml version="1.0"?>
<Box2D>
<bodies>
<body active="true" allowSleep="true" angle="0.864374" angularDamping="0" angularVelocity="0" awake="true" bullet="false" fixedRotation="false" gravityScale="1" linearDamping="0" linearVelocityX="0" linearVelocityY="0" positionX="12.2812" positionY="8.29687" type="2">
<fixtures>
<fixture density="1" friction="0.2" isSensor="false" restitution="0" shape="2">
<vertex x="-2.34375" y="-1.70312" />
<vertex x="2.34375" y="-1.70312" />
<vertex x="2.34375" y="1.70312" />
<vertex x="-2.34375" y="1.70312" />
</fixture>
</fixtures>
</body>
<body active="true" allowSleep="true" angle="0" angularDamping="0" angularVelocity="0" awake="true" bullet="false" fixedRotation="false" gravityScale="1" linearDamping="0" linearVelocityX="0" linearVelocityY="0" positionX="14.0781" positionY="16.2031" type="0">
<fixtures>
<fixture density="1" friction="0.2" isSensor="false" restitution="0" shape="2">
<vertex x="-9.29688" y="-1.92187" />
<vertex x="9.29688" y="-1.92187" />
<vertex x="9.29688" y="1.92187" />
<vertex x="-9.29688" y="1.92187" />
</fixture>
</fixtures>
</body>
</bodies>
</Box2D>
It looks ugly but if I'd make every property its own node it'd be too verbose, even making it empty nodes with one attribute would be too verbose. Event this looks
very verbose compared to lua, json, bitsquid sjson or doomscript but they are all for people and this is mostly for machine reading so I guess it fits.
Now it's actually at usable state for
some purpose, not ideal or optimal(it honestly can't be ideal with one inexperienced coder with it and I'm not going to go into premature optimization like reducing xmls size by cutting out default attributes for fixtures and bodies), I still don't have a ton of things I want to have in but I can make boxes, move them, rotate them and delete them and move camera around and zoom in/out, but such amount of features is actually enough for a simple platformer game. I should probably not compare it to rube because it's very unfavorable for minied(
) and it's a different design principle, it will be meant for quick prototyping but more integrated, ie. save-map-to-temporary-file-and-launch-game-on-it and it's not meant to save entire world, there is not going to be gravity, step etc., these will be adjustable in simulation but it's just for completion, editor really shouldn't configure things like THAT IMO.
The most important thing is going to be xml config/lua scripting to have my game specific things appear in editor's guis, render on map in editor and save themselves to xml file as pcdata etc.