Game Development Community

Couple Questions

by Remorseless · in iTorque 2D · 06/17/2010 (2:42 pm) · 25 replies

Hey guys,

I finally purchased the 2d-TGB engine for the iphone and have some questions. I had prototyped my game on the pc version, and after some time, decided that the time to port it over is probably not worth it, so i have just started over, but am having some weird problems.

1) i get no player movement. In my player.cs file, i have the player set to have a constant velocity (works great on pc, great when playing from the editor), and when i load up the game on the iphone, it is totally static. any ideas?

2) i have objects that are set to rotate, once again, they all work fine when playing from the editor, but do nothing (totally static) when played on the iphone?!

3) i hear people saying that a good tutorial to follow is the shooter tutorial, but i see no such tutorial/example game under my iphone build.

I have looked as good as i can on the forums to try to find any posts related to these problems but came up empty. any help is much appreciated.


thanks
Page «Previous 1 2
#1
06/17/2010 (4:21 pm)
Generally I would recommend that you read the docs of iTGB (3 pdfs)
TGB projects will not just work, you have to port them and the docs are of fundamental importance

1/2) you forgot to enable physics on the objects. as such they will not react to any physical input like moveto and rotate in the player at all.

3) does no longer exist. was an 1.1 / 1.2 thing. The current examples are in the example project folder (and the shooter example project never was a good thing to show how to do stuff right as it was very suboptimized actually)
#2
06/17/2010 (9:43 pm)
thanks for the quick reply.

1) i did read the docs but i will go over again tomorrow to make sure i am not missing something.

2) i do have the "enable physics" box checked for the objects that are not correctly working on the iphone.

3) what i don't understand, is why there is such a huge difference in what does and does not work between the "play from editor" and on the iphone? that seems very counter intuitive to me just to check something very quickly. i understand that you need to test the game on the iphone, but like i said, i just cant understand the huge difference in what works from editor (quick test) and what happens on the iphone.

4) when i build the project in xcode, i get a lot of warnings (i have done nothing in terms of anything core related to the engine), is this normal? (once again, i will double check the docs again tomorrow.)

thanks again
#3
06/18/2010 (1:00 am)
I understand your frustration, and I also do not like the standard reply of "read the docs", those comments are old and getting very irritating. Like you, I started with the regular TGB, and had major problems initially with iTGB. Unfortunately, iTGB is not the same as TGB, despite the BS marketing from GG that leads everyone to believe that porting between platforms is trivial. Trust me, it is not. The TGB and iTGB code are written by completely different people (different companies even), and from my experience they do not talk to each other (bugs that were reported on one platform are still present 5 yrs later on the other platform, for example). So, you need to filter responses on here, and take some of them with a grain of salt. Some (probably most) of the ppl on here are are paid consultants, so beware of BS answers.

Those PDFs that Marc is talking about are worthless for the beginner.

Also, beware that the Windows and Mac versions of the editor behave differently, and do not correlate well with what happens on the device (or the simulator).

Welcome to world of iTorque (it is a mess). I would recommend the trial and error approach. Work as much as you can on the actual device, just try stuff and see what happens. If you post a question and get the "read the docs" answer, I would just blow it off and go back to trial and error. There are no docs, so "read the docs" is a fake response in my opinion.

#4
06/18/2010 (6:19 am)
maybe you need to re-run the game on the mac, it is necessary EVERYTIME after the last xcode compilation in order to re-generate al the .dso again, but with the iTGB after the xcode. sometimes you need to delete all your .dso after that re-run
#5
06/18/2010 (12:30 pm)
thanks for the replies guys.

"maybe you need to re-run the game on the mac, it is necessary EVERYTIME after the last xcode compilation in order to re-generate al the .dso again, but with the iTGB after the xcode. sometimes you need to delete all your .dso after that re-run"

i think that was what i was missing. which once again...seems very counter intuitive. but anyways, i now atleast have my player moving and my objects working correctly. still 3 questions.


1) how often do i need to delete my common and game folders, and the main.cs in xcode before doing a build? do i have to redo that everytime i change a level for example? delete the references from xcode then re-establish them?

2) my behaviors still dont seem to be working. once again, they work from play from editor, just not on the iphone. i am using the "attach camera to object" and "paralaxing object" behaviors. and once again, they work fine from the play from editor, just not on the iphone.

3) music. for the pc game you called music by setting up the audio datablocks, then calling something like "$levelmusic = alxPlay(levelmusic1);" . i have not been able to get sound to work. i am assuming that the function to call them has changed, and/or, that they arent ogg files anymore (ive also tried them as mp3 files, still didnt work). is there any info on getting music/sounds up and running on the iphone?

and yes, Mark, i agree with you. the 3 documents that shipped with the game are almost laughable. they are basically 80% rehashed from the apple dev site, while important things like how to get the game actually running (music, scripts, behaviors etc.) seem to be nowhere to be found. beyond frustrating.

as said before i have given up trying to port what i did on the pc, and just started over. but i am having 10x harder of a time getting things running on the iphone version of the engine than i ever did when i first started on the pc version of the engine. actually frustrating isnt even the right word for how i feel.


thanks again in advance

#6
06/18/2010 (12:59 pm)
1) never, just do clean then build again for example (for me touch on the common folder helped too)

2) compressed sound is played through the iphone sound playback commands. You can play 1 of them at the time (hardware decompressed).
audioblocks work for uncompressed sounds though.
#7
06/18/2010 (1:28 pm)
Couple of things to be aware of when it comes to audio. Most important is that OGG format is not supported on the iPhone, so you'll have to convert those files to WAV or MP3 (I used Audacity to convert all of my OGGs to WAVs). Another thing to be aware of is that sound does not play back correctly on the desktop Mac version (sound plays back as loud static); at least this is case with version 1.3, and this problem may have been fixed in version 1.4. Audio plays ok on the device and on the simulator though.
#8
06/18/2010 (1:44 pm)
thanks for replies,

so is there a forum post/tutorial on getting sound working in itgb or do i have to get that info from the apple sdk docs?
#9
06/18/2010 (2:50 pm)
no need for apple sdk docs.

just check the board / iTGB docs for the iphone sound functions
#10
06/18/2010 (4:31 pm)
Remorseless,

I have an example game that is available for d/l, which might help. It's very similar to the original TGB breakout tutorial, ported to the iPhone, so it contains almost everything that a complete game would have (sound, multiple levels etc). Check it out here:

http://www.torquepowered.com/community/forums/viewthread/115043

It's not optimised, it's just a straight port, but it should be helpful in terms of getting a simple app up and running. I've only changed a couple of things compared to the original, so you should be able to follow the origin tutorial to see how the codes fits together. Here is a link to the original tutorial: (it's a very good tutorial I think)

http://www.torquepowered.com/community/forums/viewthread/73649

Mark
#11
06/18/2010 (9:06 pm)
Just a thought though. My example game is written using the previous version of iTGB (1.3.1), so I'm not sure if it will work with the latest version. I just checked the d/l section and it appears as though they now only have 1.4 beta available for download? Is that correct? Seems a bit rediculous if a new paying customer only gets a beta version of the software, lol. I've only tried 1.4 once, and my current project crashed, so I guess backwards compatibility is not one of their main priorities. I'm only going to use 1.4 when I have no other choice. In my case, official support for 1.3 was zero, and I've only ever had any help from the general community, so I don't see why I should beta test their new version for them.

In any case, even if it doesn't work, I'm hoping that my code examples will be helpful. The main purpose for making this available is for people who are new to iTGB. So don't expect stellar coding, it's just an example to help.
#12
06/23/2010 (10:37 am)
hey guys,

was AFC for a couple days. i REALLY appreciate you guys help. though it doesnt make sense to me that the engine has to go through all those hoops and whatnot to run on the iphone, atleast now i know.

Marc--thanks for the suggestions on what to look up on the forums, helped alot

Mark--huge help linking me that stuff. i am a level designer and i have always found i learn best when i can pick apart examples on how things are done, then learn to do that myself. so thank you much on that.


now hopefully i can make some steady progress and get it back to the point that i had it on the PC

thanks again
#13
06/23/2010 (11:18 am)
so another post.

So i am back on the computer and trying to get things running and still stay sane, but it just isnt working. I dont want this post to turn into a wine and cheese event, but omg, this is beyond frustrating.

1) my behaviors still do not work on the iphone. Even weirder, in editor i add the behavior to my player (mount camera), and it works from play from editor. the weird part is...when i close the editor (after saving), reload the level in the editor, and click on my player...no behaviors are shown being attached to it....but it still "works" from the play from editor...wtf..

2) i now am getting an error when trying to upload the build to the iphone...once the app starts and shows the GG logo, it just craps out and says "could not find main.cs" "make sure your resources are in the correct place.


i am at wits end. i have been in the gaming industry for 10 years now. worked with many many different engines and never ever ever had anything like this happen. i truly feel that i am out a couple grand (mac + GG engine) for nothing. i truly hope GG can get things in order and actually make things how they say they are, cause in reality, they arent even close to how they say it is. i feel like it was all used car salesmen tactics to buy a car they say is in great condition, only to drive it off the lot and it breakdown 1 mile down the road...sigh

#14
06/23/2010 (11:52 am)
hey Mark.

i installed your breakout app on my iphone. it may be a bug in 1.4 or what, but i cant get the paddle to move. this sound like a bug or am i doing something wonky?

thanks
#15
06/23/2010 (12:19 pm)
Remorseless, your missing main.cs from the xCode Resources folder.

Under Resources you typically have:

game (folder)
common (folder)
main.cs
Default.png
and the icon

Are you behaviors in the game/behaviors directory?

Also, before uploading to the iPhone delete all your .dso files.
#16
06/23/2010 (2:57 pm)
Remorseless, I created that game using version 1.3.1, and I haven't tried 1.4, so I'm not really sure what the problem is. It might be an incompatibility between the different versions.
#17
06/23/2010 (3:04 pm)
I was a bit concerned that it wouldn't run properly in 1.4. I'm in the middle of developing my own game, so I decided to stick with 1.3.1 for now. I tried 1.4 once and my game crashed, so I decided to go back to 1.4. I plan to switch to 1.4 when I closer to releasing my game, and at that point I'll take another look at the breakout tutorial stuff to see what the problem is.

I agree about having an example to look at. I find that I can learn a lot more easily when I have some code to look at, as apposed to just reading documents.
#18
06/23/2010 (3:31 pm)
I would recommend against switching for the release.
I would recommend to consider it for 1.1 of your app of a successor, but switching midway through makes all prior testing useless
#19
06/23/2010 (3:47 pm)
Hmm, you think it might be too risky to change to 1.4 at this time? That was my main reason for sticking with 1.3.1 till now, but I was wondering if I would need to switch to 1.4 for the latest iPhone OS4?
#20
06/23/2010 (4:03 pm)
Mark, I agree with Marc, I've resisted 1.4 as well as I have too much development in progress and can't afford to take the hit. Also, I don't see any benefit at the moment?

WRT iOS4, well, unless you need to use some of the new APIs then I would continue to build against 3.1.2 or similar.
Page «Previous 1 2