Game Development Community

Another "is (i)Torque 2D for me?" thread

by Daniel · in General Discussion · 05/24/2011 (4:44 am) · 8 replies

Hi all,

first off,thank you in advance for reading!

I am currently developing a game in VB.NET using a royalte-free engine. The game is playable and I'm doing comparatively low-level coding. I am proficient with OO programming in VB.NET, but have no knowledge of C++ or C#.

The "engine" pretty much consists of a few mouse polling and texture blitting functions, the directx rendering functions and things like that. Nothing remotely WYSIWYG.

I am considering switching to Torque for the following reasons:
- There is a documentation!
- I want to release my game for Mac, Windows and potentially the iPad.

So here's my questions:

1) There is a lot of converters between VB.NET and C#. Can I program Torque games in C#? That would save me lots of man-weeks of re-writing my classes from scratch and trying to figure out C++.

2) The game will be controlled mostly via MIDI. I am currently doing this with a MIDI handler class I wrote which calls functions in winmm.dll. Can I still deploy to Mac if I manage to write a MIDI handler class that handles MIDI on the Mac? There's no C# or .NET on the Mac is there? So can I only deploy to Mac if I stick to the TorqueScript? Is there a good TorqueScript implementation of cross-platform MIDI?

3) How easy is it to port games from Torque 2D to iTorque 2D?

4) How well do Torque 2D games run on a single-core Atom netbook, as long as they're not graphically intensive (let's assume a fairly simple Jump'n'Run)?

5) Based on the information above, what would be my best course of action to program a cross-platform MIDI game? Is Torque still the way to go?

Thanks and best regards!

About the author

Recent Threads


#1
05/24/2011 (6:37 am)
1. Sadly no. You will need to learn TorqueScript at a minimum, which is a C-like syntax. It's easier to pick up than C++ or C#, but there is still a learning curve. If you want to write in native code, you will need to learn C++ and Objective C

2. You will need to find a port that works on iOS. It should refer to libraries that can at least run on OS X, but that does not guarantee support on iOS

3. This depends on how much work you have put into Torque 2D. Most of the scripts and art will transfer, but you will want to optimize the code and reduce the size of the art. If you make a lot of engine changes to T2D, you will need to manually merge those into iT2D. Two of our tutorials and demos are ports from T2D and took very little time to actually code out.

4. This I can't answer, as I do not have that hardware. The editor and runtimes are used for other casual games with low spec machines, so the chances are good that it will run well. More importantly, you will have to have a dedicated Mac with an Intel processor if you want to deploy to iOS devices and Simulator.

5. Can you describe this a little further? I'm not sure what you mean by a MIDI game.
#2
05/24/2011 (7:08 am)
1) Torque2D and iTorque are both C++ engines, and C# is not very portable anyway.

2) Whatever you wrote in C#/.NET will have to be re-written in C++ and recompiled for each platform you want to use (Windows,OSX,IOS...).

3) Torque2D and iTorque are basically the same engine. The main difference is that the platform layer is for IOS.

4) Torque2D performs well on netbooks as long as you optimize your code and assets. The thing to remember while developing for netbooks is that the Atom processor does double duty. It acts as the CPU and the GPU and is optimised for low energy consumption. This means that a 1.6ghz netbook runs more like a 800mhz laptop.

5) I like Torque2D/iTorque for cross platform projects especially if you intend to add custom functionality for you game. (i.e. add MIDI support), but you will have to become proficient in C++ and spend quite a bit of time learning the inner workings of the engine.

Good Luck

EDIT:
Mich types faster then I do!
#3
05/24/2011 (7:48 am)
hi guys,

thank you very much for your quick and detailed replies. My focus on C# was because I mixed up the different Torque versions out there. It's a bit clearer now, especially due to your replies.

At the moment it seems to me that porting would be a considerable amount of work since i would need to know
- TorqueScript (obviously)
- C++ and a MIDI library like Qt for the Windows and Mac MIDI code
- Objective C for the MIDI implementation on the iPad. (I could postpone this step at least)

On the other hand, I think that the Mac or iPad users are actually the majority of my target group. And this would make an iPad tax-deductible ;) Tricky decision!

Allow me to add 2 more small questions:
- Do you guys have any idea how hard it would be to learn C++ from scratch, coming from VB.NET? I am pretty confident in intermediate to advanced topics such as interfaces, classes, constructors, namespaces, threading etc. I hear that C++ is a unreliable mess if you're used to "hand-holding" languages like C# or VB.NET.

- Is coding in Torsion even for the C++ parts pretty much a given or is Visual Studio 2010 integration with a Torque project a typical way of working? I *love* Visual Studio with it's gorgeous debugging possibilities, help structure and intelligent editor...

Thank you!
#4
05/24/2011 (7:48 am)
@Alain - I had only been awake for 10 minutes too =)

@Daniel - To elaborate more on #3, there are a few extra porting steps. For example, iTorque 2D uses a level datablocks setup. This ensure that only the images and animations that get used for a level are loaded and not everything your project can use.

Torque 2D does not have this feature. If you brought a Torque 2D project over to iT2D, you would need to set up level datablocks for each of your game's levels. This is a short process, but something you must do.

Another important example is that iT2D does not support the onMouseDragged function, so if your T2D game uses that you will need to replace it with iOS specific commands for dragging (we have demos that show how to do this).
#5
05/24/2011 (7:54 am)
Quote:- Do you guys have any idea how hard it would be to learn C++ from scratch, coming from VB.NET?
This is kind of a loaded question. There are two aspects to learning C++:

1. Learning the syntax, paradigms, best practices, etc
2. Learning how to program

You are already ahead of newcomers by knowing another language and shared concepts. C++ is not the most forgiving languages, but it is not impossible to jump in if you already know how to code. There are a lot of good books that start with that base knowledge and grow you to be a competent C++ developer.

Quote:I hear that C++ is a unreliable mess if you're used to "hand-holding" languages like C# or VB.NET.
This is my opinion, but I believe the exact opposite. C++ is extremely clean and organized. However, you have a lot more room to write bad code and shoot yourself in the foot than you would have with something like C#. I don't think any language holds your hand, but C# and Objective-C do offer a lot of concepts that make rapid prototyping a lot easier than C++.

Quote:- Is coding in Torsion even for the C++ parts pretty much a given or is Visual Studio 2010 integration with a Torque project a typical way of working? I *love* Visual Studio with it's gorgeous debugging possibilities, help structure and intelligent editor...
You will not be able to write or debug C++ in Torsion. You still need to use Visual Studio on Windows and Xcode on OS X to write C++ code. If you have never used Xcode, you will probably get frustrated early on. It may be a visual IDE for compiling projects, but it is a world of difference from Visual Studio.

#6
05/24/2011 (8:09 am)
1) I am not the best person to answer this. My first programming language was QBasic then Asembly language (8086/8088) then C then C++. I have also dabbled in VBasic, Java and Ada. I imagine if you start with a managed language like C# or Java then stepping back to C++ would be more challenging.

2) Torque has 2 parts: the script interface and the underlying engine code (C++). High level game mechanics are generally written in script and math intensive routines (or hardware dependent features) are written in C++.

On the PC, Torsion is usually used for script programming and Visual studio is used for C++ programming.

On the Mac or iPad, a text editor is used for scripting and XCode is used for C++/objective-C.
#7
05/24/2011 (8:10 am)
Michael, once again thank you.

It's good to hear that you hold C++ in such high esteem. I do value precision over hand-holding (for example, VB always tries to evaluate all statements in an "if (A and B) then .." construction, and Java doesn't, and that irritates me in VB on an almost daily basis ;) )

I think what I'll do is to play around with the Torque and Torsion demos and start to familiarize myself with the C++ syntax while continuing work on non-code parts of my project, until I have a firm idea about the workload ahead of me if I switch to Torque.

If I do end up using Torque, which I really want to, then you can expect to a hear a lot more from me! ;)

I forgot to answer your earlier question about what I mean by MIDI game. Basically, imagine Guitar Hero and replace the guitar peripheral with a real digital piano connected over MIDI. That's more or less the idea.

Best Regards
Daniel
#8
05/24/2011 (8:15 am)
Quote:I think what I'll do is to play around with the Torque and Torsion demos and start to familiarize myself with the C++ syntax while continuing work on non-code parts of my project, until I have a firm idea about the workload ahead of me if I switch to Torque.
That is a very smart approach, one I encourage anyone to try if they are uncertain.

Quote:I forgot to answer your earlier question about what I mean by MIDI game. Basically, imagine Guitar Hero and replace the guitar peripheral with a real digital piano connected over MIDI. That's more or less the idea.
Ah, ok. That's what I thought. I was consulting on a project using iTorque 2D to create a Guitar Hero clone, but they were using note charts and not something as complex as what you are attempting. In some ways, your approach might be easier since you are supplying the music.

Anyway, good luck and let us know if you have any other questions.