Is there an asset editor and how fast box2d runs?

Monkey Forums/Monkey Beginners/Is there an asset editor and how fast box2d runs?

Beliar(Posted 2013) [#1]
Hello there.

I have two main questions, I've downloaded the latest free version but it seems that it only has a code editor.

I would like to know if there's a way to use a graphical editor to create stuff like sprites with box2d properties like collider shapes, center of mass, joints, etc. and maybe save the thing as an instantiable object. Perhaps it's necessary to use an external editor, either way I have no idea on how to do that.

Another thing is regarding the performance of the box2D port, it seems it's actually a port of a port (C>Flash>Monkey) I wonder if the performance is any good.

Thank you in advance.


Gerry Quinn(Posted 2013) [#2]
(1) Definitely no internal editor for that. I don't know if there is an external editor, but I don't use box2D.

(2) Best thing is try some samples and judge for yourself. With regard to performance, my feeling is that Monkey's basic structure is similar to that of Java, Flash and HTML5, so any overhead should be slight. With C++ it converts to a somewhat 'managed' version of the language, but C++ is stupid fast anyway and also very adaptable.

The only major 'gotcha' I know of in regard to Monkey speed is that passing images through a colour filter on HTML5 is slow, which hits you when you do coloured text using the current text-drawing modules. You can avoid it or work around it if you need to.


AdamRedwoods(Posted 2013) [#3]
in addition...

1. Use tiled (http://www.mapeditor.org/) plus fantomEngine (http://www.fantomgl.com/). not sure if he has a box2D importer, but he might so check with the author.

2. it's fast, except on Android because Java isn't using accelerated arm math. this would need some JNI magic. BUT-- it's fast enough for most needs (<100 objects actively colliding at once). remember to test android speed in RELEASE mode, since DEBUG mode will slow it down considerably.


skape(Posted 2013) [#4]
Yes, fantomEngine has a box2D object importer (at least a basic one.) It can import objects created in Physics Editor (http://www.codeandweb.com/physicseditor) or a program that can export a compatible format I suppose... See: http://www.fantomgl.com/files/feDocs/cftBox2D.monkey.html#203CreatePolygon

Yes, it's fast. At least reasonably. Worst case: I've run games with ~200 box2D rectangular sprites colliding at once on my Galaxy Note II keeping 60 fps... results may vary though.


Beliar(Posted 2013) [#5]
Thank you guys. I'm going to check those links.

I'm planning to make a physics-based game (not intensive) and I need an easy way to create 'assets' for that game, because I'm planning to have lots of them, so some kind of graphical editor that allows me to add sprites, configure joints and rigidbodies for them and somehow save them as assets that can be loaded easily would be handy. These things doesn't sound easy to code, I mean, an asset loader shouldn't be too hard but a graphical editor and a way to 'store' the data (incl. physics data) sounds very difficult (I think these objects aren't easily serialized), but perhaps I can take a look on other opensource projects (especially python as it's quite easy to understand, the drawback is that generally they make use of a s-load of external libraries) and 'steal' some ideas and concepts that are proved to work properly.

I understand that Monkey is intended mainly for games on the 'simpler' side and it's not a visual game developing environment, but imho a visual editor that is object oriented and allows you to "save" your asset in a way that can be easily instanced in your main game is really handy. The ability to make code oriented to 'assets' (e.g. enemies) and 'attach' them to the actual 'visual' object (i.e. sprites with physics, sounds, animations and stuff) makes game development so much easier imho. Of course Monkey is more a language than an actual game engine, so maybe I'm asking too much.

Nevertheless Monkey seems really promising, I'm definitely going to try it for a while. The ability to compile 'native' binaries is awesome.


Sammy(Posted 2013) [#6]
There is a native Android target in the works, which should greatly increase the speed of the Box2D Android port.


muddy_shoes(Posted 2013) [#7]
I haven't looked much into it but it shouldn't be too difficult to write an importer for the files spat out by RUBE or similar. There are a few things that are in the latest C Box2d that aren't in the Monkey version but it should be possible to avoid them.

As for speed, it just depends what you're doing on what platform and what you expect. If you're targeting low-end Android devices and expecting to match Angry Birds' tweaked NDK Box2D port for performance then you may be disappointed. Mostly it's not far off other cross-platform implementations. For example the gap between the Monkey port and the JNI wrapped LibGDX version is around 20% based on the testbed scenes. Different platforms have different weaknesses though so you can't really know if something will run like a dog until you try it.


MikeHart(Posted 2013) [#8]
On Android you should set the minimum SDK version to at least 9. The garbage collector before that takes to long when it collects the data.


Volker(Posted 2013) [#9]
Graphical Editor:
As said before, there is TilEd for creating maps and placing objects via the object layer.
There is some support for it included in Diddy (!) and Ignition framework (which has it's own map editor too).
All games in my sig are made with box2d. If you take a look at Bubble Tournament, it targets even lower
android devices and has ~60 dynamical bodies (no sleeping) on screen with a lot of contacts at 30 fps.
Under XNA I can have 30-40 percent more.

Getting started:
A box2d screen to use with Diddy:
http://www.monkeycoder.co.nz/Community/posts.php?topic=1764
A small framework:
http://www.monkeycoder.co.nz/Community/posts.php?topic=3106&page=1