Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Footstep sound repeats on ladders (and rapidy in other situations) #1460

Closed
SmallJoker opened this issue Jul 8, 2014 · 21 comments · Fixed by #10145
Closed

Footstep sound repeats on ladders (and rapidy in other situations) #1460

SmallJoker opened this issue Jul 8, 2014 · 21 comments · Fixed by #10145
Labels
Bug Issues that were confirmed to be a bug Low priority @ Server / Client / Env. Sounds

Comments

@SmallJoker
Copy link
Member

When you hold shift on a ladder - you reached the bottom - then it plays the "footstep" sound again and again.

Low priority

@davisonio
Copy link
Contributor

A similar thing happens with fences, when you try climb over them and/or press shift it repeats the sound.

@paramat
Copy link
Contributor

paramat commented Aug 25, 2016

Footstep-farts happen in many situations.

@paramat paramat added the Bug Issues that were confirmed to be a bug label Aug 25, 2016
@Desour
Copy link
Member

Desour commented Nov 7, 2016

i cant reproduce the original issue but the footstep sound of the node on which the ladder is placed is played very often if above this node is air and you climb down the ladder

@Fixer-007
Copy link
Contributor

Now it repeats while pressing shift on the sea floor after 14aa990

@paramat
Copy link
Contributor

paramat commented Aug 31, 2017

Add #6356 by lupoDharkael
"If you have free_move enabled and keep pressing Shift (without moving), you can hear the footstep sound in loop. The sound should be heard only when you reach the floor."

@paramat paramat changed the title Sound repeats on ladders Footstep sound repeats on ladders (and rapidy in other situations) Aug 31, 2017
@lupoDharkael
Copy link
Contributor

lupoDharkael commented Sep 2, 2017

I've discovered a new one:
capture-19 06 56
You can experience the sound loop with free_move activated if you move forward at floor level as you can see in the image (no shilft press needed)

@paramat
Copy link
Contributor

paramat commented Jan 24, 2018

Don't you mean 'fast move'? 'free move' would allow you to pass through the nodes in front.

@ghost
Copy link

ghost commented Jan 24, 2018 via email

@paramat
Copy link
Contributor

paramat commented Aug 21, 2018

Low priority but also, footstep sound is played twice as fast on fences. Folding #4310 into this.

@HybridDog
Copy link
Contributor

HybridDog commented Aug 21, 2018

I've noticed that no footsteps are played when walking on the ledge, especially noticeable when jumping onto the nodes. It may be intentional because when the foot touches the ledge it should make no sound or a completely different one than when it touches a planar floor.
edg

@paramat
Copy link
Contributor

paramat commented Aug 22, 2018

Lack of edge footsteps sounds is due to a bugfix i made a while ago, see #5199 The alternative is the worse bug that was fixed.

@SmallJoker
Copy link
Member Author

I did some research and found an explanation for this bug.

  1. The sound is played here when there's a new Y collision:
    if(!result.standing_on_object && !touching_ground_was && touching_ground) {
    m_client->getEventManager()->put(new SimpleTriggerEvent(MtEvent::PLAYER_REGAIN_GROUND));
  2. The player controls are applied once before the client environment step:

    minetest/src/client.cpp

    Lines 409 to 412 in a43a4e2

    player->applyControl(dtime, &m_env);
    // Step environment
    m_env.step(dtime);
  3. LocalPlayer::move (which does the collisions) is called multiple times per environment step to prevent aliasing problems on thin collision boxes.
    /*
    Move the lplayer.
    This also does collision detection.
    */
    lplayer->move(dtime_part, this, position_max_increment,
    &player_collisions);
  4. So it happens that the first LocalPlayer::move call detects ground (Y collision) when moving down, but all other in the same env step don't. In the next loop this repeats and the oscillating touching_ground value causes this sound fart.

Possible solution: Only set touching_ground = false (localplayer.cpp) after the steps when none of the LocalPlayer::move collision results returned a Y collision.

@random-geek
Copy link
Contributor

@SmallJoker Just curiously, why are the results of LocalPlayer::move() inconsistent to begin with?

@SmallJoker
Copy link
Member Author

SmallJoker commented Oct 20, 2018

@random-geek move() calls the collision detection function which then moves the player's position and checks for collisions. This happens in small dtime slices (calculated by velocity for maximal travelled distances). So after a certain dtime slice, a collision is detected -> player is on ground now (if Y collision) and it plays the "ground regain" sound. After that, the velocity is back to 0, thus no collision * -> player is floating in the air again.

As already mentioned above, the possible solution for this would be to check whether the player regained ground in one of the dtime slices and compare it with the last step's value to have a more stable variable than touching_ground.

* There is no gravity because liquids and player controls are applied differently.

@LoneWolfHT
Copy link
Contributor

Was about to make an issue but then I saw this 👍

@GreenXenith
Copy link
Member

I can no longer reproduce this (ladder/fence/corner repeated step sound) in latest master.

@SmallJoker
Copy link
Member Author

Bug still persists in current master (4445889). Press sneak/shift here:
grafik

@GreenXenith
Copy link
Member

That is what I did, and cannot reproduce it.

@Desour
Copy link
Member

Desour commented Dec 31, 2019

I can still reproduce, too. @GreenXenith have you made sure that your sound volume is loud enough and that the node below has footstep sounds?

@GreenXenith
Copy link
Member

GreenXenith commented Dec 31, 2019

Yes, in fact I used the exact node setup as SmallJoker just to be sure.
The footsteps play whilst descending and then stop once I reach the bottom (sneak still pressed).

@paramat
Copy link
Contributor

paramat commented Jun 26, 2020

A very simple and zero-risk improvement is here #9891 (comment)

See #9891 for further discussion and some alternative proposals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues that were confirmed to be a bug Low priority @ Server / Client / Env. Sounds
Projects
None yet