In-game music

Allegiance discussion not belonging in another forum.
French_Touch
Posts: 154
Joined: Mon Nov 16, 2009 7:56 pm
Location: France -> BC, Canada

Post by French_Touch »

How do you include music in game? Do we need loops? I'm thinking about creating some good music or maybe sound effect while I play. Did somebody do something?

I played around with my DAW and came up with this. I know it's basic, it's just a start, but if some people are interested in a part of it, I can send it to you.
Psychosis
Posts: 4218
Joined: Wed Oct 27, 2004 7:00 am
Location: California

Post by Psychosis »

no in-game music, queue up your own playlist in the background.

It's better without. we would also run afoul of licensing for anything not under GPL
aem
Posts: 1471
Joined: Sat Apr 02, 2005 8:00 am
Location: Charlotte, NC

Post by aem »

I like adding music to the game because you can set different music to play depending on what is going in in game. Simply need to edit musicdef.mdl in the Production/Artwork folder. I haven't done this in years, so I am under the assumption nothing has changed to break this functionality.

I will try this out now and make sure it still works and post a guide since I am not sure there still is one anywhere.
French_Touch
Posts: 154
Joined: Mon Nov 16, 2009 7:56 pm
Location: France -> BC, Canada

Post by French_Touch »

That would be great!

I don't really know how it works. I tried to edit the file, but I've no idea how to do it.
QUOTE use "gamepanes";

gameScreenMusicSound = RedbookSound(mymusic.wav);
flightMusic1ASound = RedbookSound(AllegianceCD, 3);
flightMusic1BSound = RedbookSound(AllegianceCD, 4);
flightMusic1CSound = RedbookSound(AllegianceCD, 5);
deathMusicSound = RedbookSound(AllegianceCD, 6);
flightMusic2ASound = RedbookSound(AllegianceCD, 7);
flightMusic2BSound = RedbookSound(AllegianceCD, 8);
flightMusic2CSound = RedbookSound(AllegianceCD, 9);
flightMusic3ASound = RedbookSound(AllegianceCD,10);
flightMusic3BSound = RedbookSound(AllegianceCD,11);
flightMusic3CSound = RedbookSound(AllegianceCD,12);
gameOverLostMusicSound = RedbookSound(AllegianceCD,13);
gameOverWonMusicSound = RedbookSound(AllegianceCD,14);[/quote]

I changed the first line, I guess it is more complicated than that...
Last edited by French_Touch on Sun Feb 02, 2014 5:00 pm, edited 1 time in total.
aem
Posts: 1471
Joined: Sat Apr 02, 2005 8:00 am
Location: Charlotte, NC

Post by aem »

Its rather simple but that is not how to do it. I ran out of time to put the full guide together, but here is a rough one which should be enough for now.

If you simply want to swap out each music track you would do something like:

gameScreenMusicSound = GainSound(SFXGain, ImportWave("music02"));

The RedbookSound is to pull if off the original game disc. Need to use the GainSound with ImportWave like the above example. Have the wav file in the Production/Artwork folder. I think only wav is supported for music so convert everything to wav format if needed. Don't include the .wav at the end of the file name.


You can also expand the track selection by using RandomSound which will randomly pick a song from a list.

gameScreenMusicSound = GainSound(MusicGain,IntermittentSound(5, false,
RandomSound([
(ImportWave("music_allegiance_madness"),1),
(ImportWave("music_allegiance_theme"),1),
(ImportWave("music_allegiance_tribute"),1),
])
));

Finally, you can play two sounds together if you wanted such as a voice chat to let you know when the situation changes.
ASound is "Clear: No enemy spotted and/or you have not been spotted."
BSound is "Contact: Enemy spotted and/or you have been spotted."
CSound is "Combat: Enemy fires on you and/or you fire on the enemy."

Rest you can figure out based on the name such as deathMusic that plays when you die.

To have a voice chat or whatever sound play along with the music use PairedSound like..

flightMusic1ASound = PairedSound(
GainSound(MusicGain,
RandomSound([
(ImportWave("music_bios_ballad_rev1"),1),
(ImportWave("music_bios_ballad_rev2"),1)
])
),
SerializedSound(MutexSal, 5, 10, true, GainSound(VoiceOverGain, ImportWave("music_vo_sal_sensorscleared")))
);


You can get the full example files along with music tracks at http://www.mesialonline.com/Allegiance/sound/iGmusic.html.
Last edited by aem on Sun Feb 02, 2014 5:27 pm, edited 1 time in total.
French_Touch
Posts: 154
Joined: Mon Nov 16, 2009 7:56 pm
Location: France -> BC, Canada

Post by French_Touch »

Great. For now, I just would like to have some in-game music while I play. I can't make it work yet, but I'll eventually find how to do it.
gameScreenMusicSound = GainSound(SFXGain, ImportWave("music02"));

It didn't work (Music is on).
I put music02.wav in Allegiance/lobbies/production/artwork (there is another directory in lobbies, it's beta/artwork)
aem
Posts: 1471
Joined: Sat Apr 02, 2005 8:00 am
Location: Charlotte, NC

Post by aem »

If you are playing in Beta like others are today you would need both musicdef.mdl and the music files in Beta/Artwork.
French_Touch
Posts: 154
Joined: Mon Nov 16, 2009 7:56 pm
Location: France -> BC, Canada

Post by French_Touch »

So I made a copy of the mdl file of your music pack in Artwork directories, both of them. And I just created 11 copies of a simple wav file named music02-music11. I can't hear anything, but in-game, I don't have sound effects any more. It seems that something is going on, but not exactly what I expected!


QUOTE use "gamepanes";

gameScreenMusicSound = GainSound(SFXGain, ImportWave("music02"));
flightMusic1ASound = GainSound(SFXGain, ImportWave("music03"));
flightMusic1BSound = GainSound(SFXGain, ImportWave("music04"));
flightMusic1CSound = GainSound(SFXGain, ImportWave("music05"));
deathMusicSound = GainSound(SFXGain, ImportWave("music06"));
flightMusic2ASound = GainSound(SFXGain, ImportWave("music07"));
flightMusic2BSound = GainSound(SFXGain, ImportWave("music08"));
flightMusic2CSound = GainSound(SFXGain, ImportWave("music09"));
flightMusic3ASound = GainSound(SFXGain, ImportWave("music10"));
flightMusic3BSound = GainSound(SFXGain, ImportWave("music11"));
flightMusic3CSound = GainSound(SFXGain, ImportWave("music12"));
gameOverLostMusicSound = GainSound(SFXGain, ImportWave("music13"));
gameOverWonMusicSound = GainSound(SFXGain, ImportWave("music14"));[/quote]
Last edited by French_Touch on Sun Feb 02, 2014 6:27 pm, edited 1 time in total.
Imago
Posts: 1440
Joined: Tue Sep 23, 2003 7:00 am
Location: Minneapolis, MN
Contact:

Post by Imago »

nope, nothing has changed to break it. just make sure your allegiance CD is in the drive.
Image

These bugs haven't been fixed yet because don't have any developers interested in fixing them up. --Tigereye
Imago's stupid-sensor is supersensitive. --RealPandemonium
The art is managing the flow of the drama to achieve the desired results. --Big_Beta_Tester
joeld wrote:But we’ve been amazed at the level to which some of the Allegiance fans have remained hard-core.
Imago
Posts: 1440
Joined: Tue Sep 23, 2003 7:00 am
Location: Minneapolis, MN
Contact:

Post by Imago »

i recall having an ISO of (only) the music that i could "mount" .... the name of the disc had to be "AllegianceCD" IIRC
Last edited by Imago on Mon Feb 03, 2014 5:16 am, edited 1 time in total.
Image

These bugs haven't been fixed yet because don't have any developers interested in fixing them up. --Tigereye
Imago's stupid-sensor is supersensitive. --RealPandemonium
The art is managing the flow of the drama to achieve the desired results. --Big_Beta_Tester
joeld wrote:But we’ve been amazed at the level to which some of the Allegiance fans have remained hard-core.
Post Reply