How King's Quest 1 reads the keyboard
Anleitungen
/
How King's Quest 1 reads the keyboard
Aktualisiert 1 year ago von SantaClaus

Disclaimer:
All information here is based on experience and experiments, not on direct knowledge of the AGI engine's internal workings. Also, none of this information should be understood as applying to the ScummVM categories.

In general, King's Quest 1 polls keys every 0.05 seconds in Fast, and every 0.10 seconds in Normal. Usually, this means that all keys registered (=not eaten...) during that window are processed at once at the end of the window, in order; but there are some important exceptions.

In particular, not all keys are processed at the same speed. The slowest keys to process are action keys like Esc (open menu) or F3 (repeat last command); other keys pressed later but during the same window can potentially overtake the slow key, and get processed first despite being pressed later (this is much more common at Normal speed due to the longer window, but it can also happen in Fast).
F3 and Esc do not behave in entirely identical ways; in particular, in Normal (but not Fast), the visual opening of the menu happens with a 1-window delay. (The game still treats the menu as open, and any keys registered during that window are treated accordingly.)

Numpad 5 is on an interrupt, and as such is an exception to the usual keyboard polling, always triggering immediately when registered. This special behavior of numpad 5 adds the possibility of essentially random yolozips. (It also allows numpad 5 to potentially overtake other keys. including movement keys.)

Conversely, the usual 0.05 second polling rate makes Robb zips possible, by having a consistent amount of time elapse between moves; but it also adds the important complication that the ideal window for the next input cannot be entirely predicted from when the previous key was pressed.
Consider the case of a player with a tapping speed of 0.11±0.02 seconds, tapping 4 twice in a row for the leprechaun Robb zip. At the slow end of the range (0.13 seconds), the second 4 effectively has a 60% chance of falling into the third window (failure, necessitating a lengthy 43416829 correction) and a 40% chance of the second window (success), counting from the initial 4's window as zero. Conversely, at the fast end of the range (0.09 seconds), the input has a 20% chance of falling into the first window, also undesirable though at least potentially allowing a simpler 45 correction.

Spielstatistiken
Follower
29
Läufe
97
Spieler
19
Neueste Threads
Veröffentlicht 4 years ago
8 Antworten