Grey Alien Framework Tip!

BlitzMax Forums/BlitzMax Programming/Grey Alien Framework Tip!

therevills(Posted 2010) [#1]
Ive just spent a good hour trying to fix very simple bug :(

Im writing my new game using GAs latest version v1.11 (first time Ive used this version - Ive been using v1.09) and I was copying the common stuff across, I added the gamescreen with an IntroAnim and OutroAnim...

IntroAnim = TAnimation.Create(750, False)
OutroAnim = TAnimation.Create(1500, True)


Played my game, IntroAnim works fine... but OutroAnim now doesnt keep on the screen... wtf?

Finally(!) found out that in GAF v1.11, the TAnimation.Clear() now clears more stuff including the LeaveActive flag and since I was doing this:

	Method Start()
		Super.Start()
		LevelStart()
		.......
	End Method

	Method LevelStart()
		ClearCounters()
		.......
	End Method

	Method ClearCounters()
		'for safety
		If IntroAnim <> Null Then
			IntroAnim.Clear()
		EndIf
		OutroAnim.Clear()
	End Method


It was clearing out the LeaveActive flag every time the game starts.....

So heres my tip... dont clear your animations at the start of your game ;P


therevills(Posted 2010) [#2]
Okay... what have I done wrong now???

For some reason when quitting and music playing, the music fades out but just as the screen quits you can hear the music play again...

Does anyone who uses GAF v1.11 experience this?


InvisibleKid(Posted 2010) [#3]
i just tested a couple of my projects from both the ide, and the exe itself. and everything seems fine to me ( music fades, then game ends ).

sn:
although pretty sure not related but just incase.

i'm using the older fullaccess.cpp because i have an older ver of MinGW installed and for the life of me can't find a dl for ver. 3.4.5, every link i find is for 5.xxxx.

again pretty sure not related but just incase.


GfK(Posted 2010) [#4]
i'm using the older fullaccess.cpp because i have an older ver of MinGW installed and for the life of me can't find a dl for ver. 3.4.5, every link i find is for 5.xxxx.

The 'new' version of fullaccess.cpp (as in this post) compiles fine for me with MinGW 5.1.6.


InvisibleKid(Posted 2010) [#5]
hmmm, ok then... i could have sworen i read something quite awhile back that any ver past 3.4.5 didn't work right with bmax or there was some kinda problem. thanks for letting me know otherwise.


Grey Alien(Posted 2010) [#6]
For some reason when quitting and music playing, the music fades out but just as the screen quits you can hear the music play again...
I have some kind of screen fade bug noted that happens in a specific (rare) situation, I'll look it up. Ping me on the Framework Forum if I forget (I'm not at PC right now).


therevills(Posted 2010) [#7]
(rare)


Seems to be not that rare for me :(

Ive gone thru my code and yours, added heaps of debug statements and I still cant find it... the setVolume goes to zero... I hate bugs like this... also Im spending far too much time on it and not getting my game done :(

Ping me on the Framework Forum if I forget

I was going to post this on there, but the forum is dead quiet, so I thought I would have a better chance here ;)


Grey Alien(Posted 2010) [#8]
I checked my notes by the only sound bug I have is to do with turning music on and off with the debug key. Have you tried a different sound driver? Is it present on the Mac? Or even an older version of Blitz?


Blitzplotter(Posted 2010) [#9]
@therevills, I've just returned to use the latest update in the last day. All is not lost....


therevills(Posted 2010) [#10]
Ive just changed AOTMG to be able to compile on GAF v1.11 and I still get this sound issue.

http://sites.google.com/site/therevillsgames/blitz/V111AOTMG.zip

If I change sound drivers I get no sound at all - running Windows 7.

Havent tried it yet on my Mac yet...

What version BlitzMax are you using Jake?

[Edit: Just tested on the Mac using BlitzMax 1.39 and GAF v1.11 and it seems fine - something must be wrong with the OpenAL driver Ive got installed on the Win7 box]


Grey Alien(Posted 2010) [#11]
weird. shouldn't direct sound work on windows 7? And should freesound work too (probably with a delay like in Vista)? You know you have to change the driver and reload the game right?


therevills(Posted 2010) [#12]
I did reload the game after changing the sound driver, but it defaulted straight back to OpenAL... I think because of this code in GAF:

		?Win32	
		OSVersion = ccGetVersionString()
		'Change to OpenAL for Windows Vista (and 98/ME/2000) because it's more stable than FreeAudio.
		If OsVersion <> "Windows XP" Then
			SoundDriver = "OpenAL Generic Software" 'this one has a software mixer that allows >6 channels on crap cards.
			ChangeSoundDriver(SoundDriver, 0) 'this is a method of TGame (don't save IniChanged.dat)
		EndIf
		?


Yep Ive commented out this code and now can test the other sound drivers.... and I dont get this issue with FreeAudio or DirectSound.

[EDIT]

I think Ive found the issue... I just remembered while installing Penumbra it installed OpenAL and I started coding this game after that.

Ive just uninstalled OpenAL and tried my game - I couldnt select OpenAL for the sound driver... guess what I forgot to do when setting up my project...........

I didnt copy across the OpenAL32.dll or wrap_oal.dll to my project folder!!!!!!?!?!?!?!?! D'oh!!!!!!!!!!!!!!!!!


Grey Alien(Posted 2010) [#13]
Was just thinking you probably failed to do that so it was picking up a crappy old Windows version. Well glad to know my framework still rocks ;-p