project-navigation
Personal tools

Author Topic: Music tracks on combat missions  (Read 3530 times)

Alex

  • Guest
Music tracks on combat missions
« on: April 12, 2007, 10:16:48 am »
It seems to me the music on each mission directly relates to the map that is loaded.  

I can see why for some missions a specific music track would be required but then there are "generic" maps that any music track would work on.

For example, an underground cave map might work with a spooky, dark, dripping atmosphere so it wants its own music.  The final map in the game would have its own music.

An aboveground forest would work with any combat sounding music...

We could have 2 groups of music:
1: General music - for any map
2: Specific music - unique to a map (defined during map compile).

This would require a little bit of coding, I've been looking through the code and I think the music is chosen in worldspawn, on this line:

gi.configstring(CS_CDTRACK, va("%i", ent->sounds));

but a simple check ie:

if (strcmp(ent->sounds, "anymusic")
{
     //logic to pick a random "General" music file
     //Option 1: Scan the music resource path, generate an array of all music tracks and pick one at random
     //Option 2: A global resource is defined with a hard-coded array of the general music tracks that can be chosen, this code picks one at random.
}
else
{
     gi.configstring(CS_CDTRACK, va("%i", ent->sounds));
}

Anyway I've only had a quick glance at the code, so forgive me if I'm barking up the wrong tree, but I do believe in principle that some maps would work well if the music changed each time, to add some variety to the game.

edit:

This idea could be expanded upon.  We could have groups of music, ie:
Alien Base
Cave
Forest
City
Generic

With the code selecting a random track from the above groups unless a specific track is asked for.

Anyway it's just an idea, and I know you all have enough work to do, but in principle what do you think of the idea?

Offline Zenerka

  • Sergeant
  • *****
  • Posts: 301
    • View Profile
Music tracks on combat missions
« Reply #1 on: April 12, 2007, 11:35:02 am »
The general idea is very reasonable and I believe that this one could be easily implemented - I will look into it in free time.
Currently we basicaly assign desired ogg file to desired mission - see base/ufos/missions.ufo for more details.
I think we could for example prepare a scriptfile for music files groups and use random tracks from such groups in given missions.

Alex

  • Guest
Music tracks on combat missions
« Reply #2 on: April 12, 2007, 12:21:01 pm »
Thanks for the feedback Zenerka...  If I do get a chance one day I might have a look into it myself...  I am more familiar with C++ but I have had some experience with C on a low level AVR microcontroller - maybe I could translate those skills to UFO:AI?

In the meantime I'll continue to make sound effects.