Sign in to follow this  

WiEngine: A lesser known wonderful cross platform 2D game engine

Recommended Posts

Animate2D    182
I've been asked by Luma to be the english speaking spoke person for WiEngine so to speak. The developers are base in china. I've been wanting to add this post for a while now so here it is.

WiEngine is a cocos2d and cocos2d-x like 2D game engine developed by, a company based in china. Now before selecting a game engine for my project I went through the rigorous process of evaluating one first. Most of my experience is java based. So initially before developing for iOS was a thought, I wanted to stay in my comfort zone. My game was going to be so simple I even considered android animation APIs. So in this order I evaluated:[list]
[*]Android Animation framework
Open GL from Java using Android java APIs was not evaluated since AndEngine offers a real 2D java game engine with a higher level API and makes Open GL calls via java. So what is the difference between my calls to open gl in java or AndEngine's? Not much so I just decided to evaluate AndEngine.

[u][size=5]The Android Animation Framework:[/size][/u]
I looked at the android SDK example project and seemed to zero in on the Animation Framework for my needs. The bouncing balls examples was expanded to bounce 75 balls at once. With this simple test, although I probably didn't need to go as far as 75, it was already apparent android animation framework would be inadequate. High degree of disturbing pauses and and jerkiness made it unsatisfactory for my gaming needs. And in digging into the source, low and behold new ArrayList in the core that you could do nothing about after taking great pains to ensure you are not allocating objects in my adaptation which reduces performance and adds jank considerably. I did not dig further in the source i would have probably found more android performance faux paus. In fact you will need to sacrifice good code style for performance to write a non pausing java game. Something I was willing to do at the time to stay in java but then again i am flexible.

On the theme of wanting to stay in my comfort zone I looked into AndEngine which is a 2D game engine written in Java . AndEngine demo was available on android market so you could see first hand what this thing was gonna be about. This is very well written object oriented java that had a great number of examples to choose from. And a highly popular free game called bunny shooter downloaded over 5 million times.

The first problem I encountered was that at the time the examples were written for the old version of AndEngine and the code was refactored to a new structure in the build I downloaded.

No problem, in the name of learning the API I thought lets port some examples to the new API. I did so, and got the parallax example to work. I emailed the developer with excitement, got no response. Though in further study of the demo project and reading some of the comments in the app market and various message boards, there were noticeable pauses and jank from time to time. Some of the particle examples ran at sub par framerates. I didn't know this because I was green, completely new to this stuff. Old veterans said that this was totally unacceptable. But even considering this, the split camera example I thought was really cool as well as other examples. This was a strong contender until....

I noticed the WiEngine demo app in the android market. I was actually searching for cocos2d and hadn't realized I was looking at a WiEngine demo until the next day.

I was absolutely captivated my the utter butter smoothness achieved on the android platform with this engine. The shear number of examples to look at. Two particular examples really caught my eye. The revolute joint in the box2d collection of examples with a simple chain swinging back and forth. So butter smooth and fluid. It was almost surreal. Then the parallax example in node demos. So fluid and glides with speed without a hiccup. This is when I truly fully understood that there is a problem in android somewhere (2.3 at the time) and android experience can be equally smooth as the iOS experience. So it is obvious to say I started investigating WiEngine.

My reservation at the time was that WiEngine then was closed source. As of October 2012 the source is available on GIT hub. I didn't care so much because the result of the end product was so good, it really didn't look as if I needed to get under the hood to figure out a critical issue or two.

Downloaded the android build from containing the libraries, pure java examples, and native ndk examples. [color=#0000ff] [size=5][b]To my amazement 20,000 lines of java examples. 20,000 lines of c++ examples not including header files and LUA script support![/b][/size][/color] If there is anything I love, it is a huge example base. I care not that a lot of the documentation is in chinese and the company home page is in chinese. The code is written in english and nothing speaks louder and more clearly than a big example base of code. The rest I will figure out and or use google translate and try my best to interpret the result. Also because the API is similar to cocos2d, I figure documentation for cocos2d would be enough to get the gist of what I need to do in WiEngine. But that never happened because there is an example for nearly everything you can do with WiEngine.

Other delights: First mission was to build the examples from scratch, which happened without a hitch, with both the java and the ndk examples.
The particle examples run a full framerate supported by my android device. Another big plus. So indeed there were some problems in the AndEngine implementation. And the old salt was right.

At this point I have to take a look at cocos2d-x because it is open source when at the time WiEngine is not (but is now available in GIT hub).
cocos2d-x also support quite a vast number of platforms that are actually no longer supported by the originator of the platform.[list]
[*]Android - stable well tested 2.0~2.3, 3.0~3.1, games have more than 16.6 million downloads
[*]Windows - stable WinXP, Vista, Win7. Please upgrade the driver of your video card if you meet problems on opengl functions
[*]Bada - Stable Finished in v0.10.0. Some alpha users have released games onto samsung store, and have totally 90,000+ downloads
[*]Marmalade - Stable since 0.11.0 Several games are released with this port. Giovanni Zito and Francis Styck are maintaining this port
[*]Linux Ubuntu - Usable Linux port uses OpenGL directly.
[*]LePhone - usable unknown. 2 Recommended games in
[*]MeeGo - Deprecated Contributed by ExitGames. This port is finished but unmerged. MeeGo is deprecated by Nokia & Intel after ExitGames finished this port, oops
[*]WoPhone - Deprecated more than 20 purchased commercial games in 2011. But this platform has no news since 2012
[*]Mac OS X - Coming Soon NetDragon has port 2dx onto OSX, sources will be open at Feb 2012
[*]Windows Phone 7 - PerAlpha Release We call it cocos2d-xna. The framework and games should be rewritten totally in c#
This list of supported platforms was quite compelling too. At the time Windows Phone 7 was mentioned as a future platform and it looks like they got an alpha release out.

So I downloaded the source and figured lets try this out. I know I am not the savy hacker I would like to be, but it took way too long for me to figure out how to build this thing. Where as for WiEngine it just built out of the box as you would expect. I eventually found some directions for how to build it for android ndk and got their really simplistic hello cocos2d-x example running. Ok great, where are the rest of the examples? Well these guys are very busy supporting platforms or I simply cannot find the example base. I'm new and going to need the examples. So even though I felt I should have been using cocos2d-x due to being open source at the time and the number of supported platforms WiEngine supported the major ones I should be concerned with at the time: Android, iOS, Windows 7, Mac OS X. And of those, I'm really only interested in two. As for the cocos2d-x windows phone 7 support, well will that work in windows 8? I don't know and there seems to be doubt that xna will be supported on windows 8. So perhaps effort gone waisted again as it had for the MeeGo and WoPhone port.

I stuck with WiEngine using java as a crutch before going to C++ directly after getting comfortable with how the API works.

Future posts with respect to WiEngine may come with detailed breakdown of how to use certain APIs, but it is somewhat redundant to do so.
Though if asked, I may.

Enjoy! Edited by Animate2D

Share this post

Link to post
Share on other sites
Sign in to follow this