AUDIO in Construct 3 - Do we have these features? + How to use them?

  • Hey All,

    As I'm working on my game, I've decided it's time to insert some Sound Effects and Music soon to get the "VIBE" of my game as I'm working on it, it is very weird when it's all silence.

    I was wondering about few things related to Audio in Construct 3:

    1 - Can I control the Location of the sound like in many other game engines? if the character is going to the RIGHT of the screen the sounds related to the character will PAN to the RIGHT as I want?

    or we don't have this feature?

    2 - Built-in Compressor or Limiter:

    As more and more Sound Effects overlapping each other at the same time + Music, it's natural that the music will pass the 0db limits to something that may sound unprofessional distorted and also, not recommended in any media.

    Do we have a built-in Limiter to STOP all AUDIO output to maximize it to -0.2db for example?

    what about a compressor to control the attack and release ratio?

    I'm aware it is not a professional music software, as I'm coming from this background but I'm curious about these features and how can I use them to make my game safe and more professional in the Audio department.

    I'll probably have more Audio questions later on, as I'm just starting to play with it now for the first time, but for now, I'll be happy to know about these 2 important features and how can I control them from the event sheet or properties?

    Thanks ahead and sorry about my bad English.

  • for 1 use play audio at object position to get that pan movement of sound

    for 2 about the effects check this tutorial

    additionally on 1 you might want to code the volume if player is at a surtain distance from a object to lower the source of the specific audio by comparing the distance between the player x y and object audio source x y.

  • Thank you for the fast reply I appreciate it!

    I will check it out and do some tests soon. :)

    If I'll have more questions related to Audio, I'll update here.

  • So the first issue I'm having is when my Player Hits more than 1 crate at the same time:

    The volume is Xdb + Xdb for each Crate, it sounds too loud for sure.

    But when hitting just one crate it sounds perfect.

    How can I make it so it will only play 1 "Crate_Hit" SFX a time, instead of all damaged crates at once?

    Thanks ahead!

  • So the first issue I'm having is when my Player Hits more than 1 crate at the same time:

    The volume is Xdb + Xdb for each Crate, it sounds too loud for sure.

    But when hitting just one crate it sounds perfect.

    How can I make it so it will only play 1 "Crate_Hit" SFX a time, instead of all damaged crates at once?

    Thanks ahead!

    What you need to do there when you play the hit crate audio is check if the audio is playing or not

    And youd have some code like the following

  • Thanks for the help!

    So, I tried to do what you suggested on the HIT (only once) and it didn't work with the invert sub event and the one after.

    But it did work just with the simple Trigger Once at the end of the event.

    The other problem, I hope I can describe it with my bad English:

    When the crate breaks it's hp <= 0 it plays the "Crate_Breaks" tag (since I have few files, same with the hit).

    The problem is if I keep Attacking (it's a melee sprite attack playing), I can hear the Crate destroyed more than once, I did use the "Trigger Only Once" so it works for the part of not repeating it 60fps but when I keep attacking while the Animation of the Breaking Crate is playing... it will play the "Crate_Breaks" audio again...

    So it does Trigger Only Once related to how many times it plays when I first destroy the crate, but not Playing Once even after the Crate is already destroyed.

    While I'm playing around with invert options, I attached the current condition so you can have a look:

    https://i.imgur.com/Fmqfyv6.png[/img]

  • For images to show in post use [ img = url ] without spaces

    You also need to destroy the crate after triggering the action for audio. on the condition of hp<0. That will stop the double audio playing.

    On event 96 on actions under audio choose add crate = destroy

  • Thank you so much for your kind help!

    I'm still not used to the new forums, this is what I do for the images:

     [img]https://i.imgur.com/H3EAgW7.png[/img] 

    but it's not really working, I probably do something wrong that's why I added the space, so it will be clickable. (I can't even show that I use the img open and close here, I tried to edit but no luck)

    EDIT: OK, got it Scirra needs to fix the top icon shortcut for images because it's:

     [img=https://i.imgur.com/H3EAgW7.png] 

    About the destroyed crate: I have the crate it's dedicated destroy event on a different event sheet, and it uses the built-in Destroyed when the fade out is finished. as you can see on the image attached.

    it's destroyed for sure because before that I could see the latest frame of the crates pieces.

    What else can I try?

  • What else can I try?

    You should move the fade restart | destroy event for the crate immediately under the audio play so its not delayed. Preferable in the same event sheet, or move the crate audio play above the fade restart on the same event sheet, they should work.

  • After I changed the order as you suggested, it's playing only once but... any other crates I destroy after the first one won't make sound, so it's REALLY triggering once, and that's it.

    Oh my! I have so much to learn... sorry for the confusion, I'm trying to learn as I go.

  • After I changed the order as you suggested, it's playing only once but... any other crates I destroy after the first one won't make sound, so it's REALLY triggering once, and that's it.

    Oh my! I have so much to learn... sorry for the confusion, I'm trying to learn as I go.

    You can also add on the event that triggers the audio to play a For Each crate loop from the system expressions.

    And i think at that point you could remove the trigger once. since that would fire on each object type crate is being hit. Right now you are giving it a general state, and applies to all and considers all objects 1 object if your using trigger once, is a bit confusing.

    Il do a example file for you in a few minutes.

    Edited: take a look at the events in destructible objects audio. now the destruction part or Event nr 3 you can put it on the general eventsheet that you include where you had the destroy by fade to apply to all crates.

    Hope it fixes your issues.

  • Thanks for taking the time and making an example!

    I tried to simplify it like in your example, but I get some weird result now it only sometimes... play a destroyed sound, and sometimes none.

    I got rid of the "choose" to make it just playing 1 sound to be sure but same result.

    I also tried to walk around using a Boolean of true / false but I get the same result as well.

    It's already too late for my brain to try figure it out (about 3:32am) so I guess I'll try it in another time, I didn't realize it will be so complex but maybe that's a good thing, more dynamic options to play with, once I'll get the hang of it. :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So... I couldn't sleep before I solve this issue, I played around and I found a creative way to make it work, using animation frame. I could compare it to any number of animation of the "BREAK" animation sequence and it will play it once perfectly as many times as I need for multiple boxes.

    I would like to share this simple solution:

    But I'm afraid that now I have a total NEW bug, I never had before until the point I added these few sound effects.

    I noticed that my game suddenly drop frames here-and-there, it was stable 140+fps or 60fps on full screen.

    And now, I see that the CPU (I have it on my other monitor) is going crazy to 40%-60% while it was on 4%-5% as I played the game.

    Is it a known issue? do I need to do something like preload the all stage before with all the sounds?

    Just to be clear, I'm not working on the Browser, I'm using only the Windows Desktop Version (latest stable, not beta).

    Any ideas why these dropping frames happens?

  • Nice glad you solved it in the end.

    For the sounds and cpu usage, usually the pre-loading happens when u load the app, try pressing f4 on preview so it starts with the loading bar and logo.

    If you see the game without a loading bar either the pre-loading already finished, or the files are skipped. But that doesn't usually happens. So it might be your other event sheets and loops, that spikes ur cpu, you might have a loop updating an audio, or a text on a everytick type of condition. There's various reasons when comes to a complex layered Construct projects.

    As for desktop vs browser Construct i think they are the same thing.

  • Thanks for your advice!

    I didn't see a loading bar using F4, and the problem solved somehow... when I restarted Construct 3.

    Everything loaded smooth and fast with the sounds. I'm not sure what cause this I hope it won't happen again so I won't need to restart Construct 3 everytime while working on the game, I will have to see if this happens again or not, but from your explanation I understood that the sounds already pre-loaded so it can't be the reason, it's not loading it as I start playing.

    You did encourage me to explore how to make my own Progress Bar / Loading Layout as the very first screen of my game. I will check it out hope it's not too complicated to create.

    For now I have only 1 layout for the game itself, and many other layouts for sake of organization some of them have only the Enemies, Other have Items, so every one have it's own dedicated Event Sheet and all events included in the actual "GAME Stage" Layout, loaded at the top.

    It's a bit off-topic but I hope that I'm thinking correct about the order of my layouts:

    1 - Loading Layout = Custom progress bar & graphics, if I'll find out how to do that of course)

    2 - Main Title Screen Layout = Press START to play / Options / Credits etc..

    3 - First Stage Layout = Probably All X Stages in the same HUGE Layout, Camera will change direction to the other Stage.

    4 - Extra Layouts = Option Menu / Settings for different controls such as Sounds / Music / Full Screen etc.. I didn't explore this part yet.

    The thing is:

    I'm not sure if I'll even SEE the Loading Layout screen... since I only have 1 stage now, it will probably faster and skip it right away.

    Is there a way to cheat and SEE the Loading Layout Screen when running the game? some kind of secret debug-cheat? maybe... using "wait" ?

    What do you think, also if you have any tips related to this I'll appreciate it.

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