Tuesday, March 24, 2015

Godot H5 build

The Godot engine is a pretty good alternative for any of the 2D/3D open source engines out there. One if the features that got me excited about the engine was the Html5 support.
With one click of the button you can export the game onto any of the platforms android, iOS, mac, Linux and html5. The only problem... The h5 exporter didn't work right out of the box for 1.0 version of Godot.
I looked at it and was unable to figure out what was going on. I searched their forums, Facebook page and the only answer I got was that it was broken and that the devs knew about it.
The html5 exporter was based on emscripten. I downloaded the source code and tried to compile for h5. The platforms is described as JavaScript.
The compilation was working fine but linking not so much. It would report a lot of unresolved symbols .. The basic things like gd script were not working. I had to look up how scons worked. Had to figure out why the existing build wasn't working. ... Then I came across a bug report that said that the emscripten was too strict about the order of object files included in an archive and would straight out not include them.
The solution for this was to use the default .bc format output for creating archive  for emscripten compiler/linker.
I created a sample scons app to figure out how to change the build config variables and was able to get it to work. I quickly created a pull request for the build fix and posted it on Godot git repo.
I was able to learn scons and the emscripten both at the same time.

You can pick the godot build that works for H5 from here https://github.com/vkbsb/godot/tree/h5_canvas_polygon_fix

Friday, March 06, 2015

Flash animations in GoDot Engine

If you have not heard about GoDot game engine,.. you should check it out right away.. godotengine.org

Last time, i wrote a blog post about my experience making a simple physics game to GoDot Engine.
Though there are a bunch of free options announced during the GDC this year, i thought ill' contribute to the engine. The one piece that is most important for game dev is the pipeline for the engine.

One of the most common tools used for 2D animations is Flash. I have been using a library called Super Animation for almost all the games we've made for android at TMG. It's  a  free tool which lets you convert swf files to .sam files. This file can then be loaded in Cocos2Dx using the Open source loader library https://github.com/raymondlu/super-animation-samples

I thought it would be a good idea to port this cpp library to GoDot so that i understand how to write custom modules for the engine.

This is the video of the module in action. I have exposed the methods for basic operations like loading an animation file, Playing a particular animation / pausing it etc. 

I still want to add a bunch of editor related things but i think its' in a state where i can share with others and see if i can find more contributors.

The module is hosted at https://github.com/vkbsb/godot_sam