Game Development Community

iPod Touch x iPhone 3G performance

by Techfront · in iTorque 2D · 11/04/2009 (9:39 pm) · 11 replies

Hi All.

I'm running my game at 25 FPS on iPod Touch, bug on my iPhone 3G the performance goes down, the game is running about 5 FPS.

The Firmware to iPod is 3.0 and to iPhone is 3.1.2, can the problem to be the firmware?
Do you had the same problem in another application?

I'm porting several scripts to c++, because my game is basically torque script, but I'm afraid to have several FPS differences between different devices.

Thanks in Advance

Eros

#1
11/04/2009 (10:27 pm)
The 3G is actually just a surprisingly slow device. I don't know about 3.1.2's impact, but you should expect the touch to run faster.

BTW, which Touch? 2G? 3G?
#2
11/04/2009 (10:45 pm)
The 2nd generation iPod touch is quite a bit faster than the 3G iPhone, but if anything, the latest OS should be more efficient. Each new iDevice always improves at least a bit over the previous one, so they never match exactly :)
#3
11/05/2009 (10:02 am)
Hi.

My iPod is 2G model MB528LL.

I think the problem is because my game is 100% script, so I'm porting several routines to C++, do you think this can resolve the performance problem?

Or torque has problem running on iPhone 3G?

Thanks
Eros
#4
11/05/2009 (11:49 am)
Yes, C++ will make it faster. There are also minor things you can do to speed it up. There is one problem in a sleep function, for example. Check the source file iPhoneTime.mm, line 91+. Uncomment the commented usleep() call there. More little tweaks exist - we could use a collective thread of fixes if we don't get a new release soon :)

EDIT: iPhoneTime, not Memory. Bah.
#5
11/05/2009 (12:59 pm)
:) Thanks

If you have more tips please let me know :)

Thanks
Eros
#6
11/05/2009 (1:04 pm)
Hi Man, My iPhoneMemory doesn't have "usleep" the unique file with this function is iPhoneTime and iPhoneMain.


Thanks
Eros
#7
11/05/2009 (1:42 pm)
Hi all.

I´m printing the time to execute some process on engine, and the problem is in

void DemoGame::mainLoop()
{	
 ...
  Game->processEvents();
 ...
}

The game is spending 200 Ms to execute this command. On iPod Touch the game execute it on 40 Ms

How to I can evaluate my script source to check where is the problem
I´m trying to use getRealTime before and after some functions but it doesn't work, on call after the function the getRealTime is returning "".
I need to know how to get the time (ms) to execute some functions. Do you have idea how i can do it?

Thanks
Eros

#8
11/05/2009 (5:58 pm)
You'll probably have to port whatever bottlenecks are in script to C++. Script is much, much slower than C++. So port the sections of code that get called often.
#9
11/11/2009 (7:31 pm)
OK I see this everywhere, write that part in C++, ok how? Is there some explanation of how this is done? I don't just replace my script with C++ do I?

#10
11/11/2009 (7:43 pm)
Pretty much, yes :)

You can do a 1:1 translation of any loops/number crunching to ConsoleMethods, then call that from script. For a decent example of using the ConsoleMethod macro to create a C++ function exported as a script function, see the movie playback example posted in this subforum.