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

Open
SmallJoker opened this Issue Jul 8, 2014 · 15 comments

Comments

Projects
None yet
@SmallJoker
Copy link
Member

SmallJoker commented Jul 8, 2014

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

Low priority

@davisonio

This comment has been minimized.

Copy link
Contributor

davisonio commented Jul 8, 2014

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

@paramat

This comment has been minimized.

Copy link
Member

paramat commented Aug 25, 2016

Footstep-farts happen in many situations.

@paramat paramat added the Bug label Aug 25, 2016

@DS-Minetest

This comment has been minimized.

Copy link
Contributor

DS-Minetest 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

This comment has been minimized.

Copy link
Contributor

Fixer-007 commented Mar 27, 2017

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

@paramat

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member

paramat commented Jan 24, 2018

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

@jastevenson303

This comment has been minimized.

Copy link
Contributor

jastevenson303 commented Jan 24, 2018

@paramat

This comment has been minimized.

Copy link
Member

paramat commented Aug 21, 2018

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

@HybridDog

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Member Author

SmallJoker commented Aug 23, 2018

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

This comment has been minimized.

Copy link
Contributor

random-geek commented Oct 20, 2018

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

@SmallJoker

This comment has been minimized.

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

This comment has been minimized.

Copy link

LoneWolfHT commented Feb 14, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.