Who here's got Blitzmax and a Mac?

Community Forums/General Help/Who here's got Blitzmax and a Mac?

sswift(Posted 2009) [#1]
Want a free copy of my Space Beetles game?

I need someone who can make a Mac build for me of the demo and full versions. Preferably with some kind of installer for each. (Assuming mac games even use installers. I know nothing about Mac OS.)

I can provide you with a Mac format icon for the game. I assume that's the only thing that would need conversion.


Naughty Alien(Posted 2009) [#2]
..i do have both..MacBook pro with 8600GT rigged on it..email me if ya need any help..


RmB303(Posted 2009) [#3]
I also have both, but I have PowerPC Macs (PowerMac and PowerBook); so then old-style Mac users (like me) would also be able to run your game :-)

I don't think an installer would be necessary, especially if you INCBIN the datafiles.

p.s. I'm not very experienced with BlitzMax yet though ;-)


Ked(Posted 2009) [#4]
Sorry to hijack, but Naughty Alien and RmB303 see here. It would be much appreciated if you could help.


sswift(Posted 2009) [#5]
Hm... I didn't know I'd need two verison for Mac.

I'd rather not spread the code around to too many people, and I'd like to use the same installer for both versions if possible. Does anyone have both types of Mac?

Oh, and the files aren't INCBIN'd. So an installer is pretty important.


therevills(Posted 2009) [#6]
Hm... I didn't know I'd need two verison for Mac.


Well you dont really, just a universal build which can be run on PowerPCs and Intel Macs.

Before Brucey's excellent work, you would have to compile the Mac version on the two Mac Platforms and combine them, but now using Brucey's BMK NG you can just compile on the Intel and it will create the universal build for you.

I cheated when I released Gunslinger Solitaire and just compiled a PowerPC version (also at the time I only had a PowerPC) which works on both platforms. But next time Im going to use Brucey's stuff, as now we have got a new mac mini (Intel based) :)


Qube(Posted 2009) [#7]
I've a MacBook with an Intel CPU and nVidia 9400 GPU and a PPC iBook. email address in my profile if you want to contact me :)


sswift(Posted 2009) [#8]
Qube:
There's no email address in your profile.


Brucey(Posted 2009) [#9]
I didn't know I'd need two verison for Mac.

As therevills alludes to, it is now possible to build a combined "Universal" binary for Mac using an Intel Mac (with the appropriate support files).

Oh, and the files aren't INCBIN'd. So an installer is pretty important.

Unless you want files to be stored in "system" folders, an Installer is not required on Mac.
On the Mac, an application (game or whatever) comes as an Application Bundle, which in effect is a folder with everything inside it - The user simply sees an application icon on the desktop that they can double click.
In this Bundle folder, is a specific set of folders where you can keep your application binary, and resources for it - like your images, sounds, data files, etc.
An application will usually be deployed as a "disk image" file, which you open, then simply Drag the application from the disk image into your Applications folder.

This is a typical Mac method of deployment.
No installer required. Everything *should* run from its Application Bundle.

So, this is how all Mac users would expect your game to be installed :
* Open image
* Drag and drop
* Run

:-)


sswift(Posted 2009) [#10]
It's like you're speaking another language.

An Application Bundle sounds like a zip file. How is one created? There must be some kind of process.

How do you set this bundle to use a certain icon?

In regards to these special directories, am I going to have to alter my game to get it to run on the Mac? The game pulls the assets from subdirectries. And it saves the savegame data to one of those as well.

Also, don't Macs have anything like a Start menu? I mean you can't just stick every app you download on the desktop. I know there's some kind of application bar at the bottom of the screen, but I don't know if that just shows open applications or not. But if there are multiple places where an app could be installed, I assume like on the PC, app makers will want to offer the user the option to easily install links to the app in all those places. And what of readme files and the like? And webpage links? How do those get dealt with?

I guess no uninstaller is needed because the app is assumed to only write to its own directory, and there's no registry to get cluttered up? And there's no shared dll's or anything either?

So many questions...


xlsior(Posted 2009) [#11]
IIRC an application bundle really is an actual folder, nothing more, nothing less.

To package it all together for distribution most apple users would expect a .dmg file (disk image file) containing the folder.


Snixx(Posted 2009) [#12]
This is the part I really like about my Macbook pro (well OSX in general) there is hardly any clutter, most apps/games store all their files in one "folder" that you drag into your applications folder, there is a startmenu kinda of, the Finder in the finder it looks alot like explorer so you click onto your applications shortcut and all the apps/games appear in the window.

Or you can just use spotlight and type the start of the app/game.

Once you are done with an app/game just drag the app folder into the bin and tada.


N(Posted 2009) [#13]
sswift: Since I don't want to explain the whole bundle thing to you, go and read everything up to Packages and the Finder in this: http://developer.apple.com/documentation/CoreFoundation/Conceptual/CFBundles/CFBundles.html

As xlsior said, bundles are just folders. There's nothing special about them except that Finder treats them differently (and there's an API for working with them).

In regards to these special directories, am I going to have to alter my game to get it to run on the Mac? The game pulls the assets from subdirectries. And it saves the savegame data to one of those as well.
Probably. You should've been coding for this in the first place, though. I'm sure someone here would be willing to help in porting if you can't afford a Mac Mini, though.

Also, don't Macs have anything like a Start menu?
No, not really. You've got Spotlight, which is what Vista ripped off with its searching thing in the Start Menu, though, and that usually works for opening any application you're looking for. Otherwise you'd probably just open the Applications folder (either in Finder or as a grid/stack/list in the dock).

I mean you can't just stick every app you download on the desktop.
You could if you wanted to, but usually you just drag them to your Applications folder and they get copied there. After that, the user decides whether or not they'll put it in the dock.

I know there's some kind of application bar at the bottom of the screen, but I don't know if that just shows open applications or not.
Think of it as a combination quicklaunch bar and taskbar. If you've used Windows 7, it's pretty much the same as its taskbar.

But if there are multiple places where an app could be installed, I assume like on the PC, app makers will want to offer the user the option to easily install links to the app in all those places.
Nope, bad idea. I guarantee you Mac users wouldn't like that one bit. You definitely do not want to put junk in random places. Basically, you should never, ever mess with stuff that isn't part of your application.

And what of readme files and the like? And webpage links? How do those get dealt with?
You'd put them in the disk image and the user can refer to the disk image for those, otherwise they'll probably never be put directly in a folder. Unless your players need these things, and they probably don't, you shouldn't bother to include them. At best they'll be ignored, at worst they'll be annoying.

I guess no uninstaller is needed because the app is assumed to only write to its own directory, and there's no registry to get cluttered up? And there's no shared dll's or anything either?
Not usually. I'm not sure what you'd use a registry for under Mac OS, and there's probably one somewhere in some form, but I've never seen it or dealt with it. There are shared libraries, and if your game is using any, you'd want to include them in the application bundle (see documentation).

Basically, anything that the user does not need, you probably do not include. Mac users tend to be sort of picky when it comes to whether or not something works the same way as everything else does under Mac OS. It's worth keeping in mind that the 'user experience' is important. That phrase gets thrown around a lot, but it seems to apply very well to Mac users from what I've seen.


Brucey(Posted 2009) [#14]
It's like you're speaking another language.

Well, given that you wanted someone else to do this anyway, it doesn't really matter that you've no idea what I'm talking about :-)

I was just pointing out, that whomever is going to do this for you, should do it in the way I've described, which is the way users expect it to be done.

You can even have a pretty background for when the disk image opens - in fact, the disk image can be customized so that the files/folders appear in specific places, etc.

:o)


sswift(Posted 2009) [#15]
Can't Mac users on Intel platforms at least, just run windows software as is? I saw a tutotial on youtube about how to install garry's mod on a Mac, and it involved installing the Windows version of Firefox.


N(Posted 2009) [#16]
Can't Mac users on Intel platforms at least, just run windows software as is? I saw a tutotial on youtube about how to install garry's mod on a Mac, and it involved installing the Windows version of Firefox.
Most Mac users do not have the technical skills to do that stuff, and even then there's no guarantee that something will run with Wine.


sswift(Posted 2009) [#17]
Nillium:

Thanks for that link about how packages are structured. It makes a lot more sense now.


I'm still not clear on the whole accessing of the data thing though.

So my executable goes in Contents/MasOS. And my images and sounds go in Contents/Resources.

Does that mean that on a Mac, to load my images, assuming I stored them in a Gfx directory under Contents/Resources, that I would have to do something like LoadImage("../Resources/gfx/planet1.png")?
Or does Blitzmax automatically pull files from Contents/Resources, so LoadImage("gfx/planet1.png") would suffice?

If it is the former, then I could easily add a compiler directive to my app which changes the behavior of LoadImage on a Mac to pull files from that directory, so I don't have to change all other references in my code to my data files. And if it's the latter, I guess I don't need to do much beyond change the directory the executable is stored in for the Mac version.


Also, one last thing I need to know is... what about writing data? If I need to write a savegame file, can I write that to the Resources directory?


N(Posted 2009) [#18]
So does that mean that on a Mac, to load my images, assuming I stored them in a Gfx directory under Contents/Resources, that I would have to do something like LoadImage("../Resources/gfx/planet1.png")?


BMax doesn't read from the Resources directory by default as far as I know. You'd probably just want to do something like


As for writing save games, I'd put those in ~/Library/Application Support/<AppName>/Saves, and it's fairly easy to get the full path of that using NSString:
BBString *bb_SupportDirectory() {
    return bbStringFromUTF8String([[@"~/Library/Application Support"
                                    stringByExpandingTildeInPath]
                                   UTF8String]);
}



sswift(Posted 2009) [#19]
Why would I need to do all that if the Resources are always going to be stored in the Resources directory, and that's how my app will be packaged?

Won't simply writing ../Resources/ accomplish gaining access to it?


As for writing save games, I'd put those in ~/Library/Application Support/<AppName>/Saves, and it's fairly easy to get the full path of that using NSString:


Okay, that's kinda like how you're encouraged to do it on Vista... but if I want to, can I write to the Resoruces directory?


I just want to quickly get a Mac version out there. I don't know how any of that code works and if it breaks, I have no way to fix it easily. So I'd like to keep things as simple as possible.


N(Posted 2009) [#20]
Won't simply writing ../Resources/ accomplish gaining access to it?
No, because your current path when you launch is not inside of *.app/Contents/MacOS, it's in the directory that your .app is in (usually, but if you launch it from the dock it may be different - basically, there's no guarantees about where your app's starting path will be, so you shouldn't assume it'll be where you want). Secondly, doing it the way I'm suggesting (which works, considering I've been testing all the code as I write it, and it's really stupidly simple code) means you don't have to modify all of the paths for something just to build under Mac OS, but rather you just put some code specific to Mac OS in your initialization routine prior to loading resources.

Okay, that's kinda like how you're encouraged to do it on Vista... but if I want to, can I write to the Resoruces directory?
You could, but if your user deletes the app, obviously their saves are going to go with it. That might piss off some people.

I just want to quickly get a Mac version out there.
No offense, but that's stupid and a sure-fire way to guarantee no Mac user will ever touch your game. Quick and dirty ports pretty much always fail.

I don't know how any of that code works and if it breaks, I have no way to fix it easily.
The moment you make enough of a profit to buy a Mac Mini, then you buy one and you have a way to fix it. Otherwise, I'd abandon making a Mac port, because if you're not going to make something that fits into the way Mac OS works, you're doomed from the start.


simonh(Posted 2009) [#21]
Best advice...get a cheap second hand Mac Mini.


sswift(Posted 2009) [#22]
No, because your current path when you launch is not inside of *.app/Contents/MacOS, it's in the directory that your .app is in.


Okay, but that doesn't seem like that big a deal...

Wouldn't this work fine?

?MacOS
ChangeDir("Contents/Resources")
?


I like your method of simply changing the directory to make everything work, but I really don't have the time to muck about with trying to get MinGW to work so I can compile that C code. And I don't really see the point of all that if the above code will do the job.

As for my savegames, they're just names and high scores. And besides, I don't think I've ever deleted a game and wanted the save games to then stick around cluttering up my gard drive.


N(Posted 2009) [#23]
Wouldn't this work fine?
No. Your application doesn't start inside of the application bundle, it starts outside of it, and this is only under certain conditions. In some cases, the startup path might be ~, it might in the app bundle, or it might be some arbitrary location that's relevant to a specific context. You can't use "SomethingOrOther.app/Contents/Resources" either because if your user renames the bundle, the code will completely break. I will be very clear, the code works, I know it works, and it will work under all versions of Mac OS 10 (because the API has been available since 10.0).

I gave you a portable, easy to use method of solving this, and the way it works is incredibly simple, and you just seem to be trying to avoid it. Is there something wrong with what I posted that I wouldn't be aware of? (Bear in mind that for any objection you post I will have a rebuttal for, and it will probably make you look bad.)

I like your method of simply changing the directory to make everything work, but I really don't have the time to muck about with trying to get MinGW to work so I can compile that C code. And I don't really see the point of all that if the above code will do the job.
You don't need MinGW for that code because you won't need to build it under Windows in the first place, and if you're using BlitzMax under Mac OS, you'll already have the Apple dev tools installed and there won't be problems building any Objective-C source.


GaryV(Posted 2009) [#24]
Friendly advice here. Listen to Nilium. He knows his s**t. First impressions of your app/game are even more important in the Apple world as Apple users are unforgiving if something is not done/presented in the standard "Apple" way.


sswift(Posted 2009) [#25]
No. Your application doesn't start inside of the application bundle, it starts outside of it, and this is only under certain conditions. In some cases, the startup path might be ~, it might in the app bundle, or it might be some arbitrary location that's relevant to a specific context.


Well that's pretty inconsistent. I thought Apple was all about consistency! :-)


I will be very clear, the code works, I know it works, and it will work under all versions of Mac OS 10


I wasn't questioning whether your code worked. I was just looking for a simpler way to implement it.

It sounded like there might be a simpler way, but you weren't really willing to give it up because you're the kinda guy who likes to follow standards to the letter, what with the lecture on always saving games in a certain folder, and how no mac user will ever want to play my game if it works even slightly different from how they expect it should. :-)


I gave you a portable, easy to use method of solving this, and the way it works is incredibly simple, and you just seem to be trying to avoid it.


What can I say? I'm the kinda guy who likes to take shortcuts. :-)

And it may be offensive to you as a Mac user, but a Mac release of the game really is just an afterthought. I have a friend who only has a Mac and she wanted to try the game out. That's the only reason I'm bohtering with it right now. I simply don't have the time to install a bunch of compilers and do a bunch of debugging to make it work at the moment, if that is what I would need to do.

But as you pointed out, that's not really neccessary, on my end, because I wouldn't be the one compiling it. BUT, I do still have to find someone who CAN compile it. And I have to debug it if it doesn't work for some reason.

And there could still be bugs, even if your piece of the code is flawless. :-)


(Bear in mind that for any objection you post I will have a rebuttal for, and it will probably make you look bad.)


Hehe. :-)


Friendly advice here. Listen to Nilium. He knows his s**t.


I'm sure he does, and I appreciate the help. But I still need to find someone who is capable, and who I can trust to compile this thing. :-)


N(Posted 2009) [#26]
But I still need to find someone who is capable, and who I can trust to compile this thing. :-)
Personally, I'd try to get Brucey to do it (I'd pay him though), just because he's much more knowledgeable about this stuff and I figure he's trustworthy just based on his conduct here. Of course, whether or not he wanted to do it would be up to him, and I can't speak for him.


sswift(Posted 2009) [#27]
Nillium:
I have, literally, no money left at this point, so paying anyone anything is not an option.

But they will get a free copy of my sprite system with it too. :-) I forgot to mention that.


N(Posted 2009) [#28]
I have, literally, no money left at this point, so paying anyone anything is not an option.

Borrow your friend's Mac?

But they will get a free copy of my sprite system with it too. :-) I forgot to mention that.

None of your stuff is really useful under Mac OS though, so...


sswift(Posted 2009) [#29]
My friend lives too far away. And before you suggest it, she's not tech savvy enough to compile the game for me. :-)

And why is my sprite system not useful under MacOS? It uses only standard BlitzMax calls, other than a little bit of custom OpenGL and Direct3D for rendering solid shapes. It should work on both platforms. It's completely seperate from my game code.


N(Posted 2009) [#30]
My friend lives too far away. And before you suggest it, she's not tech savvy enough to compile the game for me. :-)
Tell her pack up her Mac and visit for a week, offer barbecue as payment for Mac use. This is a foolproof plan.

And why is my sprite system not useful under MacOS? It uses only standard BlitzMax calls, other than a little bit of custom OpenGL and Direct3D for rendering solid shapes. It should work on both platforms. It's completely seperate from my game code.
Thought that was for Blitz3D. At any rate, wouldn't be of any use to me (I am Captain Reinventor de Wheel).


TaskMaster(Posted 2009) [#31]
sswift, you could probably borrow her computer long distance with some sort of remote control software? Is there any remote control software that allows a Windows user to control a mac, maybe some open source software like VNC or something?


N(Posted 2009) [#32]
Mac OS has a built-in VNC server, actually. Provided he has Windows a client, it's relatively easy to get it running (System Preferences> Sharing> Enable Screen Sharing).


sswift(Posted 2009) [#33]
Not an option. :-)


TaskMaster(Posted 2009) [#34]
Just trying to find you some options.

I don't like giving out my source code, and can't imagine what it would be like to trust somebody like that. Especially since it is something you are going to try to sell.


DrDeath(Posted 2009) [#35]
BMax doesn't read from the Resources directory by default as far as I know. You'd probably just want to do something like...

I recently stumbled upon a far easier way to get the path to the resources folder, without the need of any Objective-C inclusion: http://blitzmax.com/Community/posts.php?topic=67323#752112

Well that's pretty inconsistent. I thought Apple was all about consistency! :-)

Quite contrary, this is very consistent by giving the *user* the choice how and where to install his applications.