Game Development Community

Wierd Problems

by Damir Slogar · in iTorque 2D · 03/04/2009 (9:08 am) · 2 replies

Hi. I'm new to torque and iTGB and am developing a game for the iphone. I've run into a few issues and was wondering if anybody had an idea of why these were happening. I'm using an ipod touch (2.2.1) to test my app.

1) moveTo not working? I spawn a bunch of animated sprites that use moveTo, but they won't move at all.

2) autorotate not working sometimes?
I have a bunch 4 big static images in the background that I want to auto rotate; works fine in PC and Mac builds, but only one rotates on the device.

3) pvr's not working? I tried changing the big static images to smaller static images using pvr compressed textures (I used the PVRTextTool in windows with OpenGL ES 1.x PVRTC 4bpp). From what I've read in the forums, iTGB should get pvr's first, but it looked like it grabbed the png files ingame? when i tried erasing the pngs and keeping the pvr's, no objects showed up at all.

4) ogg vorbis not working? I can't get ogg's to work at all in PC,Mac, or iPhone builds; the oggs are 16 bit mono 22050Hz; same with mp3's
I tried a large wav instead which worked on PC and Mac but not iphone.

5) in debug mode i get a crash in t2dSceneContainer.cc in getBinRange();
like its finding bad world limits, but nothing in my scene uses world limits


My first assumption is that I am running out of heap and thats causing weird things to happen; I would be really grateful for any ideas.
Thanks



#1
03/04/2009 (11:02 am)
First thing to do is check the Cheat Sheet, it addresses a a lot of the problems your having (most people have had similar issues getting started, look for PUAP_OPTIMIZE especially).

Second, the iPhone doesn't support ogg, you'll have to stick with WAVs/Mp3s. As for playing WAVs, that's totally works, but you might be having trouble because
a) UsesAudio is set to 0 (check your commonConfig.xml)
or
b) your initializeOpenAL() is checking for a certain audio driver, if it is, just skip the check and call OpenALInitDriver() (check the BehaviorShooter example to see what I mean)

As for PVRs, it may be the settings you specified, trying playing with different parameters and see if things start to work (not really a fix, but it should identify what's going wrong).
#2
03/04/2009 (12:33 pm)
Thanks for your quick reply Mat.

Using setUsesPhysics(true) on the objects in the scene that used moveTo and autoRotation fixed problems 1 and 2

the PVRs were not working because I needed to change the filenames for objects that used PVRs in game/managed/datablocks.cs so that they didn't have the .png extension (I added image resources in the editor). PVRs are working fine now

For sound I followed the advice inthis thread and converted my music to a wav @16 bit 11025Hz and now it works