Music Plays Before Scene is Loaded

I've noticed that before a scene completely loads up, the background music begins to play. This is a bit of a problem for me as I have some scenes that have objects that go ALONG with the music, and if the music plays BEFORE the scene loads instead of after, it messes it up a bit (a lot). Does anyone know what could possibly be the issue? I think it may have been because my actors don't have preload art set up so some of their behaviors have been loaded (such as playing music) before their graphics and the rest of the scene has been loaded. But I set all of the actors in a scene (just that scene) to preload art, and I still get the same problem. Does anyone know what's causing this?

Having trouble with your game? Sounds like a personal problem.

Best Answer

  • mataruamatarua Auckland, New ZealandPosts: 854
    Accepted Answer
    I also have this issue - it's very apparent on older devices - But it's my launch sequence and the timers and launch all go in time - the scene just does not show it so well at the start. I would say it comes down to what is loaded into memory fastest perhaps?

    Code and sounds are small - but graphics are many and sometimes large.

    With preload images off - you will get a quicker scene change but may have these issues.

    Just an idea :) Cheers, M@

Answers

  • ADSentertainmentADSentertainment Member Posts: 397
    Don't mean to sound impatient, but is anyone gonna answer my question?

    Having trouble with your game? Sounds like a personal problem.

  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    try working with timers, they may start when the scene is loaded. I have not done any specific work with them though
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598

    @ADSentertainment

    Hi, another thing to try: assuming you've got your Play Music Behaviour in its own actor, try putting it in one of the graphics actor's rules. Can't guarantee it, but maybe the rule will only kick in after the graphics data has loaded into RAM. Worth a shot...

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • ADSentertainmentADSentertainment Member Posts: 397

    @ADSentertainment

    Hi, another thing to try: assuming you've got your Play Music Behaviour in its own actor, try putting it in one of the graphics actor's rules. Can't guarantee it, but maybe the rule will only kick in after the graphics data has loaded into RAM. Worth a shot...
    I do have that for some of them, not all, but I still have the same problem.

    Having trouble with your game? Sounds like a personal problem.

  • ADSentertainmentADSentertainment Member Posts: 397
    try working with timers, they may start when the scene is loaded. I have not done any specific work with them though
    Should I do something like "after 0.01 seconds" since that wouldn't be very noticeable?

    Having trouble with your game? Sounds like a personal problem.

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited August 2013

    @ADSentertainment

    Hi, another thing to try: assuming you've got your Play Music Behaviour in its own actor, try putting it in one of the graphics actor's rules. Can't guarantee it, but maybe the rule will only kick in after the graphics data has loaded into RAM. Worth a shot...
    I do have that for some of them, not all, but I still have the same problem.
    OK, it was worth a try... it seems that audio is loaded first then, wherever it is in the Rules, I'm guessing...

    Your question to Jon, I'm sure he won't mind me answering: a delay of 0.01 is so short, you'll still have the same problem... count how many seconds it takes for your scene to completely load, then use that as your delay in your Timer...

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • ADSentertainmentADSentertainment Member Posts: 397

    @ADSentertainment

    Hi, another thing to try: assuming you've got your Play Music Behaviour in its own actor, try putting it in one of the graphics actor's rules. Can't guarantee it, but maybe the rule will only kick in after the graphics data has loaded into RAM. Worth a shot...
    I do have that for some of them, not all, but I still have the same problem.
    OK, it was worth a try... it seems that audio is loaded first then, wherever it is in the Rules, I'm guessing...

    Your question to Jon, I'm sure he won't mind me answering: a delay of 0.01 is so short, you'll still have the same problem... count how many seconds it takes for your scene to completely load, then use that as your delay in your Timer...
    Chances are that the times it takes for the scene to load will vary, so one time can't really fix it.

    Having trouble with your game? Sounds like a personal problem.

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited September 2013

    True, but better than not giving any delay at all... unless someone else can come up with a watertight solution for you I'm sure it's better than nothing.

    A small help with the delay would be to uncheck Moveable for those actors that don't. Another idea, if any of the actors are spawned, try putting the Play Music in one of those...

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • ADSentertainmentADSentertainment Member Posts: 397

    True, but better than not giving any delay at all... unless someone else can come up with a watertight solution for you I'm sure it's better than nothing.

    A small help with the delay would be to uncheck Moveable for those actors that don't. Another idea, if any of the actors are spawned, try putting the Play Music in one of those...
    That'd be a good idea, I could possibly have the music player be spawned. As that's after that's everything's loaded (Right?)

    Having trouble with your game? Sounds like a personal problem.

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited September 2013

    Well, this is if a spawned actor is one of the last actors to be put into the RAM... I don't actually know to be honest, just hoping it might be, then it'd solve your problem for you... so perhaps give it a whirl and see what goes...

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • ADSentertainmentADSentertainment Member Posts: 397

    Well, this is if a spawned actor is one of the last actors to be put into the RAM... I don't actually know to be honest, just hoping it might be, then it'd solve your problem for you... so perhaps give it a whirl and see what goes...
    Tried it, didn't work :-/ I think I'm gonna turn preload art back on for all of the actors, I had these issues when I turned preload off.

    Having trouble with your game? Sounds like a personal problem.

  • KevinCrossKevinCross London, UKMember Posts: 1,894
    edited September 2013
    From what I've noticed actors are spawned in the order they are in the layers window so if you want an actor to spawn last put it at the top of the list in the layers panel. Try that with a timer attached to it too
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    From what I've noticed actors are spawned in the order they are in the layers window so if you want an actor to spawn last put it at the top of the list in the layers panel. Try that with a timer attached to it too
    D'oh!! Spot-on comment, Kevin. :-) Fingers crossed that'll fix @ADSentertainment's prob if he doesn't change pre-load settings again.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • ADSentertainmentADSentertainment Member Posts: 397
    From what I've noticed actors are spawned in the order they are in the layers window so if you want an actor to spawn last put it at the top of the list in the layers panel. Try that with a timer attached to it too
    Nope :-| Still nothing. I'm just gonna change the preload settings. I can probably fix the long loading time by other means, the file sizes for the images on the actors are rather large. I can compress them more. It'd probably take a huge weight of space off the project alltogether, too.

    Having trouble with your game? Sounds like a personal problem.

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited September 2013

    OK, sorry I couldn't be more help. Hope your solution now does the trick, or at least improves the situation.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • ADSentertainmentADSentertainment Member Posts: 397

    OK, sorry I couldn't be more help. Hope your solution now does the trick, or at least improves the situation.
    No worries! I appreciate the effort! :)

    Having trouble with your game? Sounds like a personal problem.

  • ADSentertainmentADSentertainment Member Posts: 397
    @gyroscope

    Great news! I got it working. I deleted a bunch of unused images from my game, and now the music is usually fine. I also got rid of about 1/3 of the file size (90 MB to 59.8 MB)

    Having trouble with your game? Sounds like a personal problem.

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598

    Excellent to hear, @ADSentertainment, I'm pleased for you. Good work, I say. :-)

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

Sign In or Register to comment.