Language…
13 users online:  Atari2.0, DanMario24YT, Dennsen86, derv82, drkrdnk, eltiolavara9, Fozymandias, Maw, Nayfal, prisvag, Red2010, Serena, steelsburg - Guests: 295 - Bots: 258
Users: 64,795 (2,375 active)
Latest user: mathew

Tolerance Timer (aka Input Buffering & "Coyote Time")

SMW Patches → Tolerance Timer (aka Input Buffering & "Coyote Time")

Submission Details

Name: Tolerance Timer (aka Input Buffering & "Coyote Time")
Author: RPG Hacker
Added:
Version History: View
Tool: Asar
Requires Free Space: Yes
Bug Fix: No
Featured: No
Description: (2021-05-05: made the patch less unwieldy, single-file, and compatible with newer Asar versions.)

---

This patch aims at making the game's controls more responsive while also lessening the impact of input lag (such as in BSNES or Higan).

So far, two different tricks are supported in the patch and both of them are based on simple timers that add some kind of tolerance window to the game.

The first trick (aka "Coyote Time") allows Mario to perform late jumps. This means that if Mario is about to fall down a platform, as long as a certain amount of time hasn't passed yet, Mario can still perform a jump.

The second trick (aka "Input buffering") basically does the exact opposite to this, as it allows Mario to perform early jumps. This means that if Mario is currently still in the air and pressing a jump button, if he lands on a platform within the next few frames, he will immediately jump off that platform, as if the jump button was pressed the exact moment he landed on it.

By default, both hacks are set to use a frame count of 3 frames (which is equal to about 50 ms of time), but this can be adjusted in the patch. I personally think that 3 frames is a great starting point, but depending on your hack's design, other settings might work even better for you. You can also activate and deactivate both hacks independently from each other. Just take a look at ttconfig.cfg for details on each setting.

Please play around with the patch for yourself to see how much of a difference it makes, espcially in hacks with tight and precise (single block to single block) jumps.

Requires up to 5 bytes of free RAM, depending on which features you enable (3 for late jumps and 2 for early jumps).

Feel free to contribute to this and other patches via my GitHub repository.
Tags: bsnes delay early early jump early jumps emulator enhancement gameplay higan input delay input lag input latency jump lag late late jump late jumps latency lorom physics sa-1 timer tolerance
Comments: 22 (jump to comments)
Download 1.90 KiB | 241 downloads

Screenshots

Comments (22)

BreadWheatmann Link
Originally posted by RPG Hacker
Oh, whoops. Sounds like quite the specific situation. Yeah, that should be fixable by just clearing the timer on level load. If I remember correctly, there's already some free RAMs available that clears automatically on level load, so by just setting the respective timer define to one of those addresses, you might be able to hot-fix the issue yourself.


Well, I tried messing around with it some, and it looks like clearing it on level load works, but not with a retry system rom. I'll try using a RAM timer ($7E188A) that auto resets upon hurt or death, but if that doesn't work, is there any way I could insert some code into retry_extra.asm to manually reset the timer upon death? What would that code be exactly? Thanks!

edit: the death-reset free ram timer worked! Thanks for the help!
 RPG Hacker Author Link
Oh, whoops. Sounds like quite the specific situation. Yeah, that should be fixable by just clearing the timer on level load. If I remember correctly, there's already some free RAMs available that clears automatically on level load, so by just setting the respective timer define to one of those addresses, you might be able to hot-fix the issue yourself.
BreadWheatmann Link
So, after a bit more playtesting I've found a small bug that needs addressing. Most of the time, when exiting a pipe at the start of a screen and going straight into freefall, the coyote time works just fine. However, when using the multiple checkpoint retry system, if Mario dies while standing on the ground, then respawns in midair, the late-jump timer is not reset. This means that players can spawn out of a pipe and be instantly able to jump, even if they haven't yet touched the ground that life, which can break a lot of setups. This could probably be fixed by adding a check to see if the player has died, in which case all the timer is reset and the late jump is made impossible. So, uh, yea, now ya know. Have a nice day!

edit: I tested it on a completely clean rom without a retry system, and the problem still occurred. Seems that the timer and late-jump-allowed trigger stay active through death, and can even be carried over to completely different levels after going through the overworld.
BreadWheatmann Link
This is absolutely incredible and in my opinion a must-have patch, even for kaizo hacks. It makes this game feel FAR more responsive and modern, and as far as I can tell it has 0 drawbacks (unless you consider giving frustratingly frame-perfect tricks a little bit of leniency and consistency a bad thing). No longer will players have to literally time it down to the frame to jump off a falling platform optimally, or pick up a throw block while leaping from it, allowing levels past those annoying roadblocks and actually get to the fun part - the cool setups that tricks like those allow. I hope this becomes a standard inclusion in new hacks moving forward. Great patch!
Vitor Vilela Link
Works all cool! I remember in the other day someone talking that Mortal Kombat II had a lot of input lag and the first think I thought was a patch similar to this to buffer commands ahead of time.
 RPG Hacker Author Link
Oh, right, I never updated this for the newer Asar versions. Thanks for doing that.
If you wanna do me a solid, please also add "coyote time" and "input buffering" somewhere to the title or description, because that's what these things are officially known as.
 RPG Hacker Author From older version: Tolerance Timer (aka "Screw Input Lag") Link
The version of this patch and shared library on the GitHub repository might work. Haven't checked this yet. If I don't forget it and this actually works, I will submit and update later.
trillian From older version: Tolerance Timer (aka "Screw Input Lag") Link
This breaks on the latest asar, due to the shared library using some really ugly and fragile hacks.
for example: function greater_or_equal_to_zero(value) = 1-(value>>31)
 RPG Hacker Author From older version: Tolerance Timer (aka "Screw Input Lag") Link
As I just learned, what I call "early jumps" here is also called "input buffering" by some game developers, and what I call "late jumps" is called "coyote time" by some.
 RPG Hacker Author From older version: Tolerance Timer (aka "Screw Input Lag") Link
Glad to know you enjoy my patch! :)
In my opinion, it's these little details that make the difference between an "A" hack and an "A+" hack.
EddyCartoon From older version: Tolerance Timer (aka "Screw Input Lag") Link
This is an awesome patch. It makes gameplay so much easier & smoother. I apply this patch every time I find a new hack to play. Amazing.
TheBiob From older version: Tolerance Timer (aka "Screw Input Lag") Link
Originally posted by RPG Hacker
(I'm really missing the Recent Comments sections, I never see comments on my submissions until days later)

Since the page is still accessable you can add it yourself with some extension or w/e (I edited smwc+ for that)
 RPG Hacker Author From older version: Tolerance Timer (aka "Screw Input Lag") Link
Thanks for the kind words! :)
(I'm really missing the Recent Comments sections, I never see comments on my submissions until days later)
leod From older version: Tolerance Timer (aka "Screw Input Lag") Link
tbh feature this it's cool
Vitor Vilela From older version: Tolerance Timer (aka "Screw Input Lag") Link
I prefer tag spam over not tagging at all. There is lot of stuff with single or even not any tag at all and our moderators approves without commenting anything at all.
 RPG Hacker Author From older version: Tolerance Timer (aka "Screw Input Lag") Link
Haha, sorry on the tags. :D
I haven't uploaded a patch in years and wasn't sure how SMW Central handles the tags, so I just applied my YouTube strategy of adding as many tags as possible. Will try to stick to just the most important tags next time.
Von Fahrenheit From older version: Tolerance Timer (aka "Screw Input Lag") Link
Moderator's note: AKA welcome to this thing has too many tags. It's pretty good. It's super easy to use and slightly improved game feel. I personally think the default 3 frames of leniency is too much and recommend setting it to 2, but that also highlights the best part of the patch; it's also super easy to customize! Just open ttconfig and set the variables as you see fit.
 RPG Hacker Author From older version: Tolerance Timer (aka "Screw Input Lag") Link
Yeah, ZSNES and ZMZ also have input lag, but from my personal experience and from some independent test I've read, they're the SNES emulators with the smallest latency. The only environment with "no" input latency would indeed be real hardware in combination with a CRT TV, but only few people have the means to actually test their hacks in such an environment. Even in such an environment, this patch should have a positive effect, though.
MarkVD100 From older version: Tolerance Timer (aka "Screw Input Lag") Link
@RPG Hacker
But I seem to get input lag on ZSNES/ZMZ as well. 2-3 frames. It doesn't happen on real hardware.
 RPG Hacker Author From older version: Tolerance Timer (aka "Screw Input Lag") Link
Sorry, got a little carried away. Compressed it to (what I think) is the bare minimum now. Hope this is tolerable now.
Green Jerry From older version: Tolerance Timer (aka "Screw Input Lag") Link
The description is too large.
HammerBrother From older version: Tolerance Timer (aka "Screw Input Lag") Link
That is the largest description I've ever saw.,