02Apr HaXe vs Unity3D vs XNA vs others
8,730 viewsFor the past couple months, I have been trying to determine the best platform to become my primary language for game AI unit development, shaders, and working on theories of improving the Fridge-A* algorithm. However, choosing the right language has become an arduous task. Hardcore programmers will scream “C++ is the only way to go!” while the elites say “C is so much better than C++” and of course there is that one guy who comments “Why would you use anything other than Assembly language?” The problem lies in the fact that I am doing this work on my own and do not have XX hours to write an elaborate garbage collector, manage raw threads, or constantly keep track of hundreds of pointers. On the other hand, I must have enough speed and processing power to do the research and development I want.
Some suggest Java as a game platform as the language is respectable. However, graphics rendering speed and the Java gaming community is poor at best in my humble opinion. I did enjoy using BlitzMax back in the day, but the engine is simply not powerful enough to create something near commercial quality. Also, the popularity of the language is low, and I would have little professional use for learning more of the language. Flash AS3 is my primary profession; however, its performance leaves much to be desired at times. On the other side, Silverlight 3 is looking rather nifty, but the API still looks funky and doesn’t seem like the engine is really mature enough to do any major development in. Perhaps, if Silverlight 4 has near XNA speeds, better shaders and bitmap drawing, and the XAML to C# connection has less oddities in the API… it would be a contender for my list. Aside from the web platform, I could also go for a super high-end engine like Unreal Engine 3 or Source, but I couldn’t ever hope to produce something commercial with it because of the insanely expensive licensing (hundreds of thousands we are talking about!). Of course this is also Torque, but I have not been impressed with any of the games made on the platform, and there is a moderate cost to get started with it.
So I eventually evaluated my choices to XNA, haXe, and Unity3D:

Pros:
- Very fast (Fastest of the choices)
- Great shader support
- C# is a nice language with advanced OOP support
- Xbox and Windows deployment
- Free for indie users
Cons:
- Meant really for just the xbox… there is little support for Windows only deployment and DRM concerns. Also, no luck for Macs.
- Unlike the other two, XNA cannot steam which means a smaller audience because of the hassle of downloading
- Super new so the community is not that large in general

Pros:
- Compiles out to Flash which 98% of users have already installed
- Real-world benchmarks show 2x the speed of Flash 9 using code performance optimizations unique to haXe
- From working with haXe, I will use that same knowledge to build javascript and neko scripts in the future if I wanted
- I can use my existing knowledge of Flash to accelerate my development
- Totally free
Cons:
- No Flash IDE
- Also super new with a small community and little to speak of tutorials
- Still slower than unity3D and XNA
- Currently does not support importing Flash libraries which reduces the amount of existing libraries I can bring over versus just using Flash AS3.

Pros:
- Fastest of the web 3D engine… also nice looking
- Supports developed on Macs and now Windows
- Uses Python for scripting
- Supports large number of users for networking and shaders
Cons:
- No free version to try things out (only 30 day trial)
- Costly software (the indie license has a terrible roster of features making the Pro version the ideal choice)
- Little resources and support for making 2D games… everything is geared for 3D development. This can be a negative thing for me as I like to develop quick 2D testing scenarios for AI scripts. From what I can see, there are few tools for doing advanced bitmap drawing.
Final thoughts:
In truth, I have not made up my mind yet. The pros and cons of all the solutions seem to make every choice the same weight in how it appeals to me. I could forsake all the above options and just go with C++ with Allegro or SDL, but they too have their ups and downs. Allergro is really slow without full DirectX/OpenGL support and SDL seems to have an aged API with little in the future for it. Also, neither of those libraries natively support shaders. XNA would give me all the speed I would need for what I am trying to accomplish, but using a language that streams over the internet would give me a much wider audience.
Well, what do you say readers? Are there other languages I should be looking at? For my next post on the subject, I will try to make some benchmarks in all of the three languages to test their true strengths.


April 3rd, 2009 at 3:01 am
I think you’re approaching things from the wrong angle.
You need to come up with a game design, target platform, and audience, and then choose the right tool for the job. Approach things from the other end. User-focused design, followed by implementation.
Attempting to pick a “primary language” is too development focused. You’re trying to make technical decisions too early, and are potentially hamstringing the success of your game. What are you going to build once you’ve picked your primary language? Is it suited to that language/platform?
April 3rd, 2009 at 7:11 am
What about Flash + Alchemy (C++). You get the access to c++ librabries and it’s tremendous preformance gains, in certain situations. There are also some budding APIs for integrating Unity and Flash.
April 4th, 2009 at 10:18 am
Hey Alan, I haven’t done much research into Alchemy yet, but I expect the pros and cons will be about the same as haXe.
April 4th, 2009 at 10:21 pm
Go with the technology your friends use or the ones with big user-bases and active forums. 2d/3d game technologies are complicated and it pays to have a well attended venue for your questions.
April 4th, 2009 at 11:13 pm
Have you checked out any game engines yet? I actually just found an Actionscript engine (called the Pushbutton Engine) the other day built by some guys affiliated with GarageGames (Torque). Anyway, it apparently integrates with Flex 3 and also makes use of the Box2D physics engine. It’s definitely in its early stages but looks interesting. Here’s a link:
http://pushbuttonengine.com
April 4th, 2009 at 11:57 pm
Hi Greg, thanks for the info! The engine looks very well thought out. However, no matter how good the engine is, Flash AS3 is still very limited in its performance for advanced development. Even with FP10, its hard to produce a game like Doom 1 without severe slowdowns. At least Alchemy and haXe help a little, but even they are limited. *sigh*
April 6th, 2009 at 1:33 am
Hi,
what about Leadwerks and blitmax or C++
April 8th, 2009 at 1:54 pm
Nice post. Amazing how many of us are trying to find the “right” engine to develop in. I agree that it depends on your audience, but it sure would be nice to have one engine cover as many bases as possible. Unity is looking pretty good right about now, except for its low player penetration. Had no idea about PushButton. Will definitely have to check it out.
April 19th, 2009 at 4:39 pm
You’ve got your facts wrong a little. You can use AS3 libraries in haXe. You simply compile your AS3 classes into a SWF, then call -
haxe –gen-hx-classes myClasses.swf
and it’ll generate the necessary haXe extern files. All you do then is include the SWF in your compile script with -
-swf-lib myClasses.swf
and it’ll use the classes you need in your haXe app. You even get full compiler checking thanks to the extern files.
If you’re interested in SDL, why not give NME a try? It’s built for haXe, and if you also use Neash, you can output to SWF (Flash 9/10) and NME / SDL from the same code. It makes for absolute flexibility (though you still don’t have an SDL web plugin… Yet!).
April 20th, 2009 at 7:22 am
Thanks for the info Lee! I didn’t know that it could read SWCs yet. My only worry is that NME/Neash are still very much in beta. Last I heard, sound hasn’t even been ported yet.
May 31st, 2009 at 4:15 pm
The information for Unity3d is incorrect.
With Unity 3d (indie/pro version) you can use C#, Javascript and BOO to program in, not Python.
With Unity iPhone (basic and advanced) you can program with C# and javascript.
Unity is uses Mono(.NET), they have done an awesome job.
August 21st, 2009 at 8:57 pm
Using Haxe’s flash memory class gives the speed improvements attributed to Alchemy…
Another approach that looks extremely appealing is using python, with the Panda3D engine. Panda’s graphic framework is written in C++ for speed, while the programming we do (as users) is in python.
for more details:
http://www.panda3d.org
November 5th, 2009 at 7:42 am
If you want to work with C++, I suggest you check out ClanLib, it’s awesome. As for the ones you mentioned, I’d go with XNA. Simply because it’s incredibly easy to use, but is incredibly powerful. Also, C# is an awesome language
November 30th, 2009 at 11:51 am
I’m sure you know this by now, but Unity’s Indie license is now free.
I was wondering how, if at all, this changes your decision? And did you come to one?
February 12th, 2010 at 6:22 am
Just a note: I am playing with the same choices right now, which is probably why I ended up on your website, and for me the main reason to choose any programming language is the support for content. For example flash is great with video streaming, Unity3D is great with all sorts of 3D models. Java started out nice but doesn’t seem to have developed much. For you, the main content seems to be shaders and hardcore programming, which means XNA or something like Ogre3D.
February 26th, 2010 at 10:18 pm
Flash all the way. Sometimes taking the road less traveled can give you a competitive edge.
I once built an entire interactive environment suit using a nearly non-visible component built in flash (using xml-sockets), javascript for the bulk of client processing, and flashvars to communicate between the two. It allowed the clients MUD to operate seamlessly in multiple browsers with what looked like AJAX–but without all the slowdown
The point is use the tool that is appropriate for the job and target. This day and age small-budget games are all about being affordable, fast, casual, and easy to access.
What fits the bill? Flash and *maybe* unity. Flash 10 can utilize hardware acceleration. Combine that alchemy and lots of static typing via Haxe and you’ve got yourself a recipe for SPEED.
On the plus side you can take your skills and experience with you.
Also nearly everyone has a browser, and nearly everyone has flash installed (as compared to Unity and Silverlight).
This coming from someone who has only been programming for eight months. Go figure
May 4th, 2010 at 3:42 pm
I would use Unity. I was on this same quest(also a flash dev) and that’s where I landed. It was an easy transition from Flash. You can do 2d with it just using image planes and an orthographic camera and still have all the benefits of physics on your 2d objects. I believe they are working on a 2d feature set that will be out soonish but there are a few scripts around that help if you poke around too. I got a game prototype up in a few hours with it my first day. They have a great community too.
July 15th, 2010 at 12:09 am
Unity3D does have a free indie version now, it has almost everything the pro version has.