Jibble

Author Topic: Unusual background Music issue - bug???  (Read 1908 times)

Unusual background Music issue - bug???
« on: 04 Oct 2018, 20:18 »
I'm not sure if this is some kind of bug, or something I've messed up somehow myself. I'm using [AGS Editor .NET (Build 3.4.1.13)
v3.4.1, May 2018].

When I'm playing or testing my game, sometimes at the end of a dialogue segment a piece of background music will inexplicably begin to play underneath the background music which I've already set to have playing during the scene. It seems to always happen during dialogue segments, and it is not always consistent. It doesn't happen in every dialogue, only sometimes.

There's nowhere in my scripting that I can find which would result in two different conflicting background music pieces being called to play over each other during the dialogue.

I have tried searching the forums, but it seems like such an unusual problem, that I haven't been able to narrow down any keyword searches which were brought up somewhere in the past.

I don't know if this is something simple I've overlooked, or if its some kind of unusual bug in the engine that's causing this behavior. Does anyone have any ideas of what could be causing such a thing, or any leads that I can try to investigate to solve it? :confused:


Re: Unusual background Music issue - bug???
« Reply #1 on: 04 Oct 2018, 20:59 »
I think it will help people to work out your problem if they can see your code, and how it is used to play background music, and where this code is, for instance - after fade in.

The song that plays over the other music, is it the same file being played or a different song?

Re: Unusual background Music issue - bug???
« Reply #2 on: 05 Oct 2018, 13:25 »
It is a different song that plays underneath the music already playing.

The only solution I have found seems to create an entirely new dialogue segment. Then it seems to go away, but I think it will occur again in a different dialogue as it has done in the past.

As a test, I eliminated the background music in the room and dialogue segment and played it. And during the dialogue, the phantom background music still played even thoughthere is nothing in the script to call for any kind of sound or music.

Re: Unusual background Music issue - bug???
« Reply #3 on: 05 Oct 2018, 16:31 »
Could you have told it to play music in the global script?

And again, if you could copy and paste any of your code, like in one of the dialogs that randomly plays music, it would certainly go a long way in identifying the problem.
« Last Edit: 05 Oct 2018, 16:37 by ManicMatt »

Gurok

  • Rottwheelers
  • When life hands you lemons, combine them with the mop
    • I can help with AGS tutoring
    • Best Innovation Award Winner 2016, for improving and extending the AGS scripting language
    • I can help with proof reading
    • I can help with scripting
    • Gurok worked on a game that won an AGS Award!
    •  
    • Gurok worked on a game that was nominated for an AGS Award!
Re: Unusual background Music issue - bug???
« Reply #4 on: 06 Oct 2018, 00:36 »
If you're using Sierra-style speech with portraits, check to see if any of your speech views have no frames.

Re: Unusual background Music issue - bug???
« Reply #5 on: 07 Oct 2018, 00:09 »
I can't find anything in the global script that calls up music, and I checked to see if portraits were missing any frames and they all appear intact.

In the past I have fixed this issue by creating a new dialogue segment, and it went away for awhile, but then the phantom music seems to occur in the dialogue of another character in the game - like it jumps from one dialogue to infect another.

It has happened even at times when I have NO scripted music playing in either the room, or the dialogue segments between characters. So even though two characters are in a room where there is no music being called to play in either the rooms scripting, or the dialogue's scripting, the phantom music will play in the background. So I cannot identify an error by looking at the code, or posting it, since there is no music scripting at all in it. It's seems its something that's happening underneath everything else, hidden from plain view.

I cannot find anything about it as far as others troubleshooting a similar issue with their game, so I'm assuming it's a weird bug I've somehow stumbled upon.

I guess it is possible there could be some weird error I made without knowing about it in the global script or something, but right now I'm at a loss of where to look or what it could possibly be.
« Last Edit: 07 Oct 2018, 00:11 by cdavenport »

Privateer Puddin'

  • Mittens Knight
  • bob
Re: Unusual background Music issue - bug???
« Reply #6 on: 07 Oct 2018, 00:16 »
Do your dialogs run any animations? Could you have a sound tied to a view frame?

Re: Unusual background Music issue - bug???
« Reply #7 on: 13 Oct 2018, 00:45 »

Was playing playing Unavowed and the phantom music sounded like it was going on in that game too, I could distinctly hear what sounded like two different background music songs playing over one another during a section of the game, but its too unpredictable to reproduce. At least I know its not just my game or something I did seems to be something in AGS.

Re: Unusual background Music issue - bug???
« Reply #8 on: 13 Oct 2018, 01:58 »
That may be a silly question to ask, but I did not notice if this was asked anywhere above and want to confirm this to eliminate any chance of misunderstanding: is this "phantom" music actually a music clip from your game?
If yes, is it always the same clip?
How easy it is to reproduce this problem in your game? Have you tried giving your game to other people to test out to see if they get same error?
« Last Edit: 13 Oct 2018, 02:03 by Crimson Wizard »

Re: Unusual background Music issue - bug???
« Reply #9 on: 13 Oct 2018, 07:50 »
that sounds like you're running the game twice?

Re: Unusual background Music issue - bug???
« Reply #10 on: 13 Oct 2018, 11:04 »
that sounds like you're running the game twice?

By default AGS pauses on background, so unless multitasking mode was enabled deliberately by game creator they should not run in parallel.

Re: Unusual background Music issue - bug???
« Reply #11 on: 13 Oct 2018, 14:52 »
Just thought I'd throw that out there.

Would it also be useful perhaps if they game captured or even filmed what happens to show us?

Just to clarify also, what OS are you using?

Re: Unusual background Music issue - bug???
« Reply #12 on: 14 Oct 2018, 15:59 »
That may be a silly question to ask, but I did not notice if this was asked anywhere above and want to confirm this to eliminate any chance of misunderstanding: is this "phantom" music actually a music clip from your game?
If yes, is it always the same clip?
How easy it is to reproduce this problem in your game? Have you tried giving your game to other people to test out to see if they get same error?

Apologies for slow reply but I don't have reliable access to Internet at this time.

Yes, music is a clip from my game, and it is always same clip. It happened again when I was troubleshooting it last night.

The only fix I've found is to create a new dialog, to replace the one with where the music track plays when it's not supposed to. That seems to work, however it may occur again I won't know until all the dialogue sequences are finished and tested.

It *may* have something to do with when I use "player:" in the dialogue instead of using the characters name (e.g. "cEgo:") but I can't be certain.

Right now it's not feasible for me to send the game to other players to test, I was hoping somebody might have had this same issue but apparently not. If I can't figure out what it is I'll have to try and troubleshoot it later.

I can say it sounded like it was happening while I was playing Unavowed, I was in the section outside the police station talking to Donny, I could hear the ambient sounds, the musical track that was playing in the room, and then all of a sudden underneath those another musical fanfare started playing over and over again (just as what happens in my game) beneath the other tracks, while I was in the middle of a dialogue. It happened more than once but again I cannot predict exactly when and where it will occur.

All I can say is it doesn't happen with any other games I play, so I'm assuming its something in that version of AGS.






Re: Unusual background Music issue - bug???
« Reply #13 on: 14 Oct 2018, 16:02 »
Yes, music is a clip from my game, and it is always same clip. It happened again when I was troubleshooting it last night.

The only fix I've found is to create a new dialog, to replace the one with where the music track plays when it's not supposed to. That seems to work, however it may occur again I won't know until all the dialogue sequences are finished and tested.

Are you using voice-over notations in the dialogs? Can it be that you put music clip in Speech folder and forgot about it?


It *may* have something to do with when I use "player:" in the dialogue instead of using the characters name (e.g. "cEgo:") but I can't be certain.

Right now it's not feasible for me to send the game to other players to test, I was hoping somebody might have had this same issue but apparently not. If I can't figure out what it is I'll have to try and troubleshoot it later.

If this happens again and will reproduce steadily, could you at least post particular dialog script?, because it's hard to guess the problem without having more details.


I can say it sounded like it was happening while I was playing Unavowed, I was in the section outside the police station talking to Donny, I could hear the ambient sounds, the musical track that was playing in the room, and then all of a sudden underneath those another musical fanfare started playing over and over again (just as what happens in my game) beneath the other tracks, while I was in the middle of a dialogue. It happened more than once but again I cannot predict exactly when and where it will occur.

Have you tried reporting this to Dave Gilbert? He might be able to find out something about this problem too.
« Last Edit: 14 Oct 2018, 16:30 by Crimson Wizard »

Snarky

  • Global Moderator
  • Private Insultant
    • I can help with proof reading
    • I can help with translating
Re: Unusual background Music issue - bug???
« Reply #14 on: 14 Oct 2018, 18:39 »
A sound randomly/continuously playing when you're not calling any audio functions, I'd say 99 times out of 100 are (as Privateer Puddin' says) because you've got an audio clip linked to an animation frame somewhere. One way to test that is to run this snippet (which removes linked audio from all frames in all loops in all views) and seeing if the problem disappears:

Spoiler: ShowHide
Code: Adventure Game Studio
  1.   for(int i=1; i<=Game.ViewCount; i++)
  2.   {
  3.     int loopCount = Game.GetLoopCountForView(i);
  4.     for(int j=0; j<loopCount; j++)
  5.     {
  6.       int frameCount = Game.GetFrameCountForLoop(i, j);
  7.       for(int k=0; k<frameCount; k++)
  8.       {
  9.         ViewFrame* viewFrame = Game.GetViewFrame(i, j, k);
  10.         viewFrame.LinkedAudio = null;
  11.       }
  12.     }
  13.   }

Some other details that might be useful to understand the problem:

-Once the error occurs in one place, is it consistent? (It always appears in that place until you change something in the script)
-Does the wrong clip play on a continuous loop? Does it play all the way through or is it interrupted before finishing? And if interrupted, is it always at the same place, or does it vary?
-How have you got your AudioTypes/AudioChannels set up? (How many channels assigned to each audio type)
-What are the AudioTypes of the clips that are playing?

You could also use the code here to take a look at what's happening with the audio as it's happening.

Monsieur OUXX

  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
Re: Unusual background Music issue - bug???
« Reply #15 on: 15 Oct 2018, 11:42 »
Isn't there an option in the Editor to attach a music to a room?
If yes, then there would be the automated room music, set with the editor, and another music that cdavenport plays manually, as the actual intended music.
 

Re: Unusual background Music issue - bug???
« Reply #16 on: 15 Oct 2018, 14:19 »
Isn't there an option in the Editor to attach a music to a room?
There is no such option.

Re: Unusual background Music issue - bug???
« Reply #17 on: 15 Oct 2018, 14:48 »
Isn't there an option in the Editor to attach a music to a room?
There is no such option.

This option existed before version 3.2, where this and few other room options were deprecated in favor of scripting. It still exists internally for importing old projects but not displayed on Editor UI.

Re: Unusual background Music issue - bug???
« Reply #18 on: 15 Oct 2018, 14:55 »
Does it get its own dedicated audio channel?

Re: Unusual background Music issue - bug???
« Reply #19 on: 15 Oct 2018, 15:07 »
Does it get its own dedicated audio channel?

No, this property has no control over channels and such, it is simply converted into "aSomeMusic.Play();" command in the "On Room Load" script.

The reason I doubt this is related to current problem is that cdavenport mentioned "phantom music" starts playing at certain point in the dialog, not at the room start, and secondly, if this was the project imported from before AGS 3.2, there would be a noticable script command.
« Last Edit: 15 Oct 2018, 15:18 by Crimson Wizard »