Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Pressure plate hysteresis  (Read 860 times)

Asteranx

  • Bay Watcher
    • View Profile
Pressure plate hysteresis
« on: January 13, 2010, 06:09:19 pm »

My search terms could have been lacking, but I didn't see anything on this topic already posted...

Hysteresis is a method by which input can be smoothed, reducing jitter.  The idea is that a system remembers the last time its state changed, and won't change again until a certain minimum deviance from the point of the last change is reached.

In pressure plates, the implementation would be that the 'on' signal comes from reaching pressure level X, but the 'off' signal isn't issued until the level drops (or rises) at least a few points.

My specific example is a room that is designed to fill itself to level 3 using a slow influx (magma, low pressure water, etc), then close the entryway.  With the current setup, as the liquid is introduced to the room, you may (likely will) get an extra unit drifting around which triggers the plate, shutting the door, but shifts away later, causing the door to re-open again.  This leads to the door opening and closing repeatedly until enough material enters the room to fill it up past level 3.

With hysteresis, however, you could set the plate to trigger 'on' at 3, closing the doors, but not trigger 'off' until it drops down to 1 or 0.  So as soon as the first '3' is seen, the doors would close, and even though the level may fluctuate slightly (even smoothing out to a flat '2') the door would remain closed until the room was emptied.
Logged

Foehamster

  • Bay Watcher
  • Zig Frostrushes The Speachless Eater of Saints
    • View Profile
Re: Pressure plate hysteresis
« Reply #1 on: January 13, 2010, 06:17:27 pm »

At first I thought this was already implemented.  But then I remembered I used 2 pressure plates for my statue garden/wading pool.
Logged