Dynamic Music in AGS?

Started by ambientcoffeecup, Sat 08/12/2007 18:37:43

Previous topic - Next topic

ambientcoffeecup

FIRST THING: Sorry if this should be a beginners AGS question but I'm not really well versed in AGS and it seems pretty complex to me. Secondly I'm not really looking for anyone to post a step by step tutorial on how to do this, I'm more curious as to whether AGS is capable of doing something like this and how one would go about doing it.

So yeah sorry if there is some really simple solution here and I'm just a douche for not knowing it but I'm more interested in composing music for games than actually knowing how to code them myself so I'm coming at this from a musicians perspective and knowing about this would really help me out with pulling some COOL TUNE stuff.

I've kind of had this idea floating around for a while of using dynamic/evolving music coupled with locational music/ambiance. A lot of games recently just settle for locational music. THIS IS A CASTLE. HAVE CASTLE MUSIC. and I'm not really happy with that. I like it but it's cool to do something a little more interesting for instance what Tobin did with the Chaos Theory soundtrack. It uses separated layers of music that would be triggered. So at all times the basic ambiance/locational music would loop, as an event is triggered a separate layer of music would then be added, perhaps more intense or a battle theme or something and depending on what is happening in game, the music can adapt to that situation. Is AGS capable of playing multiple layers of music at one time and if so is there any way to insure that the music would keep in time with the other layers.

Another question I'd like to bring up is with the way room music works in AGS. You're in one room, music is playing. You move to the next room and then while in the next room, the music from the previous room fades out, there is silence and then the new music fades in. It is kind of distracting and not a very controlled efficient way of handling the music. Is there any way to kind of crossfade the tracks so that one tune fades out as the other fades in at the same time. (This would work really well with the idea coupled above.)

And if the multi-layered music system is impossible (which I am kind of assuming it is, there are too many problems.) Is there any way to seamlessly fade into the next track of a piece of music based on trigger events. For instance instead of multi-layered mp3's or something. There are two completely separate loop files for the tune. ie CASTLE MUSIC REGULAR.mp3 and CASTLE MUSIC INTENSE.mp3. When the trigger event occurs the music seamlessly changes between the two.

So yeah these are really my BIG QUESTIONS and sorry for just not knowing this if it is really simple but if you guys could just let me know if it's possible and what the best way of going about doing it is, that would be pretty stellar thanks.

EDIT: WOW DUMB... I read a few more topics in this forum and I think this would have been better suited for the beginner section :(
There's this thing... Jazz.

BOYD1981

well AGS does have a number of sound channels each with individual volume controls, so you could play a number of looping tracks and have certain events or even player position controlling them.
it's been a while since i did anything with multiple sound channels but one thing to be aware of is that sounds do not loop seamlessly, plus remember if all your sounds are different lengths they're going to end up out of sync, which when you think about it actually will create dynamic music :P
that's the easiest way of doing it that i can think of, although i'm sure there are much better ways of doing it through advanced scripting.

Limey Lizard, Waste Wizard!
01101101011000010110010001100101001000000111100101101111011101010010000001101100011011110110111101101011

Ashen

Would the AGSMuse module be of any use to you? It's meant to simulate at least some of the capabilites of the iMuse system - pretty much the ones you're asking about. I think. I freely admit I haven't got much of a clue what iMuse did, so I could be way off base here - try a forum search for iMuse for some more technical discussions, by people who actually know what they're talking about.

What the iMuse-based threads suggest is that coding a dynamic music system is far from beginner level coding, so this forum would be the place, if AGSMuse or those other threads aren't what you want.
I know what you're thinking ... Don't think that.

ambientcoffeecup

From what I can gather the AGSMuse thing remembers the position of a track, for Instance you leave a map with CASTLE MUSIC.mp3 at the 1 minute 42 mark. It starts the track for the next location at the same time, for instance DESERT MUSIC.mp3 would come in at 1.42.

I guess this could work, making multiple files and changing them so that they always stay in time based on trigger events.
There's this thing... Jazz.

Ashen

#4
Since you're using mp3 audio, and AGS can handle crossfading between digital track internally (but not between midis), starting the 'new' track from the same position as the current one should allow a seemless transition between CASTLE REGULAR and CASTLE INTENSE (as you suggest in the second to last paragraph of the original post).
As I said, I don't really understand the iMuse thing, but I think that's what the module does.

Alternatively, you could use PlaySoundEx to add layers of sound, using different channels. However, I don't know if you're able to sync them to the current background track (actually, I'm pretty sure you can't), so it might not sound so good.
I know what you're thinking ... Don't think that.

ambientcoffeecup

No I think you're right. That Module is exactly what I need.
There's this thing... Jazz.

khnum

that module was written basing on my scripts, but it had some bugs;
I started programming my game again, so if you wait some days, i'll rewrite the script (and ask monkey_05_06 if i can modify his module), and you can use the final version

EDIT: just noticed it is an open module :D

SMF spam blocked by CleanTalk