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
16 Comments
Trackbacks for this post
-
[…] 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 […]
-
[…] Flax HTML5 Game Engine Development Diary Part 1 […]
-
[…] 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 […]
-
[…] Flax HTML5 Game Engine Development Diary Part 1 […]
-
[…] Flax HTML5 Game Engine Development Diary Part 1 […]
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!
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.
I had to modify the library to get it working. There were few easy-to-fix bugs. I haven’t the permission to update the source code, so I posted my updates on this ticket: http://code.google.com/p/gwtprojsonserializer/issues/detail?id=3
Also, you can look at the library GWT JSON RPC: http://android.git.kernel.org/?p=tools/gwtjsonrpc.git;a=blob;f=README;hb=HEAD
The problem I have with this one is it is tight to a bunch of stuff I don’t really need.
Good luck!
I checked out that jar you submitted it works fine thanks. I had actually noticed that bug myself, but for some reason it didn’t work when I removed it. Thanks again. Though I am not sure does the library support collections, such as arrays or lists. I am currently looking into this in both GWT-ent and gwtprojsonserializer.
I am using it to serialize a List of serialization object. I fixed few more bugs but I still dont have the permission to submit them on the main line:( I will email my latest version to you.
Cheers.
Well, I can’t find your email. I will post the new jar on the same issue page then.
ciaran AT flax.ie for future reference. I haven’t looked into it much yet, in the process, but I have a class which has an int array in it but it doesn’t seem to serializes the array only the single properties of the class see the sample code I am working on here -> EDIT (updated link, wrong one linked to sample code for serialization with the GWT-ent lib) http://ubuntuone.com/p/Ej7/
updated link was the wrong one it linked to sample code for serialization with the GWT-ent lib) here is the correct one http://ubuntuone.com/p/Ej7/
EDIT Arrays don’t work put as you say Lists do so I am pretty happy. Thanks very much for your help.