This is a comprehensive list of every interaction a player will make.
This game will support keyboard/mouse and controller as input methods.
Mouse only!
It’s important to note that the entire game should be playable with just the mouse. The keyboard simply allows for hotkeys or shortcuts for certain actions. This will allow us to support touch screens on PC tablets (or mobile if we ever do that).
Input action reference
This is a reference for terminology used to refer to input actions, applicable to both keyboard/mouse and controllers. Xbox labels are used here.
| Input Action | Purpose | Default controller button | Default keyboard button |
|---|---|---|---|
| Directional Input | Navigate menu selections, move a virtual pointer, etc. | Left stick AND dpad | WASD AND arrow keys |
| Confirm | Select menu elements, confirm choices, etc. | A | Enter* |
| Back | Go back in menus, cancel choices, etc. | B | Backspace* |
| Cycle Left | Cycle backwards through tabs in a menu, units on the grid, etc. | LB | Q |
| Cycle Right | Cycle forwards through tabs in a menu, units on the grid, etc. | RB | E |
| View Details | Serves two functions: - Is held to reveal a more detailed description for items and abilities. - Allows controller users to view details about items in the middle of battles. | Y | Left Shift |
| End Turn | End the current turn. | X | Space |
| Camera Pan | Pan the camera during battles. | Right stick | WASD |
| Zoom In | Zoom the camera in. | LT | Scroll Up |
| Zoom Out | Zoom the camera out. | RT | Scroll Down |
| View Status | Opens the status menu. | Select | Tab |
| Pause | Opens the pause menu. | Start | Esc |
| * Note: In addition to these keys, Left Click should be a confirm input, and Right Click should be a back input. These cannot be unbound. |
”Pointer” vs “Cursor”
Pointer and cursor refer to two different concepts. It’s important to know the difference when reading this GDD.
- A pointer is an element that you move freely to point at things and select them. For keyboard/mouse this is the mouse pointer, and for controller this is the virtual pointer moved using directional input.
- A cursor is an indication of which element is currently highlighted, used when navigating menus with a controller. Constrained to menu elements, and doesn’t have the freedom of movement that a pointer has.
How to handle mouse clicks
Mouse click events should be handled when the mouse button is sequentially pressed and released on the same element. This should give the player the opportunity to move their mouse off an element and release the button if they accidentally pressed on the wrong thing.
For the programming team:
It’s important for the input system to reliably differentiate between a click and a drag. We don’t want clicks to fail because the player accidentally moved the mouse a few pixels, registering a drag instead.
I suggest only entering the “dragging” state if the player has clicked and dragged the mouse a certain distance away from its starting point. If they release the mouse button before that happens, a click is registered instead.
Player Interactions
| Interaction | Keyboard/Mouse | Controller |
|---|---|---|
| Navigating menus | The mouse is used to click on menu elements. | Menu elements should be highlighted and navigable using the controller’s directional and confirm inputs. |
| Navigating backwards in menus | There should always be a “back” or “cancel” button the player can click on. | The “back” input is used to go back in menus. |
| Navigating tabs | The mouse is used to click on tabs. | Tabs are cycled through using the Cycle Left and Cycle Right inputs. |
| Viewing details about items and status effects | The mouse is used to over the related element. | A cursor is used to highlight the related element. The “view details” button is used to do this during battles. |
| Purchasing items from the shop | The player clicks and drags a shop item to the character they want to give it to. | The player uses a cursor to select a shop item, then uses another cursor to select a character to give it to. |
| Selecting grid cells | The mouse is used to click on cells on the grid. | A virtual pointer is used to select cells on the grid. The pointer should be constrained to the edges of the grid, and should automatically snap to the centre of the nearest cell when directional input stops. |
| Panning the camera | The WASD keys pan the camera, or the mouse is used to click and drag on the grid, moving the map around with it. | The right stick is used to pan the camera. |
| Zooming the camera | The scroll wheel is used to zoom the camera. | The Zoom Out and Zoom In input actions are used to zoom the camera. |
| Selecting rooms on the district map | The mouse is used to click on an available room on the map. | Directional input is used to navigate a cursor onto the desired room. The next possible room choices should always be laid out vertically anyway, so only vertical input is necessary. |