Sound And Animation Challenge =^.^=

Non-platform specific questions.

Sound And Animation Challenge =^.^=

Postby NyahKitty » Thu Aug 04, 2005 4:59 pm

In the game I'm working on, Key Down 1, 2 and 3 will each fire their own laser cannon. Now I've tried two sound setups, one is where the laser sound is triggered when one of the keys is pressed. The other is when the laser beam actor is created. The Key Down is set to repeat while key is pressed.

Also, whenever a bad guy or falling energy pod is hit by a laser or generally when either of these actors collides with anything, the actor is destroyed and an actor with a fire ball animation is created in it's place and then that actor is destroyed when it reaches the end of it's animation.
Also, an explosion sound is played when the explosion actor is created. The alternative setup is the sound plays when either actor is destroyed.

The problem comes in that when I'm testing the game in Game Mode or running it as an executable, the actors are mostly visible as they ought to be, but the animations and sounds do not play at least 50% of the time they are called.

Is there a limitation as far as how many sounds and animations can play at once?

What can I do to fix this?
Samples of my art can be found at:

http://www.HodgePodgeStudios.com
User avatar
NyahKitty
 
Posts: 65
Joined: Fri Jul 29, 2005 1:28 am
Score: 0 Give a positive score

Postby BeyondtheTech » Thu Aug 04, 2005 6:16 pm

It's a likely possibility that since you have the "Key Down and repeat" feature, it's sending the same sound effect out many times over, flooding the available simultaneous audio channels you have Game Editor configured for. So, when it comes time for an explosion and there's no channels left to play, it won't play.

Under Config > Game Properties > Maximum number of simultaneous sounds...

You can set it to as much as 512, but I will assume it will severely hinder the performance of your game if you don't modify your code to NOT play a sound everytime a key is pressed.

Or, here's another option...

I'm an advocate for global variables and what I like is having a variable(s) for toggling things.

For instance, set up a variable called LaserSound and have it set to 1 when a KeyDown Event is made and set it to 0 when a KeyUp Event is made. Create a timer about the length of the laser sound file and upon its every Timer Event, have it play the sound of the laser IF the LaserSound value is set to 1. Otherwise, don't play anything.

See if that helps.

I'm just curious, is it just a single laser beam that shoots out, or beam "bullets" made up of multiple actors or clones? If its a single laser beam, you could play two sounds, one that initiates the sound, and another than loops a "beaming" sound. And, in the KeyUp Event, you can use the stopSound command to shut it off. It'll sound like it fired up the beam and is continuing the beam until you turn it off. That's just a little play on sound effects.
User avatar
BeyondtheTech
 
Posts: 270
Joined: Wed Mar 30, 2005 6:34 am
Location: Edison, NJ
Score: 4 Give a positive score

Postby NyahKitty » Thu Aug 04, 2005 7:01 pm

Turning off repeat on the key strokes and increasing simultanious sound channels is helping.

Thanks!


P.S. for future reference for beginners, you set # of sound channels in:

-Config
-Game

fun. fun.
Samples of my art can be found at:

http://www.HodgePodgeStudios.com
User avatar
NyahKitty
 
Posts: 65
Joined: Fri Jul 29, 2005 1:28 am
Score: 0 Give a positive score

Postby NyahKitty » Thu Aug 04, 2005 7:44 pm

Aiee!

I'm attempting to redirect the game from the WAV files to the .ogg versions of those files. The file browser does not seem to display the .ogg files in order to select them, is this normal?

What can I do to access file formats other than WAV's?
Samples of my art can be found at:

http://www.HodgePodgeStudios.com
User avatar
NyahKitty
 
Posts: 65
Joined: Fri Jul 29, 2005 1:28 am
Score: 0 Give a positive score

Postby brutalDeluxe » Thu Aug 04, 2005 9:55 pm

User avatar
brutalDeluxe
 
Posts: 43
Joined: Sun Dec 12, 2004 7:43 am
Score: 0 Give a positive score

Postby NyahKitty » Fri Aug 05, 2005 1:40 am

Thank you.

I'm guessing that only one sound file at a time can play as music.
Samples of my art can be found at:

http://www.HodgePodgeStudios.com
User avatar
NyahKitty
 
Posts: 65
Joined: Fri Jul 29, 2005 1:28 am
Score: 0 Give a positive score

Postby makslane » Fri Aug 05, 2005 8:42 pm

NyahKitty wrote:I'm attempting to redirect the game from the WAV files to the .ogg versions of those files. The file browser does not seem to display the .ogg files in order to select them, is this normal?


Due performance issues, You play ogg files only in the Play Music action.
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest