Opened 7 years ago

Closed 6 years ago

#4677 closed enhancement (fixed)

Add a 8-bit music Easter Egg

Reported by: Itms Owned by: elexis
Priority: Should Have Milestone: Alpha 23
Component: Music & Sound FX Keywords:
Cc: Patch: Phab:D1097

Description

The 8-bit version of Honor Bound is not currently used. It would be nice to play it when a cheat code is entered. The code could be "retro me" or "0.8. Bit" or something even funnier :)

The music can be found here: audio/trunk/music/0_8Bit_Bonus_Track.wav and should be converted to ogg.

Change History (9)

comment:1 by elexis, 6 years ago

Cheats can currently only execute code in the simulation, thus can't access the music code directly.

One way to implement it would be adding executeGUICheat to submitChatInput in gui/session/messages.js. But that would conflict a bit with the fact that all cheats should be contained in a single place.

So I would suggest to add the following code to Cheat.js for the proposed cheat

	cmpGuiInterface.PushNotification({
		"type": "change-music-track",
		"track": "filename"
	});

and an entry in g_NotificationsTypes processing that to access the music prototype.

comment:2 by elexis, 6 years ago

Perhaps a new state in music.js, for instance CUSTOMPLAYLIST might suit to prevent the track to be reset each turn from updateGUIObjects() in session.js. (With that we could perhaps even create a 0ad soundtrack player.)

In the scope of the ticket, perhaps its sufficient to switch to this state and then prevent any further state switches.

This might still start a new song when opening new GUI pages, such as the summary screen or message boxes (like "do you want to delete this unit?"). But that might not really be an issue with an easteregg feature.

comment:3 by Pingvin Betyár, 6 years ago

I tried creating a new state and it doesn't work, because list change mechanism

Music.prototype.setState = function(state)
{
	this.reference.currentState = state;
	this.updateState();
};

Music.prototype.updateState = function()
{
	if (this.currentState != this.oldState)
	{
		this.oldState = this.currentState;

		switch (this.currentState)

If i change the play list to something new eg.: states.RETRO the next turn of updateGUIObjects() will overwrite. Because of this:

this.currentState != this.oldState

Where currentState is 2 and oldSate is 6 for example.

comment:4 by elexis, 6 years ago

That's why I suggested to not switch the state in setState if the state is the new custom one.

comment:5 by elexis, 6 years ago

Keywords: simple removed
Patch: Phab:D1097

comment:6 by elexis, 6 years ago

In r20733:
Allow cheats to pass negative numeric arguments and default parameters for cheat arguments that are strings, refs D1097.

comment:7 by elexis, 6 years ago

Owner: set to elexis
Resolution: fixed
Status: newclosed

In 20734:

Add cheat code to play arbitrary music playlists, by default the 8-bit retro easteregg track from rP19890 (yet to be committed to the public mod).

Fixes #4677.
Differential Revision: https://code.wildfiregames.com/D1097
Patch By: PingvinBetyar

comment:8 by elexis, 6 years ago

Resolution: fixed
Status: closedreopened

Actually let me reopen the ticket so that we don't forget the ogg file.

comment:9 by fabio, 6 years ago

Resolution: fixed
Status: reopenedclosed

In 20751:

Add 8-bit easteregg music track.

Music by Omri Lahav.

Coded with oggenc -q -2 (32kbps) using aoTuV Beta6.03 from the wav in r19890.

Fixes: #4677
Differential Revision: https://code.wildfiregames.com/D1097

Note: See TracTickets for help on using tickets.