Pressure plate not always fired when walking over them #4452
Labels
No Label
#P1 CRITICAL
#P2: HIGH
#P3: elevated
#P4 priority: medium
#P6: low
#Review
annoying
API
bug
code quality
combat
commands
compatibility
configurability
contribution inside
controls
core feature
creative mode
delayed for engine release
documentation
duplicate
enhancement
environment
gameplay
graphics
ground content conflict
GUI/HUD
help wanted
incomplete feature
invalid / won't fix
items
looking for contributor
mapgen
meta
mineclone2+
Minecraft >= 1.13
Minecraft >= 1.17
missing feature
mobile
mobs
mod support
model needed
multiplayer
Needs adoption
needs discussion
needs engine change
needs more information
needs research
nodes
non-Minecraft feature
non-mob entities
performance
player
possible close
redstone
release notes
schematics
Skyblock
sounds
Testing / Retest
tools
translation
unconfirmed
mcl5
mcla
Media missing
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: VoxeLibre/VoxeLibre#4452
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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:
Leaving the home by stepping on the pressure plate to open the door. Success is if the door opens for me:
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:
Opening the door in front of me:
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.
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.
(See magma blocks, wither roses, etc.)