Adaptive Touch Input


The CHIP-8 VM, and by extension Octo, is based around the keyboard layout of the COSMAC VIP kit computer:


This unusual ortholinear 16-key hex keypad poses a bit of a challenge even for modern computer keyboards. Numpads have enough keys, but not in the right shape, and the numbers appear in the wrong order. Octo uses the left-hand side of the alphanumeric area of the keyboard as a compromise, making it easy to use the familiar "ASWD" constellation for directional input. For non-US keyboard layouts, it is possible to remap these bindings.

What about devices which don't have keys at all? In the interest of making CHIP-8 games accessible to more players, I decided to add a system for converting multitouch input events into simulated keypresses. Different games have different input needs, so I came up with four approaches for performing this conversion, each with different tradeoffs:

  • Swipe. Taps on the screen are treated like pressing an "action" key, while swipes and drags on the screen become directional input. This input approach is very natural for "single-button" games, or a puzzle game like 2048, and it adds no visual clutter to the display.
  • Seg16. Treat the center of the screen as if it were a 4x4 grid of square buttons. Taps and holds in any number of "buttons" map to the equivalent keys on the VIP keypad. Like Swipe, this approach is unobtrusive. Many games that are designed to take advantage of the arrangement of the VIP keypad will have a grid of visual elements corresponding to the virtual "buttons" making this input approach especially intuitive.
  • Gamepad. When the user touches the screen for the first time, spawn a translucent overlay providing a directional pad and two "action" buttons. While this approach does take up some space on screen, it provides clear affordance for which inputs are meaningful. The gamepad layout should be immediately clear to anyone familiar with the Game Boy.
  • VIP. When nothing else really fits, we can simply offer a touch-based version of the VIP keypad below the screen. This takes up the most screen real-estate, and lends itself more to a portrait layout, but it exposes all 16 key inputs with visual affordance and avoids having player fingers occluding the game itself.

How will your games use these capabilities? Give them a spin by choosing "Touch Controls..." in the Options panel of the Octo Toolbox. If you're curious about the details of how this system works, take a look at the implementation on GitHub.

Get Octo

Comments

Log in with itch.io to leave a comment.

(+1)

Used the Seg16 layout for my game, it works great!