Creating games for different operating systems...
Miscellaneous Forums/General Discussion/Creating games for different operating systems...
I'm busy making a (casual) 2d game on a windows PC in Blitz Max and I was wondering how can ensure that it will work on Linux and OSX when it's finished?
I was thinking if there was anything code-wise that I should avoid or any particular graphics/audio formats I should/shouldn't be using etc
Any help much appreciated :)
As long as you aren't doing anything Win32 specific (like calling Windows API), it should run on the other platforms just fine.
Ah okay, that's good to know. Thanks Brucey :)
One catch, though: If you compile for the PowerPC based Mac, you may run into issues with Little Endian vs. Big Endian when reading/writing data files to disk. (the bit order may be reversed in placed)
but on Windows/Linux/Intel Mac's there [i]shouldn't[/]i be any issues.
This might be a given.. but keep all your files in the same case eg
File:
Fighter.png
Command:
LoadImage ("Fighter.png") -- not LoadImage ("fighter.png")
Linux is very picky with case!
Save games and setting files also go in different places on Windows, OS X and Linux.
yeah there's lots of little details when you start to look into it more. But in principle it's OK as Bmax compiles on all three.
Save games and setting files also go in different places on Windows, OS X and Linux
Where is the correct place to save files and settings on each system?
I find blitxmax compiles fairly well on linux and windows (it does need compiling separately on each platform of course).
I have also started using Mono C#+irrlicht which seems to just work. It appears that when i create a mono .exe on linux, it not only runs there but also on windows too. ( I am assuming its the same for mac when run with the mono prefix )
I do all my development now on linux to avoid any win32 stuff and problems with filename missmatches (and a whole truckload load of other reasons).
Linux would probably be:
/home/you/.yourgame/stuff
OS X I'm not so sure, I think it's something like:
/Users/you/Library/Preferences/setting_files
/Users/you/Library/Application Support/stuff
Windows I'm not sure, but somewhere in:
C:/Documents and Settings/you/My Documents or the Application Data folders.
Someone care to correct this. :)
Windows is dependent on if you are using Vista or XP (or older) and you also have to create a folder with the correct user privileges. There's probably some threads about it in the Bmax forum when I was researching this before I added it to my Grey Alien Framework. Mac should be in Users/Shared/Your Game folder and it must be created with the correct privileges, again this is in my framework. This whole privileges thing is so that if a different user logs onto the computer they can read and write files to the folder (in other words play the game without it crashing). Unfortunately it's not a simple topic (took me ages to get it all right). Mind you I was doing it for a commercial game, so maybe a free game could be more lax - I don't know what sort of game you are needing it for.
I don't know what sort of game you are needing it for.
Well, I'm working on 2 games at the moment, one is a 3d horror game that I've been working on for yonks, currently moving it from B3D to Bmax and Leadwerks engine. The other game I'm making is a 2d causal 2d game that I intend to submit to some of the big portals (BFG springs to mind). It's my 2d game that I want to get working on all 3 platforms if possible. Think I might buy your framework in a couple of weeks actually Grey :)
Cool, well good luck with both. My framework has plenty off essentials in it for professional casual games. BIG time saver for you ;-)
i'll vouch for GA's framework. the more i use it the more amazed i get, and i've only utilized a small portion of it so far. once you start to get used to it, you can get the bare basics of a game up and running fairly quick/easy. the only minor complaint(not really a complaint) i have is, there is no built in way of packing/unpacking your media. not that i'm worried about someone stealing my 'l337' graphics and such but more that i just think it looks better with media in pak files. just a personal prefrence but not a big deal.
EDIT:
i should also mention that there are ways to use packed media, i know atleast a couple framework users have done so. i've only very briefly looked at some techniques but haven't spent enough time on it to get it working myself.