How do I add footstep sounds?

Get help using Construct 2

Post » Mon May 02, 2016 5:59 pm

This problem is giving me a freaking headache, so first of all I've got the code part down right, but Construct 2 messes up the audio and it
sounds like a fart. I am sorry for the politically incorrect-ness but there is no other way to describe the sound. Here have a look for yourselves:
Image
B
4
Posts: 7
Reputation: 214

Post » Mon May 02, 2016 6:29 pm

Well, ok this will get a little complicated because there are a few issues at play here.

The first problem is the pants. Your events state that the pants animation will play from the beginning every single frame your character is moving. So your pants animation never leaves the first frame. The thing that I find works well for triggering animations is to make them actions to key presses and releases. So "on Key press D - play animation" for example.

The sound issue is the same as the pants. A new sound will play for every tick that you hold down the D button. That means that the sound is just piling up because you'll have hundreds of them playing all at once.
You could try removing everything from the audio event and just make it "Pants - Animation Frame = (whatever frame you want the sound to play) - play sound".

I hope that's clear enough.
Be sure to check out my Metroidvania game, A Hole in the Earth
B
59
S
24
G
3
Posts: 359
Reputation: 5,683

Post » Mon May 02, 2016 7:14 pm

ryanrybot wrote:Well, ok this will get a little complicated because there are a few issues at play here.

The first problem is the pants. Your events state that the pants animation will play from the beginning every single frame your character is moving. So your pants animation never leaves the first frame. The thing that I find works well for triggering animations is to make them actions to key presses and releases. So "on Key press D - play animation" for example.

The sound issue is the same as the pants. A new sound will play for every tick that you hold down the D button. That means that the sound is just piling up because you'll have hundreds of them playing all at once.
You could try removing everything from the audio event and just make it "Pants - Animation Frame = (whatever frame you want the sound to play) - play sound".

I hope that's clear enough.


Thank you for replying and helping. Your solution made my walking animation better and more convinient for editing and functionality in the future but the audio remedy did not improve my situation :(.

It still sound like a *fart* or multiple audio files playing at once. Here is the updated code:
Image
B
4
Posts: 7
Reputation: 214

Post » Mon May 02, 2016 10:15 pm

Can you confirm that those are not distorted:

https://
drive.google.com/open?id=0B1SSuCVV8v74U1BUT3NVenhvNE0

If they are not distorted in this capX, you do not have an additonal problem. You are just calling the play actions more times then you expect. Look @ my cap how i solved that.

If the animation speed is slower then the actual Frames/second. An actual frame will be showed in more then one tick. Therfor: youre condition is true for several ticks in a row.

Lets say the animation runs at 25 frames/second. & The game runs at 50 frames/second. Then each frame will be showed 2 ticks. And your conditions is true for 2 ticks. & then it farts, eh.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Mon May 02, 2016 10:40 pm

Hey, I had this same problem. It's a really easy fix, you just need to add "Trigger once" to the conditions :)

(May need to remove the "D is down" condition, tbh it'll probably work just fine without that anyway)
Image



Coming soon on Steam!
B
16
S
9
G
3
Posts: 205
Reputation: 3,468

Post » Tue May 03, 2016 3:32 am

The way I've done my walking sounds is to have short one-shot samples rather than a loop and I trigger them once under certain conditions (eg player is on ground, player is moving, frame 25 is playing), that way I can make sure that my sounds exactly match when my character's foot touches the ground. It also allows for more flexibility eg I have a pool of similar footsteps and it will choose a random sample and volume each time, so that it doesn't sound too repetetive.
B
66
S
25
G
4
Posts: 211
Reputation: 7,057

Post » Tue May 03, 2016 2:56 pm

Thank you all so much for helping me with this problem, Thank you especially MikeHive because you have given me a solution to the problem.
This community is very friendly and helpful :)
B
4
Posts: 7
Reputation: 214


Return to How do I....?

Who is online

Users browsing this forum: MassimoF and 20 guests