Allow button mashing faster than 15 inputs per second
I'd like to create a "Test Your Might" style minigame, where players must mash a button REALLY fast to outpace a timer. Unfortunately, Dreams' clock speed caps the maximum mashing rate at ~15/sec (15 frames on, 15 frames off). Anything faster just outputs a constant signal.
If possible, I want Dreams to at least receive the real rate of button presses from the PS4 hardware. That data would fit nicely into a "mash speed" variable which updates 15 times per second.
What wizardry is required to accomplish such a feat?
Thanks!
-
Logic runs at 30 fps. If you're using a pulse, that requires it to go from off to on--meaning a frame of no signal in between. Which means you can fit 15 pulses into 30 frames. So it's not actually to do with processing button presses, but how logic is run in general --which is not likely to change, honestly.
You can still detect up to 30 presses per second with some creative logic. -
Appreciate it, Giles. I decided on the simplest solution of allowing multiple buttons. Works well enough.
What's required to detect a button press on all 30 logic cycles? -
I haven't tried implementing it, but you could use a looped NOT gate (wired into itself so it sends a 1 and 0 on alternate logic frames) into a selector's active port (using channel A for a 1 and channel B for a 0) and use the signals coming from those channels to do whatever. So if you just want to count presses, put those through sig-manips to make pulses, and have them add to separate counters. Then add those counters together.
Thing is, if your logic needs to be triggered and cannot be redone to respond to consecutive frames of activation, you'd have to duplicate that logic basically. It very much depends on what the logic is in the first place.
Войдите в службу, чтобы оставить комментарий.