Page MenuHomeWildfire Games

Fix unused and overused music tracks
ClosedPublic

Authored by elexis on Jul 10 2017, 2:57 AM.

Details

Reviewers
None
Commits
rP19918: Play more music tracks.
Trac Tickets
#4565
Summary

In rP19887, Omri added the new song "Tale of Warriors", but it is not used in the game yet.
It was proposed to add it as a civ independent peacetime track after some time or the first battle passed (probably because the song is somewhat epic and rather fits to a great empire).

When looking at the civ files and music.js, we can see that

(1) two prior tracks are unused too, which is really a loss:

  • Tavern_in_the_Mist.ogg
  • Calm_Before_the_Storm.ogg

(2) The song The_Hellespont.ogg is used 4 times while all other songs are used once to twice.

(3) A handful of civs repeat only two peacetime songs, while most use 3 and brit and gaul have 4, while many songs occur for only one civ.

With the patch applied:

  • Every civ will have at least 3 songs
  • Every song will be used.
  • No song will be used by more than two civs.
Test Plan

To get an overview which civ uses which songs:
cd binaries/data/mods/public/simulation/data/civs/; grep -R File

To determine how many songs are played how often:
binaries/data/mods/public/simulation/data/civs$ clear; grep -r File | cut -d ":" -f 3 | sort | uniq --count | cut -d "," -f 1

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

elexis created this revision.Jul 10 2017, 2:57 AM

It was proposed to add it as a civ independent peacetime track after some time or the first battle passed (probably because the song is somewhat epic and rather fits to a great empire).

So why not add it as a civ independent peacetime track for now?

The song The_Hellespont.ogg is used 4 times while all other songs are used once to twice.

If I'd have to guess I'd say that those 4 civs are what was previously grouped under hele and one of the successors.

(3) A handful of civs repeat only two peacetime songs, while most use 3 and brit and gaul have 4, while many songs occur for only one civ.

So we should most likely add some generic tracks.

One might also want to ask Omri about which tracks might go well with what civ. Also (now having looked at the diff) adding Juno Protect You to cart seems evil.

Vulcan added a subscriber: Vulcan.Jul 10 2017, 3:12 AM
Executing section Default...
Executing section Source...
Executing section JS...
Executing section XML GUI...
Executing section Python...
Executing section Perl...

http://jw:8080/job/phabricator_lint/305/ for more details.

Don't think it's preferable to have one peacetime track being played for every civ while all other tracks are only played for one or two civs. Overusing a track can mean it becomes boring faster than all the other tracks.
If we go down that road of playing tracks for more than one or two civs, the other tracks should become more prominent as well (so that we don't loop the same tracks all 10min).

When looking into the code to see if we can do something fancy in there, the (music.js) file just revealed it's fractal wrongness (whitespace mess, quote mess, sprintf warn mess, old loop formats, unused variables and functions, unusable code, duplicate code, code in common that can only be used in the session, code in the session that should be in there, saving a reference to this for no reason, using a prototype when nowhere otherwise use a prototype in the GUI for no reason, extending the global object for no reason, doing all of that trying to accomplish persistance of the played track while actually not accomplishing that, hardcoding filenames in the middle of the code in different files, trying to provide an interface of an interface and failing to actually accomplish that due to all the prior reasons, sometimes randomizing the playlist, other times not). There are multiple trac tickets and TODOs in the code that are a consequence of this sickness and all of that seem to be fixable by deleting the file, adding a global json file with civ-independent filenames, adding 10 lines of code to what we currently do and more.

Juno must be that roman godess, meh, lets see.

elexis updated this revision to Diff 2881.Jul 10 2017, 3:35 AM

Use Harsh_Lands_Rugged_People.ogg for cart instead of that Juno track

In D732#28863, @elexis wrote:

Don't think it's preferable to have one peacetime track being played for every civ while all other tracks are only played for one or two civs.

Nobody said it should stay the only one, and having the current tracks (and possible additions/modifications) and one new track seems better than just having the current tracks.

Overusing a track can mean it becomes boring faster than all the other tracks.

Tell that to the main menu theme :P

If we go down that road of playing tracks for more than one or two civs, the other tracks should become more prominent as well (so that we don't loop the same tracks all 10min).

We already do, unless you haven't noticed the battle tracks. And we could just request a few generic peace tracks to make it less monotonous.

[music.js rant]

Yeah, and trust me it was worse.

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jw:8080/job/phabricator/1726/ for more details.

Executing section Default...
Executing section Source...
Executing section JS...
Executing section XML GUI...
Executing section Python...
Executing section Perl...

http://jw:8080/job/phabricator_lint/306/ for more details.

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jw:8080/job/phabricator/1727/ for more details.

elexis updated this revision to Diff 2912.Jul 14 2017, 1:54 PM
  • Shuffle tracks as proposed by leper and WhiteTreePaladin at https://wildfiregames.com/forum/index.php?/topic/14510-score-notes-and-links/&page=44.
  • Use Tavern in the Mist (unused), The Road Ahead (previously gaul) and Tale of Warriors (new) as civ-independent peace tracks.
  • Revert any removal of tracks in the previous version of this patch.
  • Actually use the unused tracks.
  • Use the other unused track (Calm_Before_the_Storm.ogg) as a menu track. Play the iber/maur track An_old_Warhorse_goes_to_Pasture.ogg and Roman track Juno_Protect_You.ogg in the menu too for some variety.

Every entry in the context of the diff:

svn diff | grep ogg | cut -d '"' -f 2,4 | cut -d '"' -f 2 | sort | uniq
Ammon-Ra.ogg
An_old_Warhorse_goes_to_Pasture.ogg
Calm_Before_the_Storm.ogg
Celtica.ogg
Celtic_Pride.ogg
Cisalpine_Gaul.ogg
Dried_Tears.ogg
Eastern_Dreams.ogg
Elysian_Fields.ogg
Forging_a_City-State.ogg
Harsh_Lands_Rugged_People.ogg
Harvest_Festival.ogg
Helen_Leaves_Sparta.ogg
Highland_Mist.ogg
Honor_Bound.ogg
In_the_Shadow_of_Olympus.ogg
Juno_Protect_You.ogg
Karmic_Confluence.ogg
Land_between_the_two_Seas.ogg
Mediterranean_Waves.ogg
Peaks_of_Atlas.ogg
Rise_of_Macedon.ogg
Sands_of_Time.ogg
Taiko_2.ogg
Tale_of_Warriors.ogg
Tavern_in_the_Mist.ogg
The_Hellespont.ogg
The_Road_Ahead.ogg
Valley_of_the_Nile.ogg
Water's_Edge.ogg
You_are_Victorious!.ogg

All existing tracks:

binaries/data/mods/public/audio/music$ find | cut -c 3- | sort
Ammon-Ra.ogg
An_old_Warhorse_goes_to_Pasture.ogg
Calm_Before_the_Storm.ogg
Celtica.ogg
Celtic_Pride.ogg
Cisalpine_Gaul.ogg
Dried_Tears.ogg
Eastern_Dreams.ogg
Elysian_Fields.ogg
Forging_a_City-State.ogg
Harsh_Lands_Rugged_People.ogg
Harvest_Festival.ogg
Helen_Leaves_Sparta.ogg
Highland_Mist.ogg
Honor_Bound.ogg
In_the_Shadow_of_Olympus.ogg
Juno_Protect_You.ogg
Karmic_Confluence.ogg
Land_between_the_two_Seas.ogg
Mediterranean_Waves.ogg
Peaks_of_Atlas.ogg
Rise_of_Macedon.ogg
Sands_of_Time.ogg
Taiko_1.ogg
Taiko_2.ogg
Tale_of_Warriors.ogg
Tavern_in_the_Mist.ogg
The_Hellespont.ogg
The_Road_Ahead.ogg
Valley_of_the_Nile.ogg
Victory_Track.ogg
Water's_Edge.ogg
You_are_Victorious!.ogg

How many civs use civ dependent tracks:

1 "Ammon-Ra.ogg"
1 "Helen_Leaves_Sparta.ogg"
1 "Juno_Protect_You.ogg"
1 "Karmic_Confluence.ogg"
2 "An_old_Warhorse_goes_to_Pasture.ogg"
2 "Celtica.ogg"
2 "Celtic_Pride.ogg"
2 "Cisalpine_Gaul.ogg"
2 "Eastern_Dreams.ogg"
2 "Elysian_Fields.ogg"
2 "Forging_a_City-State.ogg"
2 "Harsh_Lands_Rugged_People.ogg"
2 "Harvest_Festival.ogg"
2 "Highland_Mist.ogg"
2 "In_the_Shadow_of_Olympus.ogg"
2 "Mediterranean_Waves.ogg"
2 "Peaks_of_Atlas.ogg"
2 "Rise_of_Macedon.ogg"
2 "Sands_of_Time.ogg"
2 "Valley_of_the_Nile.ogg"
2 "Water's_Edge.ogg"
3 "Land_between_the_two_Seas.ogg"
4 "The_Hellespont.ogg"

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jw:8080/job/phabricator/1748/ for more details.

Executing section Default...
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'type' to undefined.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/common/music.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/common/music.js
| 119| 119| 	this.resetTracks();
| 120| 120| 	for (var music of civMusic)
| 121| 121| 	{
| 122|    |-		var type = undefined;
|    | 122|+		var type;
| 123| 123| 		for (var i in this.MUSIC)
| 124| 124| 		{
| 125| 125| 			if (music.Type == this.MUSIC[i])
Executing section XML GUI...
Executing section Python...
Executing section Perl...

http://jw:8080/job/phabricator_lint/319/ for more details.

In D732#29261, @elexis wrote:

I'd keep Honor Bound as the first track in the menu playlist, apart from that seems ok.

This revision was automatically updated to reflect the committed changes.

Eh, so you're mixing the audio flavor of the civs, instead of keeping them distinct? That's what you're doing, essentially.

Eh, so you're mixing the audio flavor of the civs, instead of keeping them distinct? That's what you're doing, essentially.

A previous upload also proposed make Hellespoint more civ unique by having at most 2 instead of 4 civs play it.

This is how many civs played each track:

1 Ammon-Ra.ogg
1 An_old_Warhorse_goes_to_Pasture.ogg
1 Celtica.ogg
1 Cisalpine_Gaul.ogg
1 Eastern_Dreams.ogg
1 Elysian_Fields.ogg
1 Harsh_Lands_Rugged_People.ogg
1 Harvest_Festival.ogg
1 Helen_Leaves_Sparta.ogg
1 Highland_Mist.ogg
1 Juno_Protect_You.ogg
1 Karmic Confluence.ogg
1 Land_between_the_two_Seas.ogg
1 Mediterranean_Waves.ogg
1 Peaks_of_Atlas.ogg
1 Sands_of_Time.ogg
1 The_Road_Ahead.ogg
1 Valley_of_the_Nile.ogg
2 Celtic_Pride.ogg
2 Forging_a_City-State.ogg
2 In_the_Shadow_of_Olympus.ogg
2 Rise_of_Macedon.ogg
2 Water's_Edge.ogg
4 The_Hellespont.ogg

same after the patch:

1 Ammon-Ra.ogg
1 Helen_Leaves_Sparta.ogg
1 Juno_Protect_You.ogg
1 Karmic_Confluence.ogg
1 Sunrise.ogg
2 An_old_Warhorse_goes_to_Pasture.ogg
2 Celtica.ogg
2 Celtic_Pride.ogg
2 Cisalpine_Gaul.ogg
2 Eastern_Dreams.ogg
2 Elysian_Fields.ogg
2 Forging_a_City-State.ogg
2 Harsh_Lands_Rugged_People.ogg
2 Harvest_Festival.ogg
2 Highland_Mist.ogg
2 In_the_Shadow_of_Olympus.ogg
2 Mediterranean_Waves.ogg
2 Peaks_of_Atlas.ogg
2 Rise_of_Macedon.ogg
2 Sands_of_Time.ogg
2 Valley_of_the_Nile.ogg
2 Water's_Edge.ogg
3 Land_between_the_two_Seas.ogg
4 The_Hellespont.ogg

So agree that making some tracks not unique to a civ anymore can be considered a downside. Maybe I didn't hear the songs often enough to find them unique, so it can be reverted if the others share that feeling.
The intention of playing some unique tracks for two civs is having longer tracklists per civ, so that it's slightly less repetitive.

I'm not fully fond of having civ independent peace tracks when all the others are semi-unique. (that's 12 civs instead of 2 civs playing that track), but it was Omri's intention and that seems fair enough to me and the folks that this was discussed with.

soxi * tells us

Total Duration of 33 files: 01:41:44.34

so the average track duration is 3min.

So if a civ has 3 tracks, the songs will repeat themselves 13 times within two hours.

With the new playlist length of 4 tracks, the required peacetime until the music starts repeating itself is 33% longer and
the playlist repeats itself 10 times within 2 hours.

With the 3 civ-independent tracks that were committed, it's 7 songs per civ and
the playlist repeats itself 5.5 times within two hours. (Still you gonna hear those civ independent tracks every match, especially when observing.)