Porting Dirk Dashing to Mac - build issue

Member
Posts: 104
Joined: 2007.01
Post: #1
Hi everyone,

I'm an indie game developer (My Game Company), working on porting our latest game, Dirk Dashing: Secret Agent, to Mac OS X. While I am a fairly expert programmer, having worked on Windows, Linux, Solaris, and SGI for many many years, this is my first experience with Mac. So I hope you'll forgive me if my questions seem rather dumb.

Here's the status of the port, and the problems I'm encountering.

Dirk Dashing uses SDL, OpenAL, OpenGL, and Ogg/Vorbis libraries. I obtained the SDL framework directly from the official site, and it seems to be ok. I also obtained Ogg/Vorbis directly from the official site, and I built the Ogg and Vorbis frameworks using the XCode projects in their macosx directories. I put all three frameworks in /Library/Frameworks.

In my XCode project, I loaded the frameworks and put them under the Frameworks/Linked Frameworks folder. Of course, I've got all my code in here too. I'm using XCode 2.4, running on a MacBook Pro with Mac OS X 10.4.

Dirk Dashing builds as a universal binary (I think - set the architectures to ppc and i386, per XCode documentation), and everything builds and runs fine on my Intel-based MacBook Pro. I've packaged the game up for distribution, but it doesn't run on anyone else's machine. Some folks have tried running it from the console, and they see this error:

dyld: Library not loaded: /Library/Frameworks/Ogg.framework/Versions/A/Ogg

Looking at my application bundle, I can see that XCode included the frameworks in Contents/Frameworks. So I'm not sure why the game is looking in /Library/Frameworks, rather than in my application bundle.

If anyone wants to download the broken binary and take a closer look, you can get it from here:
http://www.mygamecompany.com/mac/dirkdas..._0.app.zip.
To install, download the zip file, double-click it to extract it, then run the .app installer.

I know this isn't the standard method of distribution, but I will save this topic for my next thread. For now, I just want to get the game running on other machines. Can anyone tell me what's wrong and how to fix it? Thanks!
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #2
The Ogg and Vorbis frameworks are not meant to be bundled with the default build settings. I think you just need to set the "Installation Directory" to "@executable_path/../Frameworks" under the build settings for it to work. I'll have to check that though, don't really remember off the top of my head.

edit: That should work, but I should clarify that I was talking about editing the build settings of the Ogg and Vorbis frameworks, not your executable.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #3
You can also build your application with -headerpad_max_install_names (or something like that; check man ld) and then use install_name_tool to change the paths that your application looks for the framework to @executable_path/../Frameworks/............
Quote this message in a reply
Member
Posts: 104
Joined: 2007.01
Post: #4
Thanks, Skorche! I think that did the trick! And now I can use these same frameworks in future games...

I uploaded a new version, and I fixed my earlier link. Try it now. Same install instructions, for now. Let me know if it works, especially on PowerPC hardware.
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #5
Has problems on my G5 running 10.4. It opens, but all the textures are blank. Crashes shortly after.

Also, unless you have a really really good reason for using an installer, don't do it. You'll scare away a lot of Mac users. We're spoiled and are used to bundled apps that you can just drag and drop where you want them to go.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Member
Posts: 715
Joined: 2003.04
Post: #6
Crashed in the main menu on MacMini G4.

After some Hot Cocoa my daughter will run through it on my IMacIntel
where it runs perfectly and is pretty damn fun to play.

Needs Ninja
Quote this message in a reply
Member
Posts: 104
Joined: 2007.01
Post: #7
Thanks for the feedback. I'll start looking for endian issues in the code.

As for the installer, here's the deal. Dirk Dashing is over 30MB, so it delivered in two parts. The first part is the trial version. The second part contains the remaining levels and game assets, which customers download after purchasing the game.

If I bundle the trial version with the game assets inside the application bundle, so that it is as easy to install as other Mac apps, then I'm not sure how I can deliver the second part of the game - how can I get the remaining game assets into the application bundle from the trial version, in such a way that it is just as easy to install as the trial version?
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #8
An app bundle is really just a directory. Find an application in the Finder, right click, and select "Show Package Contents". From the file system, bundles are just ordinary directories, only the Finder treats them differently. You could distribute the demo as a normal bundle, and then use your installer to patch/add the files for the full version. Or you could simply have a separate full version.

Honestly though, I don't think distributing a demo in an installer will make it very popular. I know a lot of people (myself included) who would normally just delete a demo installer, especially when it doesn't use the Apple installer.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Moderator
Posts: 3,579
Joined: 2003.06
Post: #9
GolfHacker Wrote:... As for the installer, here's the deal. Dirk Dashing is over 30MB, so it delivered in two parts. The first part is the trial version. The second part contains the remaining levels and game assets, which customers download after purchasing the game.

If I bundle the trial version with the game assets inside the application bundle, so that it is as easy to install as other Mac apps, then I'm not sure how I can deliver the second part of the game - how can I get the remaining game assets into the application bundle from the trial version, in such a way that it is just as easy to install as the trial version?

Two versions: demo, and full -- simple as that. They pay money for the real deal so there's no financial problem in paying for the bandwidth to let them download the same stuff over again. Seriously, it may seem like a logical mix-up doing the same downloaded content over again, but it's worth it to keep things simple for you and the user. Installers suck balls. Do not use an installer on a Mac unless it is the absolute last resort, which should not ever happen with a game.

[adding] Seriously, a friend of mine who just spent his first nine months with a Mac, coming from Windows, took the liberty to tell me that the number one thing he can say about the Mac is that when he wants to get rid of something he just drags it to the trash with no installers/uninstallers involved. It's my opinion that letting go of the installer idea is the number one problem that developers new to the Mac have. Installers don't make programs look more pro on the Mac, they make them look like junk. For games, I will be 95% inclined to delete it on sight when an install dialog pops up. You can count on other Mac users reacting the same way in your financial model if you're worried about the price of bandwidth.[/adding]
Quote this message in a reply
Member
Posts: 104
Joined: 2007.01
Post: #10
I'm not worried about bandwidth. I'm worried about customers with a dialup connection. Asking a paid customer to download a 30MB file over their 56k dialup connection is inviting frustration on their part. A 13MB file (the size of part 2) is still pretty big, but a lot more manageable on a dialup.
Quote this message in a reply
Moderator
Posts: 3,579
Joined: 2003.06
Post: #11
Dial-up users will be more frustrated to have waited for a 30 MB download only to find an installer at the end, and then drag that to the trash before they ever even try it out. If it's only 13 MB more for part 2, why not simply have them download the full 43 on the first download and unlock it if they pay? Again, this is an issue that isn't an issue. Dial-up users are used to waiting. Don't use an installer.
Quote this message in a reply
Member
Posts: 283
Joined: 2006.05
Post: #12
Couldn't you make the full game a bundle that's recognised as belonging to the demo? So double-clicking it or dragging it onto the demo runs a little bit of code that moves the contents into the main app.
Quote this message in a reply
Member
Posts: 104
Joined: 2007.01
Post: #13
maximile Wrote:Couldn't you make the full game a bundle that's recognised as belonging to the demo? So double-clicking it or dragging it onto the demo runs a little bit of code that moves the contents into the main app.

I suppose, assuming it is even possible. But I don't know how to do it. Again, my Mac development experience is extremely limited at this point. I'm having a hard enough time figuring out how to use XCode.

Does anyone have any examples of how to do this?
Quote this message in a reply
Member
Posts: 104
Joined: 2007.01
Post: #14
AnotherJake Wrote:Dial-up users will be more frustrated to have waited for a 30 MB download only to find an installer at the end, and then drag that to the trash before they ever even try it out. If it's only 13 MB more for part 2, why not simply have them download the full 43 on the first download and unlock it if they pay? Again, this is an issue that isn't an issue. Dial-up users are used to waiting. Don't use an installer.

For the record, I'm not set on using an installer. I would like very much to deliver my games the way Mac users are used to. I'm just trying to figure out what my options are, and how it is going to work.

One thing I am opposed to is generating registration codes. I want to get away from registration codes. I've used registration codes on my first two games, and they're too much work. People are always losing them, and I'm always having to resend their codes. I frequently have to deal with support issues where a code isn't working because someone isn't entering it correctly, and communication gets really difficult when the customer doesn't know much English. So codes are out.

With Dirk Dashing, I decided to deliver the game in two parts (this was before I knew anything about Mac development). This makes it pretty easy for me, and it has worked well with both the Windows and Linux versions. Naturally, I would like to deliver the Mac version the same way, for consistency. That's why I'm trying to figure out how this paradigm would work with Mac's concept of application bundles. If anyone knows a way to do this (via some kind of script or Mac-based installer) and can point me toward some examples, that would be great.

Having a 16MB trial version and a 30MB full version is one option. This would be easy to do. Again, I fear for dialup users. I know they're used to waiting, but this is really a lame excuse. In my three years of business, I've dealt with support issues from dialup users who have paid for a game and haven't been able to download all the additional add-ons due to dialup issues. Those support calls are tough to deal with, because there just isn't much I can do from my end. And I really hate having to refund the customer, and let them walk away from their first experience with my company with a bad taste in their mouth. There are still a lot of potential customers who use dialup, and they don't have a choice (for example, they live in rural areas). A company that considers the needs of dialup users and builds its web site and its processes to accomodate their limitations scores A LOT of points with them. A business that doesn't do this alienates a large portion of the market segment. So I'll keep this option in mind, but only as a last resort.

A second option I'm looking at is a simple registration process like: http://www.37signals.com/svn/posts/191-r...-writeroom. This would also be pretty easy to implement, and is a way to do an "unlock" mechanism without using registration codes. Unfortunately, I don't think it would reduce the amount of support issues I have to deal with. On the other hand, maybe I would only have to use this system with the Mac. Another issue with this approach is that this would require me to deliver the full 30MB up front - that's an issue because I've been considering open sourcing the code for my games. And the only way I see to sustain a game development company that develops open source games is to hold back part of the game assets, and only deliver them to the paying customers.

A third option is to use a Mac-based install of some kind, maybe using Apple's PackageMaker. I know you say Mac user's don't like installers, but I've seen some apps that use installers created with PackageMaker (e.g., NeoOffice - you download the main application, and then they use a patch installer to upgrade it to the latest version). I don't know much about PackageMaker yet, all I know comes from this link: http://tinyurl.com/3ct781. From what I see, it looks very similar to what I've already got. Maybe I can deliver the trial version as a normal application bundle, and then use some kind of patch installer to finish installing the rest of the game? I really don't know. I need to do more research.

If anyone has any other options, I would be more than happy to listen. I want to deliver a good experience for Mac users, and if that means ditching installers, I'm definitely open to that. But at the same time, I need to consider all these other issues - trying to provide a decent experience for dialup users, trying to reduce the amount of support calls I have to deal with, and planning ahead for the possibility of open sourcing my code. You guys are familiar with Mac development, so help me out. How can I account for all these things on the Mac without using an installer?
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #15
I would consider registering like .dd2 as a package, so you can give it an icon and it will open your game when double-clicked. Then distribute the extra content on a DMG in that package, and have the user place it next to the application bundle. Then you can just check for the package next to your app at startup.

You could also have it install into the application bundle when double-clicked, though you have to deal with the case where the user doesn't have permissions to do that.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Dirk Dashing beta is ready! GolfHacker 15 6,587 Feb 26, 2007 08:51 PM
Last Post: GolfHacker
  RFP - Dirk Dashing GolfHacker 4 3,696 Jan 22, 2007 07:54 AM
Last Post: GolfHacker
  Debug build works on Panther, but not Release build... TomorrowPlusX 4 4,292 Jun 24, 2005 09:25 AM
Last Post: TomorrowPlusX