Attack of the Mutant Greys (Vista Compatible)

Community Forums/Showcase/Attack of the Mutant Greys (Vista Compatible)

Grey Alien(Posted 2007) [#1]
Hi, I recently made my BlitzMax Game Framework ( http://www.greyaliengames.com/framework.php ) compatible with Windows Vista and will be releasing a framework update (V1.05) soon.

Meanwhile I had some fun tonight improving my AOTMG demo game by having random alien sizes/strengths and giving the player increasingly more powerful firepower. It's still very basic but these new improvements make it quite fun.

DOWNLOAD IT HERE: http://www.greyaliengames.com/aotmg/aotmg045a.zip (5.43Mb)

Intel Mac version here: http://www.greyaliengames.com/aotmg/AOTMG045.dmg (Double click the disk image to open it, then make a folder on your desktop and drag the contents of the disk image into it. Then click AOTMG to run it).

Try to beat all 10 levels and score over 20,000. I did so it's possible.

How can you tell that this game is Vista compatible? Well it switches to the OpenAL Sound Driver (press D to bring up the Debug stats and check) because the FreeAudio one isn't so good. Also, if you log onto Vista as another user the game profiles will still all be there and the high scores will be properly shared - many games do NOT have this capability in Vista due to User Account Control virtualising the file writes and reads.

If you have 98 or ME, the default FreeAudio isn't so good (it seems fine in most XP setups) so try bringing up the Debug stats and pressing H until you change to DirectSound or OpenAL Generic Software. Then exit the game with Ctrl+X and reload to get the sounds back otherwise it may crash when it next tries to play a sound.

Enjoy! (This isn't a "proper" game, it's a tech demo so I don't need any "playability" feedback ;-) but I do need to know about any errors or anomalies, thanks!)




Ked(Posted 2007) [#2]
Wow. Looks amazing.


Grey Alien(Posted 2007) [#3]
Thx!

Just uploaded an IntelMac version.


JazzieB(Posted 2007) [#4]
Seems to work just fine. Just missed out on the 20,000 with a score of 19,110 on level 10.

For the Mac version you should really include all the data/media within the application bundle itself, as this is generally how it's done on that system. Still keep high scores, etc, in the Shared User folder though (don't know if this is where you store save data, as I haven't tried the Mac version). I've just figured out how to do this and it isn't too difficult. Obviously no biggie here, as it's a demo of your framework. I'll probably do a How To later on today for anyone else that wants to include the data within the bundle, as it will also be especially useful for those creating Universal Binaries.

Also, I noticed that you only had a 48x48 icon. Vista really needs a larger 256x256 icon to be included as well. Again, probably doesn't really matter in this case.

Overall, good job and everything appears to be working as it should. Although I've not extensively tested and I had UAC turned off.


Grey Alien(Posted 2007) [#5]
Thanks for testing. Yeah I am planning on getting the AppBundleURL and storing my data in there and also profiles/high scores in the shared user folder (Where can I find that and is that path always the same? Or should I call a function to get it?)

re: icon: yep 256x256 icon is already on my to do list :-) I've still got your multi-size icon to figure out how I can import and include it as a resource so that the Window and taskbar and alt+tabber all have a decent icon.


JazzieB(Posted 2007) [#6]
also profiles/high scores in the shared user folder (Where can I find that and is that path always the same? Or should I call a function to get it?)

Typically, the Shared User folder is always the same path ("/Users/Shared"), however I now make use of Brucey's Volumes mod to retrieve all special folders. Once you've got his mod working, you can get the shared folder by the following.

Global pathCommonData=GetCustomDir(DT_SHAREDUSERDATA)+"/"

Yeah I am planning on getting the AppBundleURL and storing my data in there

I don't know of a call for this, but it can be gotton quite simply with the following code.

Global dataFolder=StripDir(AppFile)+".app/Contents/Resources/"

The only thing to watch when you copy your data into the application bundle are the file permissions. You'll need to go in and change them to "read only" or "read and write" for all other users, as by default, only you will be able to then run your game. Just change it from the top-most folder and apply to all sub-folders. I'll be doing a quick tutorial for this soon.

re: icon: yep 256x256 icon is already on my to do list :-) I've still got your multi-size icon to figure out how I can import and include it as a resource so that the Window and taskbar and alt+tabber all have a decent icon.

I currently have that same icon as a separate .ICO file in my game's Data folder and your own code (in the code archives) already adds it just fine. Resource Hacker also adds the icon to the application just fine, but I know that's not how you want to achieve it.

Hope that info was of some use and keep up the great work.


Grey Alien(Posted 2007) [#7]
Hey great! Thanks for the help! Brucey's volumes sounds cool, but ultimately I have to get some code that I can add to the framework that doesn't require anything external...perhaps if I ask him nicely ;-)

I look forward to your tutorial. Doing it soon by any chance? I'm gonna be releasing the Mac version of my current game in a few weeks...got some more API calls to figure out before then like adding a minimise icon to a graphics window etc.


JazzieB(Posted 2007) [#8]
Brucey's volumes sounds cool, but ultimately I have to get some code that I can add to the framework that doesn't require anything external...perhaps if I ask him nicely ;-)

Forgot you needed to do this yourself ;o) However, as I mentioned the "/Users/Shared/" folder is standard and should be present on all Macs, regardless of country. At least, that's what I was told, but you may need to double-check that.

look forward to your tutorial. Doing it soon by any chance?

Yep! Just done it and you can find it here.


Grey Alien(Posted 2007) [#9]
Top Man! I'll shall be making use of this soon, many thanks.


JazzieB(Posted 2007) [#10]
Oh, the other thing I forgot to mention...

When changing audio drivers in-game, you can just reload the audio. I basically stop everything currently playing, swap drivers, reload the audio, and restart any music that needs to be playing. Basically what we used to have to do with graphics in Blitz3D when changing resolution.


Grey Alien(Posted 2007) [#11]
Yep I realise I have to do that, BUT I've not been meticulous enough in storing all the currently loaded media in a single list in code (actually most of it is) and I can't guarantee users of my framework have done the same, so I would only be able to reload *some* of it. To be honest, I'm not bothered about allowing the user to change sound driver MID-GAME, that's just over the top (congrats if your games do!). I'm content that they have to reload the game. I've got dynamic graphics driver changing and screen mode changing as Bmax handles that automatically which is cool.

Oh btw, the Mac version above should exhibit a current BMax bug where changing to and from windowed mode screws up all the graphics completely! But Mark thinks he has fixed this so roll on V1.28...


JazzieB(Posted 2007) [#12]
On the reloading audio front, how about the audio driver doesn't actually start until the game is next run, rather than changing straight away and risking a crash?

As for the graphics issue, I did notice that it's now in the bug bin. Just wish Mark would hurry up and upload v1.28! Still, I'm using the temporary fix he suggested until then.


ImaginaryHuman(Posted 2007) [#13]
Grey, I downloaded the PC version and then the Intal mac version and put the intel mac part into the PC folder as mentioned, but you only included a Contents folder, there is no .app to run. ?????????


Grey Alien(Posted 2007) [#14]
JazzieB: Yes that's a good idea, I'll add it to my to do list, bu tit's not priority for me right now. Yeah if 1.28 isn't out quickly then I'll try that fix out, but hopefully it will be.

ImaginaryHuman: Hmm, I've been using that method to send Mac versions to the artist. I think you need to extract what is in the zip into a folder and then NAME that folder AOTMG.app and it'll work. Can you try that for me please? Meanwhile I've renamed the download file to include .app to make it clear. Thanks for alerting me to this problem.


ImaginaryHuman(Posted 2007) [#15]
That did not work. Renaming the zip did not create a .app file either. It still expands to only show a Contents folder.

Can you just compile a normal .app and then zip that with full media, it's not that huge?

I tried renaming the main folder adding .app and it just will not open the application.


Grey Alien(Posted 2007) [#16]
weird cos it's in there, it's like about 800k big. Hmm, I just checked it out and before it's zipped Mac recognises the file as an executable yet after it's zipped and unzipped it sees it as a document, weird! What will happen if I upload the app file (which is really a folder)? You won't be able to download it as a whole so that wouldn't work. I need to package it with something other than winzip I guess...


ImaginaryHuman(Posted 2007) [#17]
I always presumed that if you just zip the .app then it will end up the same way it started.

Maybe try making a disk image or something.


Grey Alien(Posted 2007) [#18]
yeah me too so it's weird. How can I turn it into a DMG whilst in the Mac OS please? Then I can copy it to my PC and upload it to the webspace.

Previously I was zipping and unzipping on the PC after copying the app bundle to it from the Mac, but that hasn't worked.


ImaginaryHuman(Posted 2007) [#19]
I dont know how you do that.


9572AD(Posted 2007) [#20]
some replacement media:


;)


JazzieB(Posted 2007) [#21]
yeah me too so it's weird. How can I turn it into a DMG whilst in the Mac OS please?

You use the Disk Utility for that. First create an image of the size that you need. It basically mounts an image on your desktop that you can then copy files to. Once done, eject the disk and use the Disk Utility again to turn that into a compressed disk image. It's fairly straight forward, so you shouldn't have too much difficulty.


Grey Alien(Posted 2007) [#22]
9572AD: Two drums and a cymbal fell off a table: ba boom tischhh.

JazzieB, OK will try now.


Grey Alien(Posted 2007) [#23]
OK think I've sorted that (thanks JazzieB). ImaginaryHuman please test for me if you have time. Thanks!


ImaginaryHuman(Posted 2007) [#24]
Will do tonight, thanks.


ImaginaryHuman(Posted 2007) [#25]
Grey, after trying this new DMG and copying the data folder from the old pc zip into the app folder, I get this error from your app:

"Cannot create shared profiles folder Data/profiles/"

I tried moving the Data folder to other sub folders, nothing works.

Can't you just create a dmg version with the full app and full media? We shouldn't need to be copying files around or changing folder permissions just to get this working.


Grey Alien(Posted 2007) [#26]
This isn't going very well is it? :-)

Yes I should just make a single DMG, I'll do it later. Thanks for testing again.

What you need is this:

- a folder called "AOTMG" or whatever
- put the AOTMG app from the DMG into it.
- put the data folder from the PC version into the folder made in the first step
- run the AOTMG app.

That's it. The Data folder doesn't go into the actual app, it just goes on the same level as it.

Anyway, I'm going to be changing this kinda stuff soon so that all the readonly data *IS* in the app and writable dta will be stored in a shared folder on the Mac.


Grey Alien(Posted 2007) [#27]
ImaginaryHuman: OK I've made a full disk image, instructions as follows:

Intel Mac version here: http://www.greyaliengames.com/aotmg/AOTMG045.dmg (Double click the disk image to open it, then make a folder on your desktop and drag the contents of the disk image into it. Then click AOTMG to run it).

Like I say, later on I'll put the data inside the app bundle so you only need to copy out that single file from the Disk Image.


Brucey(Posted 2007) [#28]
perhaps if I ask him nicely ;-)

Sure, no probs :-)
...on the condition of a mention in the credits :-p


CodeD(Posted 2007) [#29]
Vista has been driving me crazy lately as well. :X


Grey Alien(Posted 2007) [#30]
Brucey: cool thx :-) If I added your code to the framework you name would be beside it of course, is that what you mean?


ImaginaryHuman(Posted 2007) [#31]
Hey Grey.

With your new DMG everything worked fine once the application is dragged out of the disk image and onto the `real harddrive` or desktop. Running from the HD or desktop works fine. However, *usually* most games will run directly from the disk image itself without requiring it to be put into the applications folder or whatever. Your game does `run` but it comes up with a message saying it can't write an ini file. The path it's trying to write to is presumably within the DMG disk and not on the real harddrive. Just something to consider. Also you probably should not have a data folder alongside the .app unless you're going to put both of them into an enclosing folder, otherwise the user has to create a folder to keep both in the same place.

As to your framework itself, you have improved and tweaked it nicely. The game is more impressive with lots more objects onscreen and your explosions and sound effects are much better. Everything worked correctly and once I figured out to hold down the Z key instead of pressing it many times suddenly proved to make it very easy to progress; -D

Everything seemed to work fine with regards to prefs and options, except for when switching to or from windowed mode. This *TOTALLY* screwed with your graphics. I can't even begin to describe what happens to your visuals when switching between those modes. ... Well, to give some idea, many image textures are lost, resulting in various pieces of the GUI etc becoming white instead of textured. There is some kind of crazy thing which goes on with the buffers, etc. Changing between screens within the game while remaining in windowed mode seems to for the most part restore most of the images but not all of them. It's pretty wierd.

I am not sure whether you can trust that when you switch between full and windowed modes the graphics will all be retained. It was my understanding at some point in BlitzMax's past that it was not able to retain any images in videoram when you close the screen or window, because it loses the OpenGL context and thus all textures. This *seems* to be what is happening, because switching between modes seems to give you `leftover` graphics and missing image data, as if you were accidentally referencing parts of video ram which are now partly overwritten or whatever. Unless someone can say for sure that Max is supposed to be able to retain all image data after an EndGraphics(), I think I would personally re-upload all texture data (images) upon opening a new display.

See below 9 screens which occurred after swapping between full and windowed and back. You get different corruption each time. As you can in some of the shots the mouse pointer graphic is actually taking the place of the backdrop image in the menu! This is not a bug in your code, I think it is more likely the effect of texture references getting lost and confused and using old references which are disassociated from their proper texture data.




JazzieB(Posted 2007) [#32]
From GA further up this thread...

Oh btw, the Mac version above should exhibit a current BMax bug where changing to and from windowed mode screws up all the graphics completely! But Mark thinks he has fixed this so roll on V1.28...


It's a known issue with v1.26 of BlitzMax. This has been fixed in v1.28, which should be out in the not too distant future. There is a quick fix, but Grey chose not to implement it as it was previously mentioned that v1.28 would be out in a day or so (unfortunately, this was about a week ago now!).


Grey Alien(Posted 2007) [#33]
Your game does `run` but it comes up with a message saying it can't write an ini file. The path it's trying to write to is presumably within the DMG disk and not on the real harddrive. Just something to consider
Yep I saw that too, that's why it's on my to do list to write all those sort of files to a Shared User Data folder on the Hard Drive.

Thanks for playing it and also for posting about the graphics bug. You used to be able to swap screens in BMax 1.24 no probs but BRL has broken it in 1.26 and as JazzieB says, I'm just waiting for the update. If it's not soon, then I'll apply the fix myself.


ImaginaryHuman(Posted 2007) [#34]
Ahh okay, makes sense.