Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support last lap music #1613

Closed
MatthewsSam opened this issue Oct 10, 2014 · 11 comments
Closed

Support last lap music #1613

MatthewsSam opened this issue Oct 10, 2014 · 11 comments
Assignees
Milestone

Comments

@MatthewsSam
Copy link
Member

In next gen track I'm trying to have a last lap music that is more stressful.

Here is the original topic
http://forum.freegamedev.net/viewtopic.php?f=17&t=5872&sid=79a09538475615f54f829425258719c2&start=25

When the last lap is trigged, the alternate soundtrack should be played.

@MatthewsSam MatthewsSam added this to the 0.8.2 milestone Oct 10, 2014
@cap44
Copy link
Contributor

cap44 commented Oct 10, 2014

Wouldn't make sense to speed up the track music by another 20% to tell the player: "Hurry Up! its the deciding lap"?

because, if so, i might create a version of each track song that is sped up to 120%

@hiker
Copy link
Contributor

hiker commented Oct 10, 2014

This is already implemented, each music information file can take a 'fast-filename' and probably also needs fast="true". We tried just playing existing music faster, but it sounded pretty bad ;)

Please reopen if there should be an issue.

@hiker hiker closed this as completed Oct 10, 2014
@cap44
Copy link
Contributor

cap44 commented Oct 10, 2014

how bad?
On 10/11/2014 02:44 AM, hiker [Masked] wrote:

This is already implemented, each music information file can take a 'fast-filename' and probably also needs fast="true". We tried just playing existing music faster, but it sounded pretty bad ;)

Please reopen if there should be an issue.


Reply to this email directly or view it on GitHub:
#1613 (comment)

@MatthewsSam
Copy link
Member Author

after a quick test in cocoa temple I found two issues

  1. Music is trigged by the predicted amount of sec before the end. I rather suggest to associate it with an even like crossing the start line for the last lap

  2. Currently while doing a 3 lap race, instead of playing the fast version the music just stop.

The terminal is flooded with
[warn ] MusicOgg: Music not playing when it should be. Source state: 4116

now for debug purpose instead of putting the fast version I used: cocoa temple normal music for the normal music and for the fast version it's hacienda's soundtrack that is played. So it's easier to debug.

@MatthewsSam MatthewsSam reopened this Dec 10, 2014
@hiker hiker self-assigned this Dec 10, 2014
@hiker
Copy link
Contributor

hiker commented Dec 10, 2014

It works for me. In 3c62047 I've disabled the 'when 30 seconds estimated race time are left), so faster music is switched on immediately when the first kart starts the last lap.

I'll close this ticket now, samuncle please test again (note that I'll undo the switch to hacienda, it's too easy to miss this kind of change, it should never be committed to svn). - and reopen if this should still be an issue.

@hiker hiker closed this as completed Dec 10, 2014
@hiker
Copy link
Contributor

hiker commented Dec 14, 2014

It appears that it kind of works, but causes throttling of sfx messages and music not playing when it is expected to be playing :(

@hiker hiker reopened this Dec 14, 2014
@hiker hiker assigned MatthewsSam and unassigned hiker Feb 5, 2015
@hiker
Copy link
Contributor

hiker commented Feb 5, 2015

@SamUncle can you test again? I did a lot of work, and just fixed a bug in the last lap handling, though I am not sure if this is related to the flooding messages.

@Flakebi
Copy link
Contributor

Flakebi commented Feb 5, 2015

I get only one error:
[error ] SFXManager: SFXOpenAL OpenAL error while positioning: AL_INVALID_NAME
But I'm not sure if the last lap music works now, the music gets louder for a few second after passing the start line but after that the volume is much lower than normally (and I think it's the same music as before, though I don't know if it should be replaced).

@Flakebi
Copy link
Contributor

Flakebi commented Feb 5, 2015

Ok, the previous comment was when I had sounds enabled, with sounds disabled there are more errors:
I get many [warn ] MusicOgg: Music not playing when it should be. Source state: 4116 warnings after some time, the music stops (or lags) until I begin the last lap (in chocolate) and the last lap music is played. The last lap music is played better than with sounds enabled, so it's staying loud, but there are still many lags and after I reached the wooden bridge, it stopped too.

Because the music stops when I reach the bridge, I'm quite sure it has something to do with sound effects as there is one, when you're racing over the wooden bridge. Activating a zipper item doesn't trigger the error, but racing over a zipper in the map does sometimes.
The easiest way to reproduce it, is dropping a bowling ball and driving into it (that should work on every track).

Update: I tried to run stk with asan and music and sounds enabled (before starting stk), but it crashed after showing the first screen.
Asan reported attempting free on address which was not malloc()-ed in thread T19 with this stacktrace:

    #0 0x7fe3d235f51f in __interceptor_free (/usr/lib/libasan.so.1+0x5751f)
    #1 0x7fe3d15e1171 in alDeleteSources (/usr/lib/libopenal.so.1+0x17171)
    #2 0x6f574f in MusicOggStream::release() (/home/sebi/Dokumente/Dateien/Programme/SuperTuxKart/scrolling/cmake_build/bin/supertuxkart+0x6f574f)
    #3 0x6f3d64 in MusicInformation::stopMusic()
    #4 0x6f8737 in SFXManager::mainLoop(void*) (/home/sebi/Dokumente/Dateien/Programme/SuperTuxKart/scrolling/cmake_build/bin/supertuxkart+0x6f8737)

Update 2: With only sounds enabled it crashed after racing a while:

 #2 0x702595 in SFXOpenAL::~SFXOpenAL() (/home/sebi/Dokumente/Dateien/Programme/SuperTuxKart/scrolling/cmake_build/bin/supertuxkart+0x702595)
    #3 0x702710 in SFXOpenAL::~SFXOpenAL() (/home/sebi/Dokumente/Dateien/Programme/SuperTuxKart/scrolling/cmake_build/bin/supertuxkart+0x702710)
    #4 0x6f8a5f in SFXManager::mainLoop(void*) (/home/sebi/Dokumente/Dateien/Programme/SuperTuxKart/scrolling/cmake_build/bin/supertuxkart+0x6f8a5f)

Update 3:
I don't get the asan stacktraces anymore, maybe using asan in gcc was a bad idea...

@MatthewsSam
Copy link
Member Author

with the last version of the master. When I do a race with 3 laps, after the second lap, the music just stop :(

I got
[warn ] MusicOgg: Music not playing when it should be. Source state: 4116

spammed on the terminal

@hiker
Copy link
Contributor

hiker commented Feb 14, 2015

@SamUncle - my understanding is that this is now fixed for you. If not, please reopen.

@hiker hiker closed this as completed Feb 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants