----- Original Message ----- From: "Troman" <[EMAIL PROTECTED]>
To: "Development list" <warzone-dev@gna.org>
Sent: Sunday, January 14, 2007 3:48 PM
Subject: Re: [Warzone-dev] Music playlists

On 1/12/07, Troman <[EMAIL PROTECTED]> wrote:
Per, do you want scripts to be able to create/manage playlists or just start
some soundtrack with playBackgroundAudio()?

Now that you mention it, I think we would should have an interface to
some kind of playlist from scripts, not just playBackgroundAudio().

Not sure what exactly you have in mind, but as I see it all we need is an interface between scripts and some wz playlist functionality, and in either
case that should be fairy easy to add the necessary script functions.

Could you have a go at it? If changes to the sound code is required, I
can do those, but I think pretty much everything that would be needed
is there already.

I might take a look at it in the next days.

Troman


I had some musings about the way this should work. Playlist script interface will be most used by scriptors I assume. I see two main occasions when such an interface might be used:

1) when it is time to interrupt any background music that might be played and kick in some moody piece to create atmosphere, like it is usually done in campaigns.

2) when someone wants to attach a custom playlist to his map, the way it is done with Unreal Tournament maps for example.

As for the implementation, looks like wz uses 'tracks' to store songs. Track 2 corresponds to menu, track 1 to the in-game music. We can add a 'user track', which will not be directly accessible by the player from inside the game.

When modder wants his custom playlist to be played when someone is using his map he either loads all songs manually to the user track using scripts, like

playlistAddUserSong("mySong1.ogg");
playlistAddUserSong("mySong2.ogg");

Since this is not the most convenient approach it might be a better idea to load playlist from an external playlist file, which will come with the mod; either using scripts, like:

playlistLoadUserTrack("myPlaylist.wpl");

or we can make wz recognize a pre-defined filename and load it automatically.

In case of a map with custom playlist it is simple, just call something like playlistPlayUserTrack(); from within the scripts (or again we can make wz start playing user track automatically if a map comes with a user playlist) for wz to switch from player playlist to the custom map playlist.

In cases when some music must kick in from time to time depending on some in-game conditions it is a bit more complicated. If user manually adds songs to the user playlist using script functions we might make this function return some handle so that modder can refer to a particular song, since different songs must be played on different occasions selectively, using this handle or we can simply reuse the filename.

When some song must be played call playlistPlayUserSong(song_handle); or playlistPlayUserSong("song_name.ogg");

In such cases it might not even be necessary to add songs to the playlist before playing it, I guess it depends on whatever implementation we will choose.

I'm not sure if we really need an additional 'user track', but it has following advantages: songs defined by player and modder are present at the same time and are kept in separate places. While playing player playlist (sorry for the tongue twister) wz will not accidentally start playing a song which might be reserved for a special occasion by the modder. On startup wz can switch to the 'user track' to play songs defined by modder while still leaving the player ability to switch back to his own playlist.

Comments?

Troman


_______________________________________________
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev

Reply via email to