Att: Fernando, Samples causing lag

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Ok so posting this here to hopefully find a answer to my issue and to help others that might be having the same problem.

    I have created several games now targeted for android that work really good except when it comes to samples, so most of my games have had little to no sound and it does impact the overall feel of the games limiting me to what I can produce.

    The devices I have for testing are Oppo a54, a16, R17, galaxy S9, S10, s21 and a Huawei flip phone.

    The game I am currently playing around with has a very small resolution of 192x255 and each level has less then 600 objects including backdrops (sub 30 actives on most levels, as I am trying to keep it small to fix this issue). The game is supposed to have probably about 10ish samples playing during parts of the level but due to sound issues I have 1 sample playing background music and a jump sound.

    The issue is when the character jumps there is a noticeable lag like the whole game freezes for just a few split seconds including all objects and the sample too. When the sample is removed or disabled in the sound menu there is no issue. The background music makes no difference l, just the samples tied to an action or loop.

    I also have fireworks at the end of the level and the sample for the bangs are fine after the initial first few loops however are delayed or missing to begin with on the loop but I have covered this up with the background music fading a little slower.

    With the jump I have tried a direct action (playing sample on event jump), playing the sample from a flag, from a loop and from dedicated channels. I have tried different formats including wav, ogg and mp3 with no change. I have also talked with very knowledgeable people on discord without success.

    Another reason this is hard for others to help with is the devices I have access to. In windows or an android emulator there is no issue including some of the phones. The main phones that have the issues are the a54, a16, Huawei and s9. It is not as far as I can tell a power/performance issue because it works on less powerful devices and different android versions. Oh I have also tried all 3 versions of OpenGL.

    So to put all that in a lesser term, I am having issues with delayed sounds as well as lag (kinda like fps drop) on a game (and others) that is very basic and simple.

    I am happy to send a MFA via message.

  • thanks for the info, yes, this is a problem which involve the Android OS, and have becoming more problematic with new version, can you please make a small mfa (please remove any external files and proprietary graphics), where this problem can be reproduced and sent it to me

    Regards,


    Fernando Vivolo

    ... new things are coming ...

  • I know another dev which was porting a game to Android which also had this problem, but with multiple samples playing at the same time, in this instance it even happened on my Galaxy S21 Ultra...
    FPS would dip below 10, disabling samples would prevent it... I've tried fixing or working around it in many ways, like having the samples playing in loop and setting position and volume so they are never unloaded, didn't helped.
    I've talked with the OP, and his example didn't cause the same issue on my phone and Windows 11 Android emulator, but he did reproduce it in multiple devices.

  • hey sorry i am not being notified about forum posts anymore... I do not know how to send you the file as I cannot pm you and there is a 1mb limit here. Can you please advise how to send it to you?

  • hey sorry i am not being notified about forum posts anymore... I do not know how to send you the file as I cannot pm you and there is a 1mb limit here. Can you please advise how to send it to you?

    Upload to a cloud service like Google Drive, OneDrive Dropbox or anything similar and PM the link.

    Regards,


    Fernando Vivolo

    ... new things are coming ...

  • Yep, I have been having the exact same issue on my android build over the last several weeks and it's blown my development schedule out of the water - tested a basic background sound loop with a jump action sound when the player jumps. There's a severe drop in FPS to the point where it's unplayable. Tried all sorts of events, conditions, loops and different formats such as ogg and wav to the same unfortunate result too.

    Fingers crossed it gets ironed out in an update soon.

  • Upload to a cloud service like Google Drive, OneDrive Dropbox or anything similar and PM the link.

    I have the link on a cloud but the problem is i cannot PM you like i can others, when i click to PM you it only shows your posting/commenting history. I can definitely understand why it is set up to not directly PM; is there a moderator on Discord I can send the file/link to? I would rather not post my work, even if its not that great....

  • That sounds very clever! So how does one achieve delta time in the Clickteam event editor?


    Hey Gooblammy, as of Fusion, there is no built-in DeltaTime value to use, the closest thing is the Movement Timer, but unfortunately it's internal value is hidden from you and only used for animations and built-in movements (tho apparently an extension can modify and even get the value at runtime)

    But anyways to achieve this you first you have to calculate DeltaTime, the calculation it self doesn't take more than 3 minutes to set up, but the real challenge is applying it correctly in your game
    In the very basics you will just be multiplying the calculated DeltaTime value with the velocity of a custom movement (or say a custom delay buffer/timer..etc), but this is not the end, as you will also encounter a velocity curve problem if you have accelerating forces, and yet another problem is if you don't have continues collision detection for a custom movement, the gap will be really big in low framerates and moving objects might skip obstacles, so you would have to implement step checks, and sometimes you have to NOT multiply DeltaTime with with some forces like instant forces (e.g. jumping in a platformer game)

    It's still not a big hassle tho, and luckily I made this guide before on GameJolt that covers DeltaTime from the basics and how to get around the problems I mentioned above: Please login to see this link.
    But at the end it's REALLY worth it, stuff just feel smoother, if you increase FPS to say 144, displays with 144HZ will utilize all the in between frames, making the game look smoother on higher refresh rate displays (if the game's FPS was the same or higher than the display's refresh rate ofc), and generally your game will feel more professional
    And as an added benefit, slow motion effects will be easier and smoother than ever by just modifying the MS ratio, so DeltaTime is really worth it at the end, but just needs getting used to

    (Edit: So I usually take a long time to write a "big" post, while writing NaitorStudios already replied lol, sorry for duplicated links to the same guide xD)

    Game/App developer, artist and a community contributor.
    You can support my work on: Please login to see this link.

    Edited 3 times, last by Linky (October 2, 2022 at 10:29 PM).

  • Hey Gooblammy, as of Fusion, there is no built-in DeltaTime value to use, the closest thing is the Movement Timer, but unfortunately it's internal value is hidden from you and only used for animations and built-in movements (tho apparently an extension can modify and even get the value at runtime)

    But anyways to achieve this you first you have to calculate DeltaTime, the calculation it self doesn't take more than 3 minutes to set up, but the real challenge is applying it correctly in your game
    In the very basics you will just be multiplying the calculated DeltaTime value with the velocity of a custom movement (or say a custom delay buffer/timer..etc), but this is not the end, as you will also encounter a velocity curve problem if you have accelerating forces, and yet another problem is if you don't have continues collision detection for a custom movement, the gap will be really big in low framerates and moving objects might skip obstacles, so you would have to implement step checks, and sometimes you have to NOT multiply DeltaTime with with some forces like instant forces (e.g. jumping in a platformer game)

    It's still not a big hassle tho, and luckily I made this guide before on GameJolt that covers DeltaTime from the basics and how to get around the problems I mentioned above: Please login to see this link.
    But at the end it's REALLY worth it, stuff just feel smoother, if you increase FPS to say 144, displays with 144HZ will utilize all the in between frames, making the game look smoother on higher refresh rate displays (if the game's FPS was the same or higher than the display's refresh rate ofc), and generally your game will feel more professional
    And as an added benefit, slow motion effects will be easier and smoother than ever by just modifying the MS ratio, so DeltaTime is really worth it at the end, but just needs getting used to

    (Edit: So I usually take a long time to write a "big" post, while writing NaitorStudios already replied lol, sorry for duplicated links to the same guide xD)


    Thanks, Linky and NaitorStudios.

    The articles look really helpful! This is my homework tonight: work on a couple of experiments with DeltaTime.

    I'm quite keen to keep on track to solve the FPS drop when playing audio samples (keeping it to the forum subject) so my aim will be to create an apk extension with DeltaTime I can share here; whether it goes badly or good(ly?).

    Cheers, once again!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!