Game Development Community

Considering the alternatives

by BeyondtheTech · in iTorque 2D · 09/04/2009 (12:08 am) · 14 replies

Please note that this thread was not meant nor should it be used to bash Torque in any way, or cause a flame war.

While this site's primary focus is on the Torque engine, I believe that it is good practice to know about the competing packages and what they're up to lately. After all, an informed customer is better than an uninformed one, who may no doubt cause himself/herself a lot of grief, frustration, and unnecessary or unwarranted venting on the forums. Most of us on these forums are paid Torque owners, and some of us even have a few other engines and development kits they have purchased prior or since their purchase of Torque. Isn't the goal, of course, to create the best game they can, no matter what tools they have at their disposal?

Gendai Games just issued a press release regarding their GameSalad game development kit (GDK). If you've ever followed them from the beginning, you will know that GameSalad is also a 2D GDK similar to Torque 2D, and even has some GUI similarities. It's currently in beta, but what's unique is that it's been specifically made to create games for the iPhone. Up until now, they have only allowed their beta users the ability to develop games that can be published to a website, where a Safari plug-in can run the game, similar to Adobe Flash Player. They have just announced that details for iPhone export will be available as early as next week. There is no pricing structure for App Store publishing yet, but they state that "it will be very competitive." The developers' forum is relatively small, but the documentation and tutorials are put together quite well for game designers of all levels of experience to understand. Keep in mind that this GDK was designed specifically with the iPhone in mind, so you can safely assume that the engine was developed from the ground up for that one goal, unlike Torque 2D for iPhone which is basically an evolution of code over the past several years. GameSalad, though, is nowhere near as robust in terms of injecting your own code, plug-ins, or scripts, or customizing your game to exactly the way you want it, so it may not be for everyone.

Torque, in general, has always been compared to Unity, and both sides have stood their ground for their own justified reasons. While Torque has two flavors - one for 3D, and one for 2D, Unity iPhone has always been a 3D GDK. That in itself makes it a more difficult system to learn, especially if all you've learned to deal with is in 2D, sprite manipulation, etc. It is interesting to note, though, that Unity iPhone 1.5 has recently been released, touting a whopping 3X performance increase over its last version update, among other interesting features, such as optimization for the VFP co-processor on the iPhone, integrated anti-piracy protection, integrated video playback, keyboard support, GPS/location-based services, and texture-shading for the new iPhone 3GS while providing a fallback for previous generation iPhones.

As I stated before, I'm a paid Torque owner with one released Torque 2D game (Archangel: Fate of the Galactic Commonwealth, http://tinyurl.com/archvideo) under my belt. I may have some bias toward Torque, but I personally have to consider the alternatives when we're faced with competing products that can or will be able to perform better, or when they have those one or two features I really want to incorporate in my game to make it a better seller on the App Store - which I also previously stated, is the ultimate goal for most of us here. With all its features, I don't know if I'm ready for Unity yet, considering I can barely think past two dimensions and I'm intimidated by any 3D design product. GameSalad may be too basic for many people's needs, but if it has the performance I need so that several dozen sprites moving simultaneously won't make my game come to a hideous crawl, or if the final binary of my game isn't so bloated that it can be downloaded without Wi-Fi from the App Store, or if it's simple and stable enough to use and develop on without extensive knowledge of scripting and code tweaking, I just might make that compromise.

Like many others, I'm hoping against hope that 1.2.1, or 1.3, or whatever the next version of Torque 2D for iPhone gets released soon, and that it resolves many of the issues we have faced over the past year, such that we won't need to consider any alternatives.

What are your thoughts on the matter?

#1
09/04/2009 (12:41 pm)
As long as you use Torque Script entirely you will never beat unity in terms of performance unless Torque implements script compilation to native ARM assembler which I don't see happening.

If you write in C++ you will always perform 50% faster than unity because their code is using Mono's JIT to generate, dynamic typing, and garbage collection. This only holds true until the cell phone processor speeds become fast enough to handle most game logic and the graphics chip becomes the bottleneck. In this case whoever has the fastest rendering pipeline and graphics optimizations will be the fastest. I have no idea who's go the best rendering pipeline.

My game has dozens of sprites moving around and updating every frame and the performance is perfectly acceptable. The biggest optimizations I had to do was in my game logic because controlling all of those objects in real time because it was bogging down the iphone CPU. I had to add things like:
1. Disable a monster completely if not in view range.
2. Only perform AI updates and other things every 500ms or every 1 second.

The last performance improvement I did moved me from 15 FPS to 20 FPS on iPhone 3g/2G and all I did was change my C++ code to only check a monsters distance from the user every 1 second instead of every onUpdate call.

Personally I think GG's going to be much faster than a comparable Unity game as long as you write in C++ vs Unities scripting language in the forseable future (1-2 years).

However improvements to their engine are rapidly advancing while iTGB's are moving at a crawl. Also if I moved to iTGE the usability of Unity might be a big enough of a deal for me to take the performance hit. I don't want to spend days trying to get models I download off the net converted correctly to DTS format which is the only thing iTGE supports. I'd rather drop in and go with the .max, .3ds or other model.

Anyway I'm strongly biased towards GG because of the source code model. I greatly prefer C++ because of the IDE support for coding, debugging etc.
#2
09/04/2009 (3:29 pm)
You can't do any JIT at all on the iphone, its AOT and compiles to native ARM obj code for the platform, the very same code to what C++ compiles.

Even if you work in C++ only in iTGB, it won't solve the massive CPU bottleneck code thats currently (by 1.2) in iTGB actually. The "1 vertex array per quad" on tile and particle render and similar anti-iphone deoptimizations are totally killing any performance


By today, Unity games run and run fast without you having a master degree and years of experience in mobile development, something iTGB does not offer, you won't get even anywhere comparable speed to Unity 1.5 in iTGB and that although iTGB is 2D only, no 3D at all.


That beeing said, I own both and I think both have their place.
For pure 2D, I wouldn't use Unity actually as you have too much you need to implement, in iTGB you just need to know what you do and likely you will also rewrite parts of the engine to get really good performance in a more intense game, thats the drawback that you need to be willing to accept.
But I believe in GG that they are actually going to rewrite the engine to the degree where is no longer a desktop focused technology thats able to run on an iphone but an iphone focused technology that gives a shit about the pc / mac (because thats wherefor all iTGB licenses had to pay $250 for TGB Pro already, no need to care about it in iTGB!)

But for 3D I wouldn't even consider getting iTGE actually. Occlusion culling, batching, VFP support for skinned animations etc make Unity so much stronger than torque ever will be as torque does not offer any of these features. And by the todays iTGB code quality it will take at least 2 year before iTorque is in the position to compete against todays Unity performance and quality unless you solve that, which at least to me is the reason I payed for an engine, so I don't have to do it ...
#3
09/04/2009 (4:10 pm)
Mark just doing AOT and compiling to native ARM is not as fast as writing it in C++. It still does the "equivalent" of script for dynamic typed values because it looks up in maps for the variable type etc. Also it uses garbage collection and other inefficient memory handling.


Your AI and game logic will be much faster in C++ using iTGG than in Unity's AOT compiled binaries. Your rendering and "Game engine" code is likely to be faster in unity. 3D games naturally have a lot more triangles and quads to render than 2d games so the rendering pipeline is going to be much more important.

In my game the primary bottleneck was not the rendering pipeline but the AI and other game logic.

#4
09/04/2009 (7:45 pm)
Unity can calls C++ code just fine since Unity iPhone Advanced 1.5
But I've yet to see a fair comparision, which implements the same thing on both ends and in a way that makes it designer usable, not just a "programmer hack" which are of really no interest in a comparision of visual usage targeted tools.
If people didn't want the visual tools they would use Cocos2D instead of iTGB and Oolong or the Blender iPhone engine instead of iTGE and Unity.

Also, Garbage Collecting is far from inefficient on an InOrder slow cpu as the iphone ARM cpu.
Its actually what you likely are doing too, just not on the global scale, because not using Pooling is not even an option. Memory allocate and deallocate is one of the most costly, if not the most costly, operation on the iphone at all.
#5
09/04/2009 (8:07 pm)
Stack variables are 1 instruction for the entire functions stack. Garbage collection are 1000's of instructions.

Stack variables are the primary reason c++ is so fast compared to Garbage collection languages that only utilize the heap for most objects.

But yes tools are VERY important in my opinion.
#6
09/05/2009 (12:29 am)
GCs aren't as stupid anymore as they used to be in their first generation.
Todays generation of GCs are 2-4% slower than C++ but 99.5% more stable, readable and maintanable than the common mess so called "C++ pro" hack together.
C++ fits for exactly one thing any longer today and thats low level programming (developing drivers, OS, the core components of game engines) and even that is discussable, as Eiffel is a much cleaner language and produces at very least just as efficient C code for the end compilation but leads to significantly more correct code than C++ ever will due to missing programming by contract etc

Any application level programming does not gain much from them anymore, at least not for the vast majority of all programmers who are not able to optimize their C++ to the degree at which it would be generated by any modern C++ and .NET compiler anyway (which for most programmers is: much higher optimized than the original code).
Knowledge about how the memory etc is handled theoretically helps optimizing code but I would bet that the code you write is significantly worse performance wise than what you get if you invest less time on optimization and leave "better maintainable code" and leave the optimization to -O3 / -Os (the compiler can optimize plain simple code much better than code thats "hack-timized")


But I think we are getting seriously off topic.
What I wanted to say is that nobody ever should base performance assumptions on theory but instead focus on doing the job in the best way for the project and invest time on optimization thinking if it is really required.
Otherwise you risk to lose a lot of time and money on wrong optimizations that you could have saved if you just did the program first and I would recommend to anyone to do just that, recreate the same prototype in your potential techs, see which one performs best and use it.

No theory, no "what do you think"
#7
09/05/2009 (2:41 pm)
Yea your way off there. GC's are WAY slower than properly written C++ code. Even the unity web site http://unity3d.com/support/documentation/ScriptReference/index.Script_compilation_28Advanced29.html

Points this out:

Unity compiles all scripts to .NET dll files. The .dll files will be jit compiled at runtime.

This allows incredibly fast script execution. It is around 20 times faster than traditional javascript and around 50% slower than native C++ code. Unity might take a second to compile all your scripts when you save it. You can see if Unity is still compiling with the small spinning progress icon in the lower right corner of Unity's main window.


I'm sorry but proper use of stack variables are much much faster than any language which uses GC. I've done a enough Java development and optimization in my career to know that one of the biggest optimizations in Java that you can do is manage your own pool of objects to prevent overloading the GC when your creating multiple objects inside a tight loop. A game loop executes every few milliseconds and any object creation in there is going to explode quickly and require significant processor time to garbage collect.


It's important to understand what your getting into and code for performance from the beginning using simple rules. It's much harder to go back and retrofit a program for performance than it is to develop it right the first time.
#8
09/23/2009 (12:52 am)
Well, just a follow up on alternative platforms...

Gendai Games has just released information regarding their pricing for their GameSalad 2D game development kit. For indie users, the cost will be $499 per year. For elite users, it will be $1999 per year. Both will give the developer the ability to publish iPhone games, with the elite level to include additional professional tools, live support, and not requiring a splash screen at startup. Of course, you can download and develop for free to upload your games to the web, playable via Safari plug-in.

Again, I'm not affiliated with the company or its product, but as I sit and watch the progress and development of T2D4iP, I have to look out for my best interest in making profitable games in the App Store with any and all tools accessible to me.

While I think $499-$1999 per year may be steep, the product does look more polished, and the GDK looks to be well-packaged and completely inclusive, not to mention the fact that it was developed from the ground up and solely for the iPhone's performance and experience in mind.

Here's hoping that our wait and investment will soon pay off, and that we'll finally have some light shed on this new T2D4iP beta that pretty much fell on our lap not too long ago.
#9
09/23/2009 (4:55 am)
I have, on a number of occasions, sat down and said, "I'm tired of Torque. What else is there?". So I've tried other engines. While at a previous job, the whole company looked to switch to the Vicious Engine, but we found it to be lacking compared to Torque. While running my previous company, Gaslight Studios, we switched to the Blade3D engine. Hell, we even won first place in a contest with a prototype we did in under a month and got free passes to show the game off on the main showroom floor at GDC earlier this year. I own licenses for the ShiVa engine, and have done some work in that. I was flat out given licenses to a pretty big name engine (that I won't mention the name of since the licenses were given to me in private). I managed a team to produce, polish and release a game in the Gamebryo game engine.

And every single time, I come back to Torque. I've done my sleeping around, and I'm ready to curl up in bed with Torque from here on out. I don't need to try the other engines, test other possibilities or see what else is out there - I've done it already. I come back to Torque because it really is the best IMHO, especially for a small team with a small budget. And even when we had big budgets for games anywhere I've worked, we always came back to Torque because it was just the most practical solution.

Edit: My apologies if that came out sounding like I was trying to troll, lol... I honestly was not. I wrote this in the middle of the night (right now, actually...) in the middle of a project crunch while waiting for a compile to finish, hahaha. Really though, I do recommend people to try other engines. Maybe you'll find they're for you, or maybe you'll find, like me, that Torque is the all-around answer.
#10
10/29/2009 (10:13 pm)
Just an FYI, Unity 3D has gone free to download and use without limitations, and iPhone publishing is $399. GameSalad has dropped from $499/year to $99/year.

I'm going to stick with Torque, I do have faith in the new dev team and hope for good things in the near future. But, I might just pick up GameSalad as an extra engine, since it has gone unbelievably affordable since the Early Access Program started.
#11
10/30/2009 (12:11 am)
interesting development in general thats going on ... :)
#12
10/30/2009 (1:52 am)
For the unity iPhone publishing don't you need unity pro, $1500? They really don't make it clear on their website. I messed a bit with unity, however I paid for this... ; )

#13
10/30/2009 (2:08 am)
No you don't need Pro.

you can get it at $399.

You only need Pro for iPhone Advanced
#14
10/30/2009 (2:09 am)
No, Unity iPhone $399 is all you need to make a basic game. However, the Pro versions (total sum: $3000) allows you to remove unused code and has more graphical features and streaming video. I prefer T2Di for iPhone use.