Flax HTML5 Game Engine Development Diary Part 1

Well, it’s been almost 3 weeks since we started full time work on our HTML5 game engine, Flax. Some of these days have been quite productive and other days the work just came to grinding halt because of technologies we were hoping to use or features that we where hoping to exploit deciding not to work. However, work is progressing quite well now and the design document is starting to come together nicely.


So what is this Flax Engine which we have heard passing reference to with little detail? The Flax Project is first and foremost a blog, from which we hope many different experimental projects will spawn. The first of which is the Flax HTML5 Game Engine. The Flax engine is our shot at making a web game engine which we can use to rapidly develop simple games for web platforms such as Facebook, the Google Chrome app store, Android, iPhone and basically any device with a modern web browser.


With only 4 weeks left until college starts up again the pressure is on for us to complete this design document, and get even a beta version up and running, because once college starts there will be less time to work on the project.

What I worked on this week

This week I worked on quite a few different engine components but the two most notable and troublesome ones were the Events system and the file handling system. FileHandle was causing us some problems as my original hope to be able to serialize objects client side into something like JSON and save them to a file on the server turned out to be extremely difficult. Now remember we are using Google Web Toolkit, not actual JavaScript, which is where the block comes into play. Converting a JavaScript object into a JSON string is simple, but not when using GWT. Its somewhat hard to explain so I did this quick flow diagram.



The problem lies in the fact we are using GWT to generate our JavaScript code, which converts our highly complex Java class into JavaScript classes, these are then quite difficult to interact with using GWT native methods and currently there exists no working Google Web ToolKit library that has implemented serialization for client side. After 4 days of googling and trying so many different libraries I am pretty confident in saying that we can’t do it. (Though I would be extremely happy if someone could prove me wrong.)

Soluation has been found Flax Engine: GWT client-side JSON serialization and deserialization



Flax Events System

After thinking about how many objects that could exist in a game, I soon realised that registering each object with all the other objects in the game to listen for events from one another would case some spaghetti junction architecture to form, causing quite a lot of messy unscalable code. So after some probing around the internet I was directed to this talk Google I/O 2009 – Best Practices for Architecting GWT App by Ray Ryan. He spoke about an event bus type architecture to achieve more decoupling and reduction in spaghetti junction architecture in GWT apps. Based on that I have taken that root for the events system in Flax.


So that’s me for the weekend. Its finally here so a few pints wouldn’t go astray. The weather is amazing in Carlow at the moment so it’s just as well it’s the weekend. That’s my diary article done for the week and here is Carls Flax HTML5 Game Engine Development Diary Part 2

About the Author

Ciarán McCann

Flax Project Founder - Ciarán McCann is an extremely passionate and motivated programmer who has been programming for about 4 years now. Currently attending Carlow I.T studying computer games development. He has experience in many different programming languages, markup languages and general technologies. His role in the Flax Project is as a blogger/Web Designer and Flax Engine programmer. Please excuse any bad grammar/spelling, I am a bit on the Dyslexic side. Follow me on Twitter for info on what I am working on.

Visit Website

16 Comments

  1. Jani Hartikainen August 28, 2010

    Would love to read more about this, for example about your technical solutions like rendering in the engine, since I’ve done some JS game development as well. Subscribed 🙂

    • Thanks for the comment, I will include some more technical information about the rendering in my next Dev Diary. Thanks for your support.

    • Don’t worry, there’s more info to follow soon. Thanks for subscribing!

  2. I see you are doing some JSON serialization and de-serialization. How do you do this? I was looking for a library to do this last week and I found this project to be the closest to what I wanted: http://code.google.com/p/gwtprojsonserializer/

    • Yes I have come across that library before, but could never get it to work. I will be doing a follow up post on this topic during the week so keep an eye out for that. I are working on a solution using the GWT-ent library.

Trackbacks for this post

  1. […] This post was mentioned on Twitter by Proggit Articles, Carl S. Lange. Carl S. Lange said: A fairly informative, technical post by @C_McCann on how the Flax Engine’s progressing. http://j.mp/btQLBv […]

  2. […] Flax HTML5 Game Engine Development Diary Part 1 […]

  3. […] Ciarán McCann is an extremely passionate and motivated programmer who has been programming for about 4 years now. Currently attending Carlow I.T studying computer games development. He has experience in many different programming languages, markup languages and general technologies. His role in the Flax Project is as a blogger/Web Designer and Flax Engine architect/programmer. My interests span all thinks technology orientated, though I like to keep fit and visit the gym on a regular basis. I also enjoy a good session. Please excuse any bad grammar/spelling, I am a bit on the Dyslexic side. Follow me on Twitter for info on what I am working on. Related posts:Flax HTML5 Game Engine Development Diary Part 1 […]

  4. […] Flax HTML5 Game Engine Development Diary Part 1 […]

  5. […] Flax HTML5 Game Engine Development Diary Part 1 […]