jaymakesgames | notes

Back


On "notes".

I wanted to take a chance on writing notes about my personal game development. This is the first such "note". Let's jump right into it with something I've been working on recently.

In freya, I have been striving to make sure that it will control well using a gamepad. I wanted to make something that will be nice to play in a portable setting. One nicety of knowing this restriction up front is that I won't accidentally build out a keyboard-centric input configuration that utilizes more keys than exist buttons on a generic gamepad.

Currently, the game's default keyboard input is built to do two things: The default configuration looks like this, assuming the users left hand is on "A S D F G" and the right hand on "J K L":
                move up
    move up + left    |      move up + right
                 \    |    /
                [U] [I] [O] 

move left  --   [J] [K] [L]  --  move right
                     |
                     \- pass a turn / wait
                [M] [,] [.] 
                /    |    \
 move down + left    |     move down + right
                     move down

Actions / Interface:

   [W] [E] [R] [T]
    |   |   |   \- Toggle inventory
    |   |   \----- Select next toolbelt item
    |   \--------- Select previous toolbelt item
    \------------- Show minimap

[A] [S] [D] [F] [G]
 |   |   |   |   \- Show menu
 |   |   |   \----- Confirm / Select / Use equipped item
 |   |   \--------- Cancel / Back
 |   \------------- Fast movemet (hold + movement keys)
 \----------------- Move build target reticle (hold + movement keys)

[Z] [X] [C] [V]
 |   |   |   \- Cycle toolbelt forward
 |   |   \----- Cycle toolbelt backward
 |   \--------- Sub-cycle the currently selected tool forward
 \------------- Sub-cycle the currently selected tool backward
On a gamepad, there are only so many inputs:
   L-Trigger      R-Trigger
   L-Shoulder     R-Shoulder
       Select     Start
       U             Y
     L   R         X   B
       D             A

       L-stick       R-stick
Eventually you'll run out of inputs that can be mapped to a single press of a button, which is exactly where I find myself as I am adding a new feature. As a workaround to this limitation, you can be slightly clever to add additional "soft" buttons -- things like: pressing two buttons simultaneously, double or triple press, long press, etc.

I wanted to add a way to quickly initiate a new action in the game (more on this later) without having to drop through to a menu to do so. I opted to go with the long press method, which ends us up with being able to offer two actions using a single key like this:
 [K] 
  |
  |- press: skip your turn
  \- hold: switch to auto-explore


That was all a somewhat lengthy lead in to writing briefly about a new feature in the game that necessitated building out the long-press detection: "auto explore".

If you have played enough roguelikes you'll know that some aspects of the genre can be repetitive. To speed things up, players can opt to trigger auto exporation. When on, the player will automatically move and pick up all loot and open all doors & chests on the map. If there is nothing left to pick up or an enemy is spotted, auto exploration will automatically toggle itself off.

This is handy if you're retreading starting areas and want to pick everything up without doing all the work yourself ... or if you're debugging the same areas over and over.

I'll go into more detail about how the auto exploration functions in a future note.
©2018-2024 jaymakesgames