Author Topic: "levels 5" dialog box randomly appears [BUG][PLAYER]  (Read 4374 times)

0 Members and 1 Guest are viewing this topic.

Offline Wafflem

  • Posts: 943
    • View Profile
"levels 5" dialog box randomly appears [BUG][PLAYER]
« on: May 30, 2017, 03:41:49 PM »
Stable player V10.13.18, though it even happens on older versions, as well as exp Player V11.14.19:0F5D7C7

While playing any level, the dialog box with "levels" on top, and the text "5" randomly appears, and hinders me from playing the level. There is also the chance that even when I click OK or the X on the upper right, the dialog box will not go away.
« Last Edit: June 02, 2017, 01:19:33 AM by Wafflem »
YouTube: www.tinyurl.com/YTWafflem
Twitch: www.twitch.tv/Wafflem467

Have level designer's block right now? Have some of my incomplete levels for LOTS of ideas!

Offline namida

  • Administrator
  • Posts: 12399
    • View Profile
    • NeoLemmix Website
Re: "levels 5" dialog box randomly appears [BUG][PLAYER-NF]
« Reply #1 on: May 31, 2017, 02:18:03 AM »
Sounds like this may be a debugging message I forgot to remove.
My Lemmings projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)

Offline Wafflem

  • Posts: 943
    • View Profile
Re: "levels 5" dialog box randomly appears [BUG][PLAYER-NF]
« Reply #2 on: May 31, 2017, 04:19:01 PM »
This issue still occurs in V11.14.19:6cd5881 .
YouTube: www.tinyurl.com/YTWafflem
Twitch: www.twitch.tv/Wafflem467

Have level designer's block right now? Have some of my incomplete levels for LOTS of ideas!

Offline namida

  • Administrator
  • Posts: 12399
    • View Profile
    • NeoLemmix Website
Re: "levels 5" dialog box randomly appears [BUG][PLAYER-NF]
« Reply #3 on: May 31, 2017, 04:21:04 PM »
Yes, I had a quick look but couldn't find any obvious cause, nor have I been able to reproduce it yet. I'll have a harder look next time I'm working on NL.
My Lemmings projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)

Offline Wafflem

  • Posts: 943
    • View Profile
Re: "levels 5" dialog box randomly appears [BUG][PLAYER-NF]
« Reply #4 on: May 31, 2017, 07:03:00 PM »
Okay...I've played some levels on the stable versions of NeoLemmix and that "5" error has started to pop up as well on V10.13.18.  Even when downgrading to the earlier stable NeoLemmix players like V10.13.16-B, this error still happens. I don't know what exactly is causing this.

This dialog box appears whenever these happen:
1. The trapdoor opens
2. A skill is assigned to a lemming
3. A lemming enters the exit
4. A lemming dies in any way (splatting, falling off the screen, etc.)

If it helps, I've also posted a picture of an Access Violation, which appears when clicking on OK at the pass/fail screen.

Might it have to do with my own computer? Nobody else seems to be experiencing the same problem. :-[
« Last Edit: May 31, 2017, 08:39:32 PM by Wafflem »
YouTube: www.tinyurl.com/YTWafflem
Twitch: www.twitch.tv/Wafflem467

Have level designer's block right now? Have some of my incomplete levels for LOTS of ideas!

Offline namida

  • Administrator
  • Posts: 12399
    • View Profile
    • NeoLemmix Website
Re: "levels 5" dialog box randomly appears [BUG][PLAYER-NF]
« Reply #5 on: May 31, 2017, 10:50:51 PM »
Can you post your config INI file please? (And, just to be safe, hotkeys too.)

If you prefer you can PM it, if so, can you send to Nepster as well? (I probably won't be working on NL much for the next few days, so might be good for him to have a copy too.)
My Lemmings projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)

Offline Wafflem

  • Posts: 943
    • View Profile
Re: "levels 5" dialog box randomly appears [BUG][PLAYER-NF]
« Reply #6 on: June 01, 2017, 02:18:08 PM »
Here they are! Note that these are for the stable version (V10.13.18).

I can confirm that this problem appears to be computer-specific; this issue doesn't happen on my laptop, but on one of my other computers (and especially since nobody else appears to have this issue...).
YouTube: www.tinyurl.com/YTWafflem
Twitch: www.twitch.tv/Wafflem467

Have level designer's block right now? Have some of my incomplete levels for LOTS of ideas!

Offline Nepster

  • Posts: 1829
    • View Profile
Re: "levels 5" dialog box randomly appears [BUG][PLAYER-NF]
« Reply #7 on: June 01, 2017, 04:57:57 PM »
Thanks. Could you please disable the sound (i.e. set the sound volume to 0) and check whether the error still occurs?

The only code I found that might produce your error appears in GameSound.pas (line 410). So I suspect that the library handling sound output has problems with some setting on your computer, which would explain why it happens only on one of your computers, and there so frequently.

Offline Wafflem

  • Posts: 943
    • View Profile
Re: "levels 5" dialog box randomly appears [BUG][PLAYER-NF]
« Reply #8 on: June 01, 2017, 07:38:24 PM »
No such error appears when the sound is disabled. It may indeed have to do with the computer I'm using, as the computer does not even have any speakers installed.
YouTube: www.tinyurl.com/YTWafflem
Twitch: www.twitch.tv/Wafflem467

Have level designer's block right now? Have some of my incomplete levels for LOTS of ideas!

Offline Nepster

  • Posts: 1829
    • View Profile
Re: "levels 5" dialog box randomly appears [BUG][PLAYER]
« Reply #9 on: June 01, 2017, 08:34:08 PM »
Ok, great. But then I have to defer to namida to fix this bug, because I have no knowledge about the sound code and could only "fix" it by removing the sound completely on all computers that have this problem-

Offline namida

  • Administrator
  • Posts: 12399
    • View Profile
    • NeoLemmix Website
Re: "levels 5" dialog box randomly appears [BUG][PLAYER]
« Reply #10 on: June 02, 2017, 12:02:36 PM »
Nepster: I'm not likely to be on my PC much for the next few days, could you copy/paste the relevant code here?
My Lemmings projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)

Offline Nepster

  • Posts: 1829
    • View Profile
Re: "levels 5" dialog box randomly appears [BUG][PLAYER]
« Reply #11 on: June 02, 2017, 03:38:29 PM »
Here the method, that I suspect creates the error messages via the ShowMessage call at the end:
Code: [Select]
procedure TSoundManager.PlaySound(aName: String; aBalance: Integer = 0);
var
  SoundIndex: Integer;
  SampleChannel: LongWord;
begin
  if fMuteSound then Exit;
  SoundIndex := FindSoundIndex(aName);

  if SoundIndex = -1 then
    SoundIndex := LoadSoundFromFile(aName);

  if aBalance < -100 then aBalance := -100;
  if aBalance > 100 then aBalance := 100;

  if SoundIndex <> -1 then
  begin
    SampleChannel := BASS_SampleGetChannel(fSoundEffects[SoundIndex].BassSample, true);
    if aBalance <> 0 then
    begin
      if not BASS_ChannelSetAttribute(SampleChannel, BASS_ATTRIB_PAN, (aBalance / 100)) then
        ShowMessage(IntToStr(BASS_ErrorGetCode));
    end;
    BASS_ChannelSetAttribute(SampleChannel, BASS_ATTRIB_VOL, (fSoundVolume / 100));
    BASS_ChannelPlay(SampleChannel, true);
  end;
end;

Offline ccexplore

  • Posts: 5311
    • View Profile
Re: "levels 5" dialog box randomly appears [BUG][PLAYER]
« Reply #12 on: June 02, 2017, 07:04:41 PM »
It looks like it's trying to set the left/right panning balance of a sound channel, and displaying the error code if the operation failed.  I'm pretty sure that it is non-fatal failure, at worst maybe the sound wouldn't sound quite right but shouldn't otherwise be interrupting the game with what looks like leftover debug mechanism.

If there is already an existing mechanism in your codebase to direct debug messages to a log file, I'd strongly recommend changing the ShowMessage to output silently to such debug log file instead.  Otherwise it's probably safe to just remove the ShowMessage() call in the code snippet.

[edit: maybe I speak too soon.  I'm not sure how the access violation mentioned by Wafflem happens, though I'm pretty sure it is not solely dependent on BASS_ChannelSetAttribute(..., BASS_ATTRIB_PAN...) failing.  Most likely there is just some portion of sound code, likely not shown in the snippet above, that implicitly assumes some sound-related operation can always succeed, and then behaves badly when it doesn't succeed, for example due to no speakers/audio output devices installed, and eventually the code did something stupid accordingly that causes the access violation.

Removing ShowMessage() would obviously not do anything about the access violation, but at the same time it's not making things worst either.]
« Last Edit: June 02, 2017, 07:10:50 PM by ccexplore »

Offline namida

  • Administrator
  • Posts: 12399
    • View Profile
    • NeoLemmix Website
Re: "levels 5" dialog box randomly appears [BUG][PLAYER]
« Reply #13 on: June 04, 2017, 10:55:56 AM »
Yes, this is unremoved debug code. The Bass_ChannelSetAttribute needs to be kept, but the if...then around it (not the aBalance one, but the one around the Bass function itself) and the ShowMessage can be removed.
My Lemmings projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)