Game Development Community

TGB to iTGB

by Tom Cassiotis · in iTorque 2D · 08/18/2009 (12:12 pm) · 4 replies

I am working on a simple game to understand the engine and get something out. I'm currently using TGB but I would like to port it over to iTGB for iPhone/iPod Touch (it would actually be a nice distraction game on those devices, not sure on a pc :) ). The game is entirely written in TorqueScript and there is very minimal art etc.

How much of that work will I be able to bring it to iTGB?

I do not think script performance will be an issue so lets assume I don't have to move anything to Components.

I tend to work on the project in spurts and if I do not complete the game in this spurt it may be months before I get back to it, so I want to delay the purchase of iTGB until the game nearing completion.

Any info would be appreciated.

#1
08/18/2009 (12:24 pm)
If the script performance is no issue, its very little work.
But I fear its pretty unrealistic that the scripting will be no issue unless your game consists of about nothing but a simple "move puzzle pieces" or alike.
#2
08/18/2009 (3:42 pm)
It is indeed a 'simple "move puzzle pieces" or alike'.

I'm trying to work through a simple game to the end before I move on to something more ambitious. I may convert a part of the TorqueScript to C++ just for the experience.

Thanks for the info.
#3
08/18/2009 (3:51 pm)
I shouldn't talk as we've not finished with our game yet but we're building a missile command like game and I haven't needed to convert any elements to components yet. The game is not that graphically complex but there are typically around 5-6 animated sprites on the screen and 10-12 static sprites moving around with simple physics. The FPS is acceptable with 100% torque script and I've had another tasks that took priority over creating components. This is simply to say that your game will probably not be changed when you port to iphone. It took me a while to get iTBG working and deploying to iphone correctly but that has nothing to do with the actual game.
#4
08/19/2009 (2:09 am)
Porting games from TGB to iTGB is incredibly easy, once you understand a few very important things...

1.) You cannot load everything at the start of the game. The iPhone has a timer that it runs whenever you boot an app. If the app takes too long to complete its initial load, the timer causes a fault in the app that force-crashes it. So sequence out the loading of your objects to either load only what you need, and load everything AFTER the game has finished loading. You'll probably need to add in a loading screen somewhere.

2.) As long as none of your script code is called more than once per second, you should be fine keeping everything in script. It's only the 'constant-called' schedules that really need to be in engine, or as components. Also, if you're using a lot of physics, you'll probably need to move those to components with a custom physics solution (IE: no actual physics, but fake it by moving objects based on position).

3.) If you have any art files bigger than 1024x1024, those will need to be shrunken down or cut up, as the iPhone won't load anything bigger than 1024x1024.

4.) Your music should probably be an MP3, with all sound effects as .WAV files. You can only play one MP3 at a time.

Realize those, work with them, and you'll be fine. It's easy and fun! :)