Cubyz icon indicating copy to clipboard operation
Cubyz copied to clipboard

Song Playlist and Chances System

Open ikabod-kee opened this issue 1 year ago • 12 comments

Instead of biomes having one looping song, reference a .json file that has a collection of music. These playlists can be referenced during events such as biome music, boss music, raid music, etc. Each song in the playlist has a specified chance of playing.

If specified, the chance for a song to play can be set to zero if it's already been played. This resets after each consecutive song or the chance increases based on how many songs are in the playlist.

Optionally, you can choose what song plays after another, called a "sub-song." These could be used as a nuanced way to bridge the different musical styles the game has. Again, optional!

ikabod-kee avatar Sep 26 '24 18:09 ikabod-kee

Instead of simple playlists I would propose a more complex system. I think the main problem with playlists is that you end up looking for a lot of playlists for many different combinations of biome type + day/night + hostility. Additionally it seems more difficult to add new music to an existing biome.

That's why I instead propose a system based on keywords (tell me what you think about this):

Each music track gets a list of keywords associated with it. These keywords could be for example "day", "night", "danger", "building", "grass", "sun", "desert", "water", "cave", ... You can add new keywords in each addon as well.

Each biome also gets a list of keyword + weight (can be negative) pairs associated with it. Music is then selected as follows:

For each music track the biome weight is determined by adding all the biome weights of the keywords that it has together. From the music tracks above a certain threshold (maybe the threshold would be biome specific as well?) a song is chosen randomly, maybe also based on a parametrisable chance.

Some of these keywords can be tied to game functions. For example during the night, all songs that have the "day" keyword, but not the "night" keyword are automatically disabled (unless of course the given biome specifies the day keyword in which case it would always play day music).

Addons could also easily define new keywords, to make sure that their music only plays in certain biomes.

IntegratedQuantum avatar Sep 27 '24 17:09 IntegratedQuantum

(I like this idea)

ikabod-kee avatar Sep 27 '24 17:09 ikabod-kee

So basically tags for biomes?

codemob-dev avatar Aug 18 '25 20:08 codemob-dev

yes (the comment comes from a time before we had tags)

IntegratedQuantum avatar Aug 18 '25 20:08 IntegratedQuantum

If specified, the chance for a song to play can be set to zero if it's already been played. This resets after each consecutive song or the chance increases based on how many songs are in the playlist.

This could be done with a bag randomizer

codemob-dev avatar Aug 25 '25 23:08 codemob-dev

What if we also allow other conditions in the music files? Eg. only play when the Z velocity is above a threshold, which would allow having music for falling.

codemob-dev avatar Aug 25 '25 23:08 codemob-dev

yes, there should be multiple conditions for music to play, not sure about velocity, but a better example would be a danger level.

IntegratedQuantum avatar Aug 26 '25 15:08 IntegratedQuantum

Okay, I spent the last hour making this. It's a concept for an emotion-based sound system. Basically the song selector, called "Moody" will choose a song depending on its mood, the current biome, and miscellaneous tags such as [Night], [Day], [Underwater], etc.

Image

I know it's dumb that I created an entire character to describe how a music selection system should work, but this is the best way I could put it. Please give your opinions!

ikabod-kee avatar Nov 27 '25 01:11 ikabod-kee

By the way, these stats have no effect on gameplay whatsoever. They are only used for selecting music.

ikabod-kee avatar Nov 27 '25 01:11 ikabod-kee

Alright, I think this is a good idea to start. However I think there are some more use-cases we should cover:

  • addons may want to create their own music to play in the base game. So instead of having a per biome music lists, I'd suggest to also use tags for this. Each music piece lists a bunch of tags of biomes that they can be played in (including a .any tag).
  • we may want to have biomes with atypical mood, e.g. the crystal forest should have mood levels closer to an overworld forest. So I'd suggest to allow biomes to specify a base mood level, each mood meter will slowly gravitate towards the base mood level, instead of decaying to 0. (This would also give us a simple system to work with before we have the full dynamic mechanisms, tracking player movement entities and all that)
  • I think the height-based anxiety scale is a bit odd. I think this could be better solved through biome tags/mood levels instead.

IntegratedQuantum avatar Nov 27 '25 15:11 IntegratedQuantum

Sounds good to me :P

ikabod-kee avatar Nov 27 '25 15:11 ikabod-kee

Alright, now that we have the design decision, we should probably implement at least the first prototype of this soon.

IntegratedQuantum avatar Nov 27 '25 16:11 IntegratedQuantum