Pressure plate not always fired when walking over them #4452

Open
opened 2024-06-21 01:11:06 +02:00 by minec · 3 comments

VoxeLibre version: 0.87.1

What happened?

I opened a door by right-clicking. Immediately behind the door is a pressure plate. I walked over the pressure plate and continued, but the pressure plate was never triggered, and my door remained open.

What should happen:

The pressure plate should reliably trigger. In my case, the door should have been triggered to close.

Steps to reproduce

Place a door. Place some blocks to the left and right of the door (to convince yourself). Place a pressure plate on the ground immediately beyond the door.

Open the door and walk over the pressure plate. The door will close the majority of the time. But sometimes, the pressure plate is not triggered and the door does not close.

Test results

I opened + walked through the door with the pressure plate behind it 64 times, and returned from the other side (by stepping on the pressure plate to open the door) 64 times. Here are my results:

i = success
o = failure

I am approaching the door at walking speed.

Using the pressure plate to close the door behind me when entering home. Success is if the door closes behind me:

iiiiiiiioiioiiiioioiiiiiioioiiiiiiiiioiiiiiiooiiiiiiiiiiiiiiiioi
54/64 success, 10/64 failed = 84.375% success, 15.625% fail

Leaving the home by stepping on the pressure plate to open the door. Success is if the door opens for me:

iiiiiooioiiioioiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiioiiiiiiiiiiiiiii
58/64 success, 6/64 failed = 90.625% success, 9.375% fail

So I cannot reliably use the pressure plate to shut/open the door to my home, furthermore when just walking, which is annoying. I would greatly appreciate it if someone could look into this and find a solution. I noticed that the pressure plate timer was reduced in #3600. I wonder if someone can reproduce the bug.

If the pressure plate timer interval is 0.25s and roughly my walking speed is roughly 4.4 blocks/s, it makes sense that it would miss my walking. I propose increasing the pressure plate timer rate so that this doesn't happen. Maybe a 0.20s interval would work.

I was curious to do this experiment with sprinting instead of walking and, as expected, the results were worse:

Closing the door behind me:

ioiiiiooiooiiiiiiooiioioiiooiiiiooiioooiiioioiiioiioiiiiiiiiiiii
44/64 success, 20/64 failed = 68.75% success, 31.25% fail

Opening the door in front of me:

iiioiiiiioioioioiiiiiooooiiiiiiioioiiiooiiooooiiooooiiioiiiiiiio
41/64 success, 23/64 failed = 64.06% success, 35.94% fail

So I think with these results, it is a bug. I measured about 5.7 blocks/sec when sprinting, so maybe the interval should be 0.17s instead.

EDIT: An easier way to see the bug is to make a gauntlet of doors and pressure plates and see how many times you run into the door in front of you.

<!-- Thanks for taking the time to fill out this bug report! Please follow our contributing guidelines first: https://git.minetest.land/VoxeLibre/VoxeLibre/src/branch/master/CONTRIBUTING.md#rules-about-both-bugs-and-feature-requests By submitting this issue, you agree to follow our Code of Conduct: https://git.minetest.land/VoxeLibre/VoxeLibre/src/branch/master/CODE_OF_CONDUCT.md --> <!-- What version of VoxeLibre are you using? We do not provide support for outdated versions of VoxeLibre. "/ver" command will output the version you're running. Current latest version is listed here, at the top: https://git.minetest.land/VoxeLibre/VoxeLibre/tags --> VoxeLibre version: 0.87.1 ### What happened? I opened a door by right-clicking. Immediately behind the door is a pressure plate. I walked over the pressure plate and continued, but the pressure plate was never triggered, and my door remained open. ### What should happen: The pressure plate should reliably trigger. In my case, the door should have been triggered to close. ### Steps to reproduce Place a door. Place some blocks to the left and right of the door (to convince yourself). Place a pressure plate on the ground immediately beyond the door. Open the door and walk over the pressure plate. The door will close the majority of the time. But sometimes, the pressure plate is not triggered and the door does not close. ### Test results I opened + walked through the door with the pressure plate behind it 64 times, and returned from the other side (by stepping on the pressure plate to open the door) 64 times. Here are my results: i = success o = failure I am approaching the door at *walking* speed. Using the pressure plate to close the door behind me when entering home. Success is if the door closes behind me: ``` iiiiiiiioiioiiiioioiiiiiioioiiiiiiiiioiiiiiiooiiiiiiiiiiiiiiiioi 54/64 success, 10/64 failed = 84.375% success, 15.625% fail ``` Leaving the home by stepping on the pressure plate to open the door. Success is if the door opens for me: ``` iiiiiooioiiioioiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiioiiiiiiiiiiiiiii 58/64 success, 6/64 failed = 90.625% success, 9.375% fail ``` So I cannot reliably use the pressure plate to shut/open the door to my home, furthermore when just walking, which is annoying. I would greatly appreciate it if someone could look into this and find a solution. I noticed that the pressure plate timer was reduced in #3600. I wonder if someone can reproduce the bug. If the pressure plate timer interval is 0.25s and roughly my walking speed is roughly 4.4 blocks/s, it makes sense that it would miss my walking. I propose increasing the pressure plate timer rate so that this doesn't happen. Maybe a 0.20s interval would work. I was curious to do this experiment with sprinting instead of walking and, as expected, the results were worse: Closing the door behind me: ``` ioiiiiooiooiiiiiiooiioioiiooiiiiooiioooiiioioiiioiioiiiiiiiiiiii 44/64 success, 20/64 failed = 68.75% success, 31.25% fail ``` Opening the door in front of me: ``` iiioiiiiioioioioiiiiiooooiiiiiiioioiiiooiiooooiiooooiiioiiiiiiio 41/64 success, 23/64 failed = 64.06% success, 35.94% fail ``` So I think with these results, it is a bug. I measured about 5.7 blocks/sec when sprinting, so maybe the interval should be 0.17s instead. EDIT: An easier way to see the bug is to make a gauntlet of doors and pressure plates and see how many times you run into the door in front of you.
minec added the
bug
unconfirmed
labels 2024-06-21 01:11:06 +02:00
teknomunk added the
redstone
label 2024-06-21 01:17:37 +02:00
the-real-herowl removed the
unconfirmed
label 2024-06-21 12:07:29 +02:00
Member

I was able to reproduce this issue, and have an idea what is causing this to happen.

Currently pressure plates are implemented by periodically checking for entities nearby and triggering if there is an entity on the plate. Checking more often is going to have more accurate behavior, but have a higher performance cost.

I was able to reproduce this issue, and have an idea what is causing this to happen. Currently pressure plates are implemented by periodically checking for entities nearby and triggering if there is an entity on the plate. Checking more often is going to have more accurate behavior, but have a higher performance cost.

The only correct way is to check on entity/player side... maybe check for items in ABM, but that would have to be profiled.

The only correct way is to check on entity/player side... maybe check for items in ABM, but that would have to be profiled.

(See magma blocks, wither roses, etc.)

(See magma blocks, wither roses, etc.)
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: VoxeLibre/VoxeLibre#4452
No description provided.