Worth going through the effort with Xcode 2.5?

Member
Posts: 351
Joined: 2002.04
Post: #1
Hi iDevGames!

Some of you may remember me, I developed Slope Rider years ago and have slowly slipped out of OSX development since then, doing mostly Flash stuff recently.

Anyway, as with most of us I'm excited about the prospect of developing for the iPhone but before I get to that I'm thinking of bringing Slope Rider up-to-date as a Universal Binary. At this stage I'm still using Tiger and was wondering if there is much point downloading Xcode 2.5 and updating Slope Rider to UB in that environment before eventually upgrading to Leopard and moving up to Xcode 3.xxx at that stage?

Or should I hold off on updating it until I upgrade to Leopard?

I should probably point out that Slope Rider is quite an old beast now and actually uses Carbon - this is probably the main thing that needs changing.

Hopefully I won't drop off the side of planet again and this will actually happen, I'm cautiously optimistic at this stage. Wink
Quote this message in a reply
Moderator
Posts: 3,571
Joined: 2003.06
Post: #2
Good to see you again monteboyd! Hope all is going well. Smile

I don't think there is anything wrong with building it for Tiger, being as how Tiger seems to still have a solid number of users, but it seems to me that Slope Rider might be a good candidate for a cool iPhone game. Maybe you should forget about Tiger, upgrade to Leopard immediately and get right to iPhone development instead! It seems to me that there may be a good opportunity waiting for you there, and as more games crowd the iPhone market that opportunity begins to diminish somewhat, so Tiger looks like a distraction in that light.

Plus, as time moves on, obviously Tiger will shrink in marketshare. Although that seems like it's happening a little more slowly than previous versions, according to http://update.omnigroup.com/
Quote this message in a reply
Member
Posts: 351
Joined: 2002.04
Post: #3
Thanks AnotherJake! Smile

Yeah, I was thinking of Slope Rider on the iPhone. I guess I thought it might be a smoother path, maybe less of a learning curve, if I took a more gradual approach. Since this will actually be my first foray into Cocoa. But if you think jumping to iPhone development would be just as appropriate then I might do that. Of course that would mean I won't be able to ask any questions here atm because of the NDA!
Quote this message in a reply
Moderator
Posts: 3,571
Joined: 2003.06
Post: #4
I hadn't thought about it in terms of having to learn Cocoa. Yes, working around the NDA is definitely a *major* problem in that case. So then, yeah, I guess it would indeed make sense to go ahead and build it for Tiger and move up from there when you get a chance.

A few things I can think of off the top of my head right now which you will want to keep in mind, in preparation for porting to iPhone later on, which shouldn't be NDA violations:

- You'll likely want to use OpenAL for your sounds. OpenAL comes standard on Tiger, so that's a plus.
- Any background music you will want to do on Leopard using Audio Queues. Use whatever you want on Tiger because I don't think Audio Queues is available there.
- You'll probably want to keep your game code (drawing and updating) in C/C++, so the only Cocoa you'll need will be for basic system needs like file loading (and OpenGL context creation).
- There is a particularly useful image class for use with OpenGL ES, which you can find in the iPhone SDK code samples. You will more than likely want to try to use that on OS X as well (I don't dare say the name of it, but it should be apparent when you find it in one of the OpenGL ES samples). The problem there is that I don't think it will work on Tiger, but it can be easily ported to Leopard. You can do something similar to it for Tiger if you modify it some. [edit] I take that back. It should work on Tiger too. I was thinking Panther prolly woudn't work.[/edit]
- Speaking of OpenGL ES, convert any of your immediate mode code to be using glDrawArrays or glDrawElements, which means your sprites will be done with four coordinate triangle strips instead of quads.
- Can't use the ol' display list trick for pre-rendered font drawing. It's not hard to do something similar using triangle strips instead of quads though.

That should cover a good percentage of porting concerns for Slope Rider, I would imagine. Performance-wise, I'd wager it'll run great on iPhone if you stay at the same level of geometry detail (as when I played it back in the day that is -- haven't seen it in years).
Quote this message in a reply
Moderator
Posts: 1,560
Joined: 2003.10
Post: #5
I'd strongly advise against Xcode 2.5, as I've run into unresolvable linking issues with it that don't exist in either 2.4 or 3.0 with the same code. Seems to be a broken version, though unfortunately it's hard to find 2.4 anymore, so if you're on Tiger, you're a bit out of luck.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #6
It's not hard at all to find 2.4.1, it's right there on http://connect.apple.com where you'd expect it to be...

First I've heard of 2.5 issues, care to elaborate?
Quote this message in a reply
Member
Posts: 351
Joined: 2002.04
Post: #7
Thanks for all the advice AnotherJake - very helpful!

- Will definitely have to change the audio - I honestly can't even remember how I handled audio before - it's been that long since I've looked at the code - but I don't don't think OpenAL was around at the time and I definitely didn't use it.
- Yeah I was thinking of probably not touching any of the game code I don't have to (just leaving it as C) and just using Cocoa for the things you mention. I assume I'll need to change my events handling as well, since that's still Carbon.
- I think I was using glDrawArrays for most things so that won't be too much of a problem. Although I was using display lists occasionally and they're not available in OpenGL ES as I understand it. But then that's for later down the track since I'm now thinking I will convert to a UB app before getting onto the iPhone.

I was thinking the same thing in terms of performance - it's dated enough now that it should be about iPhone level! Very handy. Smile

ThemsAllTook and OneSadCookie - it doesn't really bother me if I develop on 2.4.1 or 2.5 as long as they're both readily available. But I'll be interested to hear if those issues are common.
Quote this message in a reply
Member
Posts: 204
Joined: 2002.09
Post: #8
Don't be put off by moving from Carbon straight to iPhone.

I got Pirate Isle running on the iPhone in about a week (which was old OS 9/X Carbon code which was last compiling with CodeWarrior). Very little obj-c code is needed if you are already living in an OpenGL world.
Quote this message in a reply
Moderator
Posts: 3,571
Joined: 2003.06
Post: #9
KittyMac Wrote:Very little obj-c code is needed if you are already living in an OpenGL world.

So true on iPhone... and also especially with things like event handling and context setup on iPhone being dramatically easier, from what I've encountered (*really* fun to program on). Still, there are so many things to learn about basic Cocoa/Obj-C which can't be discussed publicly when learning them on iPhone, though I definitely agree not to shy away from iPhone right off the bat just because of that. Feet wet with it ASAP is a great direction to take.
Quote this message in a reply
Member
Posts: 351
Joined: 2002.04
Post: #10
Hmmm... interesting KittyMac. Well the thing is I'd obviously like to learn Cocoa as well, since it would be where I would go in the future for Mac (not iPhone) games, but the thought of diving more quickly into iPhone dev is obviously appealing. I could always see how I go getting Slope Rider up and running on the iPhone as quikcly as I can manage and then going back and giving myself some time to learn Cocoa.

Of course I'll have to buy Leopard first as I mentioned.

I'm off to Sardinia for a week on Sunday so I'll give it some thought while on the beach!
Quote this message in a reply
Member
Posts: 351
Joined: 2002.04
Post: #11
Okay, hope you guys are still reading this. Smile

I've decided to try to get Slope Rider converted to UB in Xcode 2.5 for the moment. I'm starting with a simple OpenGL view in Cocoa and then building it back up from there. Now I already have a question: if I have a bunch of utility functions sitting in a C file and header (e.g. util.c, util.h) can I include the header file in a Cocoa class and then call those functions from it?

I tried searching this forum for answers to this but have been stumped so far.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #12
Yes, Objective C is a strict superset of C (unlike C++, though even for C++, it's usually close enough).
Quote this message in a reply
Member
Posts: 351
Joined: 2002.04
Post: #13
Yeah, that's what I thought. But when I tried to #include "util.h" in my ObjC class and then tried to use a function I got an undefined symbol error. I don't have the code at hand at the moment, is there anything else I should be aware of to achieve this?

Sorry for the vagueness of this, I've been developing Actionscript for so long I'm a little rusty on C.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #14
make sure util.c is in the project
Quote this message in a reply
Member
Posts: 351
Joined: 2002.04
Post: #15
I added it to the project, but it was late last night, I'll give it a try again tonight. At least I know I wasn't trying to do something impossible now, thanks Keith.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Worth the trouble? NelsonMandella 7 3,967 Feb 7, 2010 05:48 PM
Last Post: cmiller