Comparison of some 2D frameworks/libs

posted May 20, 2010, 3:20 AM by Yuri Ivačković
Well, something that I always had difficulty to find is the opinion of someone that shows me whats the best 2D lib and why.

I've used 3 different packages for game development: Allegro, PopCap SexyApp and Haaf's Game Engine, and the comparison will be made on top of each one.

I gonna use some different aspects of each technology (you can build an AHP using it):
  • Easiness;
  • DirectX/OpenGL integration;
  • Pixel manipulation;
  • File formats;
  • GUI Support;
  • Third party plugins and add-ons;
  • Portability; 
  • Performance;
So lets go!

Easiness

Allegro
This lib have the one of most intuitive and easy of all. It haves some problems, like the lack of standards in the parameters of the functions. Some functions get the output as first parameter and other as the last. Sometimes that can be confusing and anti-productive. Other factor that I do not like in allegro is that it does not have a "update and draw" control. It should be re-coded (and hopefully re-used) on every project. Personally when I want to test something with graphics and drawing I always use Allegro - awesome for prototyping.

Besides the fact that it is an API, not a framework I can give to it a score 8.


SexyApp
SexyApp have a some of embedded tools that makes the job a little bit easier. His API is very, very, very intuitive but it's documentations is a little bit crappy; To make things a little bit simpler, they have a lots of examples. 

It also haves a lot of controls, options and variables - everythin (or at leas 80% of that variables and methods) are public, making things much more practical to work (even with everything public its difficult to make things to crash).

It is written in C++, making everything better organized. Haves comprehensive names and a very strong coding standard. After coding a little while with this framework, everyone can understand why it was named of SexyApp.

Score 8


HGE
This lib is the easier lib that I've seen. Its intuitive, object oriented, concise, well documented, with a lot of samples and haves what is needed.

Score 10

DirectX/OpenGL integration
Allegro
This lib natively uses DirectX on windows and to use OpenGL a plug-in is needed. The OpenGL lib works fine, but I have the feeling of calling native OpenGL instructions, it is a little bit low level, but at least is supported.

Score 7

SexyApp
The SexyApp was built over DirectX and without modifying the sources, it is not possible to use OpenGL. A port to Linux/Mac OS X was made using OpenGL, have a lot of other functionalities like particles, Python integration and 2D physics.

Score 5

HGE
Also built on top of DirectX, and I do not have any knowledge of a OpenGL port.

Score 0

Pixel Manipulation
Allegro
Allegro haves routines for pixel manipulation and some basic drawing functions that are very nice and easy to use. Automatizes the boring part of the work allowing to manipulate every little pixel on the screen.

Score 10

SexyApp
SexyApp allows you to manipulate pixels on a very dirty way. You need to acquire the buffer, manipulate it with ugly bitwise operations, update and release the buffer.

Score 3

HGE
I haven't tried to manipulate pixels in HGE. Considering that its based on DirectX, it is logical that the same work made on SexyApp could work on HGE.

Score 3


File formats
Allegro
Allegro natively supports BMP, PCX, TGA and LBM. For PNG, JPG, and other common formats, it will need some add-ons - at least they exist.

Score 8,66

SexyApp
SexyApp haves support for everything: TGA, JPG, JPG2k, GIF87, GIF89 and even SWFs can be opened and played by this amazing engine. I consider that BMP support is irrelevant, so the score is:

Score 10

HGE
HGE supports BMP. DIB, DDS, JPG, PNG and TGA. Better than that is just by loading PSDs.

Score 9

GUI Support
Allegro
Allegro haves the worst GUI support that could be made by the mankind! It is too ugly, for god sake. A project called "The Allegro GUI Un-uglification" tries to make it better, but it still crappy.

Score 2

SexyApp
The widget support and hierarchy of SexyApp framework is awesome! Have dialogs, buttons, scrollbars, lists, edit box, checkboxes, radio button, and flash widget. Some games like Bejewled and BookWorm can be produced entirely with the widget engine.

A little time ago I've integrated the Mozilla's Gecko into SexyApp framework. Worked pretty fine.

Score 10

HGE
HGE haves an amazing structure to create menus and items, but do not have the same widgets as SexyApp, so almost everything must be coded from scratch.

Score 7

Third party plugins and add-ons
Allegro
Plenty of add ons! Allegro is just like an independent language, everything that you want, you can find.

Score 10

SexyApp
I saw at least three extensions to the SexyApp, but it doesn't have a "pluggable" architecture, making things harder.

Score 5

HGE
No third party extensions as far I know.

Score 0

Portability
Allegro
Natively works on Windows, Mac, Linux, Unix, BSD, PSP, DS, XBOX, bla bla bla. I have the feeling that it can run even on a fridge.

Score 10

SexyApp
The original SexyApp runs on Windows only, but we have the amazing TuxCap mentioned above that runs on Linux and Mac.

Score 7

HGE
Windows only =(

Score 3

Performance
I haven't made any benchmark, its based only on performance.

Allegro
Fast to draw lines, squares and blit shapes. Reasonable on pixel manipulation (faster than CImg).

Score 8

SexyApp
Reasonable for all operations but sometimes I felt it a little bit heavy. I do not recommend it to action games.

Score 6

HGE
Stunning speed! The blitting are very fast, even using rotating sprites. Draws lots of lines and shapes per second also.

Score 9

Other features
Allegro
Allegro haves the basic to build your own framework but it does not have the high level functions and a framework to guide the developer into a standard.

Score 5

SexyApp
The most complete solution of a open source framework built for 2D games that I have ever seen. Even more if you consider the TuxCap or the unfinished Sphi Middleware.

Score 10

HGE
It haves what is needed to make you job easier, but not makes it a "lazy people job".

Score 7,5

Conclusion
As a synthesis, a little table with the scores.  
Allegro SexyApp HGE Easiness 8 8 10 DirectX/OpenGL integration 7 5 0 Pixel manipulation 10 3 3 File formats 8 10 9 GUI Support 2 10 7 Third party plugins and add-ons 10 5 0 Portability 10 7 3 Performance 8 6 9 Average 7,88 6,75 5,13

As is obvious the Allegro got the highest average Score, but I do not recommend it to produce games. I do recommend Allegro to make prototypes, image manipulation algorithms, and other tests. For games that haves lots of windows and options I recommend SexyApp that haves amazing features regarding widgets. And for action games HGE is recommended due to its simplicity and performance.


Comments