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

[Hexen] Wrong music plays after finishing game early and letting demo play #363

Open
1 task done
hfc2x opened this issue Jul 28, 2022 · 6 comments
Open
1 task done
Labels
Audio Issues related to sound and music system bug Hexen

Comments

@hfc2x
Copy link

hfc2x commented Jul 28, 2022

International Doom version

International Hexen ba73803

What Operating System are you using?

Linux

What Build variant of International Doom are you using?

x64 (x86_64, win64, amd64)

Please describe your specific OS version

Manjaro Linux

Relevant hardware info

No response

Have you checked that no other similar issue already exists?

  • I have searched and not found similar issues.

A clear and concise description of what the bug is.

Hello there.

I've just discovered a bug that I'm pretty sure exists in vanilla Hexen to some extent. If, when playing Hexen, you stop your game session early soon after starting, and you let the demo play, it will play the wrong song during the demo (the track "Chess"). Starting a new game before the first demo ends will also play the wrong song in Winnowing Hall as well.

This bug exists in vanilla DOS Hexen as well. However, trying to trigger it will cause "Chess" to play for 1 frame, after which the game corrects itself. Inter Hexen doesn't correct itself and instead keeps playing the wrong song.

Steps to reproduce the behaviour.

Explain how to reproduce

  1. Start a new game in base Hexen (HEXEN.WAD)
  2. Once you're in Winnowing Hall, press F7 to end game early
  3. At title screen, wait for DEMO1 to play, and it will play with the wrong music. Starting a new game will also play the wrong music at game start.

Your configuration

No response

Provide a Log

No response

@hfc2x hfc2x added the bug label Jul 28, 2022
@JNechaevsky
Copy link
Contributor

Thank you! I have caught this before, but was absolutely sure it's a port bug, not a vanilla bug, and wasn't sure how to fix it. ☹️I'll try to investigate.

@hfc2x
Copy link
Author

hfc2x commented Jul 28, 2022

I have no idea how it works, but I have a guess of sorts.. I think vanilla Hexen initializes the level music twice, during the new game initialization, and then once the game has started. I imagine that's why Heretic and Hexen don't have the screen melt effect Doom does, or the bug would be really noticeable, since the wrong music would play during the screen wipe and stop once it's finished.

Of course, I could be completely wrong.

All I understand (I think) is that "Chess" plays because it's the last song defined in the SNDINFO lump and I think this piece of code in vanilla Hexen's p_setup.c has something to do with it:

void InitMapMusicInfo(void)
{
	int i;

	for (i=0; i<99; i++)
	{
		strcpy(MapInfo[i].songLump, DEFAULT_SONG_LUMP);
	}
	MapCount = 98;
}

I'm not sure what's going on, but vanilla Hexen definitely does something to reinitialize the track on level start. I started reading the Hexen source code just now lol.

@JNechaevsky
Copy link
Contributor

Should be fixed via JNechaevsky/international-doom@0acecef, @hfc2x please check on your side.

I've also removed "chess" music calling while level loading. It's simply not relevant nowadays, most of vanilla levels loaded in about ~10 ms. on first load and in about ~3-4 ms. on re-load (save game or init). And it will be even faster after composite textures will be generated at program startup, not while level loading (link, not applied to Hexen yet).

Have to run to day job!

@hfc2x
Copy link
Author

hfc2x commented Jul 29, 2022

The "chess" track playing is fixed, but this added another bug: the title music doesn't play anymore when you end the game. It simply keeps playing the level music.

@JNechaevsky
Copy link
Contributor

That's odd, it's playing on my side. Is your scenario is still same, i.e.:

  • Start new game or load saved game.
  • End game.
  • Title music is (not) playing?

@hfc2x
Copy link
Author

hfc2x commented Aug 4, 2022

Correct. I do this:

  1. Open Inter Hexen
  2. Start a new game with any character or load a saved game
  3. Once I'm in the game, I hit F7 to end the game session
  4. Back in the title screen, the music of the level keeps playing, instead of starting the "Hexen" music track.

I'm using FluidSynth for MIDI, by the way. I tried the most recent commit as well, but the same thing happens.

@Dasperal Dasperal added Hexen Audio Issues related to sound and music system labels Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Audio Issues related to sound and music system bug Hexen
Development

No branches or pull requests

3 participants