Music, sound and google ads do not load on FIRST time loading the game[Solved - no longer can repro]

0 favourites
  • 9 posts
From the Asset Store
Google Analytics 4 Plugin for Construct 3 enables metrics and analytics for your games easily.
  • Darn issues keep cropping up...

    Whether creating a Debug APK and loading manually to my phone or using a closed release via the play console, on the FIRST start of the game there is no music, no sound and no ads served.

    If you close the app and re-open - everything works as expected.

    There are NO issues when previewing so its hard to debug.

    - Music is in the music folder

    - Sounds are in the sound folder

    - Preload sounds is checked

    - First layout (loader layout) preloads the first Music for the title screen and a banner ad before going to the menu

    - It gets to the menu BUT there is no ad, no music and no sfx (how when it won't go until the preload sounds is complete). I can play the game just fine just no ads, music or sound.

    - Close the app, reopen and immediately after the loader layout is done, the music plays, ad is served and SFX work all as expected and the issue never comes back.

    - Uninstall the app, reinstall the app, issue arises once more.

    I found this - construct.net/en/forum/construct-3/how-do-i-8/sound-doesnt-play-130580 but it does not seem to apply as Ashley states that if you build APK it will not be an issue.

    Any thoughts or pointers on this one good constructors?

  • Did you test it on an iPhone? I know Apple has restrictions on this.

    The user is required to at least touch the screen once before audio is activated.

    Don't know if the same applies to the ads though.

  • I have not. I am only releasing to android app store to start as I don't have any iPhone/Apple devices to test on.

  • Allright, in that case I don't know what could be the problem. Best of luck!

  • Thanks :)

    I have been trying different things and some more strange behavior.

    I moved all my sound loading and ad loading into my loader event sheet so that is the first thing that happens.

    I also read/write to a JSON file that stores what levels the user has unlocked.

    In doing so the game never leaves the loader menu and freezes. If i close it out, and go back in everything works fine, I get sound ads, loaded, etc. just like what happened when it was loaded via the menu except for it would not hang like this :(

    So I guess without some help from the community I am going to start stripping things to their most simplest to see if I can narrow it down to the actual behaviour and can share my c3 file.

  • Sounds like the order of events may be wrong in your project. For example, you are trying to access AJAX.LastData before "AJAX On completed" is triggered, or you are writing and reading to/from local storage at the same time, or something similar. You need to post your project or screenshots of the relevant event sheets.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I think you are right dop2000 but I don't know why the music and ads are affected in APK form only, not preview on android or in my browser.

    I pulled my level loading out of the world map (Loading->Menu->World Map) with no other changes and suddenly the music work.

    This json file has nothing to do with the music that is first played so its very confusing.

    I am going to do the same with my ad logic which was first in the Menu and see if that starts working, if not I will slim down and post my project.

  • Here is a screen shot of the most basic issue with the google ads.

    New project, 1 layout with mobileadvert on it, and this in the on layout start:

    imgur.com/a/DYKbRMl

    I wiped out my app and pub ID in the screenshot.

    • First time I load it and just wait for several minutes - no ads.
    • Close it down and reload - almost instantly - ads.
    • Uninstall/reinstall - I get no ads.

    I added a text box to capture if their is a failure loading and even with no ads being shown the text is not updated that there was a failure.

    Wonder if I should have after loading the layout the first time to reload it again as a workaround...I think I shall try that.

  • Despite not working over the weekend and no changes to my code things started working.

    Even the code snippet I provided below would not work just this morning and now I no longer can reproduce.

    Marking this as solved/unsolved at this point as this intermittent behavior is going to take forever to track down.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)