SFML community forums

General => SFML projects => Topic started by: FRex on July 15, 2013, 07:22:00 pm

Title: ee::MiniEd Messy idk-what-and-Box2D-editor (Heavily WIP, screens)
Post by: FRex on July 15, 2013, 07:22:00 pm
This is my messily coded editor that I'm making for my own use. Ideally it'll support serialization, scripting and be so-so Box2D editor while also letting me work with entities made out of components in my game. I'm also trying to just make big part of data drawables(world, tool specific..), all physicals and entity data etc. accessible to classes derieved from Tool so the editor's main loop is just: handlevents(send clicks and moves to tools, let gui know etc.)->clear->drawall->drawgui->display. So far I can add boxes and rotate them and simulate it(editor runs using b2World that never steps and for simulation it clones everything), also display it in simulation (old EEDebugDraw3 class I once posted, original Box2D colors) and in editor(code copied from Box2D but with addition of some things like alpha controllable from gui and highlighting current fixture/body, goal is to make it use customizable colors).
I'm 100% sure it'll never support undo because I can just save often or implement some auto-save or something and because I'm not going to even try and learn to implement command pattern AND editor at once. There is still lots of missing and it's very rough and tool buttons and settings are often placeholders but at least it's a start and it displays and doesn't crash. :)

(http://i39.tinypic.com/15oa1ee.jpg)

(http://i42.tinypic.com/2uj2ele.jpg)
Title: Re: ee::MiniEd Messy idk-what-and-Box2D-editor (Heavily WIP, screens)
Post by: eXpl0it3r on July 16, 2013, 03:12:27 am
From the screenshot it looks good - always like applications that use SFGUI! :P

I hope to see this project turn into a very nice "Box2D" editor!
Title: Re: ee::MiniEd Messy idk-what-and-Box2D-editor (Heavily WIP, screens)
Post by: FRex on July 16, 2013, 03:21:36 am
If you need a good(and pricey) Box2D editor that is fully feature proof there's R.U.B.E. ;D
Title: Re: ee::MiniEd Messy idk-what-and-Box2D-editor (Heavily WIP, screens)
Post by: FRex on July 29, 2013, 09:08:18 pm
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.
(http://i40.tinypic.com/dws9qb.png)
(http://i44.tinypic.com/dcy91w.jpg)
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( ;D ) 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.
Title: Re: ee::MiniEd Messy idk-what-and-Box2D-editor (Heavily WIP, screens)
Post by: MrPlow442 on July 31, 2013, 04:47:33 pm
I was thinking of making something like this because I really need an editor where I can make complex body shapes and export them and I can't really afford R.U.B.E. Could you tell me what libs/tools did you use for serialization and exporting to XML?
Title: Re: ee::MiniEd Messy idk-what-and-Box2D-editor (Heavily WIP, screens)
Post by: FRex on July 31, 2013, 04:55:05 pm
Quote
I can now output XML(yuck..) using pugi for it. hehe.xml:
pugi(xml) is name of the library I use, it's very nice, c++ish and documented well.
http://pugixml.org/
Title: Re: ee::MiniEd Messy idk-what-and-Box2D-editor (Heavily WIP, screens)
Post by: MrPlow442 on July 31, 2013, 06:00:46 pm
Quote
I can now output XML(yuck..) using pugi for it. hehe.xml:
pugi(xml) is name of the library I use, it's very nice, c++ish and documented well.
http://pugixml.org/

Welp!! It's official... I am blind.  :P  Thanks