Jump to content


Photo

Adjust music based on gameplay intensity?


  • Please log in to reply
3 replies to this topic

#1 rabid squirrel

rabid squirrel

    GMC Member

  • New Member
  • 22 posts

Posted 31 July 2012 - 08:10 PM

My friend is making a game and I am helping him with testing, debugging, and sound/music. It's an arcade space shooter.

He has this idea that I think is really cool, which is to adjust the music based on the in game intensity (controlled by a variable that would be affected by the enemies on screen, the powerups you currently have, the health you have left, how far along you are in the game, etc.)

We started talking about this and maybe we could have every 8 measures exactly timed out to 10 seconds, and choose an 8-measure segment every 10 seconds based on the intensity. The song would be maybe more like a 32 or 64 measure loop, but each eight measures of it could have several versions.

Possible issues - lag, file size, transitions.

Overall song will probably sound something like this: http://www.youtube.c...0LqmOF4#t=0m45s

Thoughts? advice? anyone done anything like this before, or attempted to? What filetype of music should we use? Anyone want to jump on this project and try making some music for us?
  • 0

#2 kburkhart84

kburkhart84

    GMC Member

  • GMC Member
  • 1618 posts
  • Version:GM:Studio

Posted 01 August 2012 - 03:47 AM

I don't think this is possible with the current version of gamemaker because it can only have one music track going at a time(since it uses the OS's mp3 playing ability). If you used an extension/dll that uses something else, like fmod or bass, you could do this, in fact pretty well. I think that some of them include functions for synching music up, and even if they don't, you can somewhat do it yourself in some of them by loading the music paused(so it is already in memory ready) and then starting them all at once. But you have only one with volume and the others with none, and you can crossfade them that way either little by little, or instantly if you want to.

I'm understanding that atleast for GMStudio the sound system is getting upgraded to work better, and likely those improvements will get put into GMNext, but not likely in GM8.1, so you may want to keep that in mind, though I'm not sure if even the new improvements will include it. I think I'm going to ask the question on the GMStudio roadmap, and maybe a dev can confirm.
  • 0

#3 Pixel8ed72

Pixel8ed72

    Musical Brony

  • GMC Member
  • 408 posts
  • Version:Unknown

Posted 01 August 2012 - 06:34 AM

If you had four songs;
Easy, Medium, Hard and Impossible, I'll name them.
You could use a variable to define the song, and check freuwnelty if it's still playing, and if it isn't, define how hard the game currently is, and play the track fitting to it.
I'm actually using a similar system in a game I'm making now, but different to yours.
:)

Here's what I used in the step event, and it worked:
var song, state;
song = sound_play(state);
state = Easy;

if !sound_isplaying(song)
sound_play(song);

if instance_number(enemyname) <= 10
{
state = Easy
};

if instance_number(enemyname) >= 10 && instance_number(enemyname) <= 20
{
state = Medium
};
//This is repeated until checking if they are less than 40

It is extremely rough, but it does what I want.
With tweaking, you and your friend could make it do what you want.
:)

I'm sure someone would have a better way to do it.
:P
Oh well.
:)
  • 0

#4 rabid squirrel

rabid squirrel

    GMC Member

  • New Member
  • 22 posts

Posted 09 August 2012 - 11:18 PM

I don't think this is possible with the current version of gamemaker because it can only have one music track going at a time(since it uses the OS's mp3 playing ability). If you used an extension/dll that uses something else, like fmod or bass, you could do this, in fact pretty well. I think that some of them include functions for synching music up, and even if they don't, you can somewhat do it yourself in some of them by loading the music paused(so it is already in memory ready) and then starting them all at once. But you have only one with volume and the others with none, and you can crossfade them that way either little by little, or instantly if you want to.

I'm understanding that atleast for GMStudio the sound system is getting upgraded to work better, and likely those improvements will get put into GMNext, but not likely in GM8.1, so you may want to keep that in mind, though I'm not sure if even the new improvements will include it. I think I'm going to ask the question on the GMStudio roadmap, and maybe a dev can confirm.

Thanks for this post and sorry for the late response

Is there a good *simple* sound .gex that would allow for these capabilities? I seem to able to find some, but with gazillions of features I can't understand and don't need.

Edited by rabid squirrel, 09 August 2012 - 11:18 PM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users