0
\$\begingroup\$

Problem

  • In my puzzle game, the player moves one step at a time on a hexagonal grid. (Not an action game.)
  • The sequence of steps is important for the gameplay, so it is not only about getting from A to B.
  • There are of course six possible move directions that I have to map my input to.
  • My hexagons have a pointy tip, so I do not have a North or South adjacent cell. So the ordinal directions are NW, NE, E, W, SW and SE. See the image.
  • I am particularly interested in ideas to accomplish this movement for mouse, keyboard and Xbox-like controllers, but feel free to post your thoughts on touch.
  • The main difficulty is that I am very experienced with my very clunky controls and new players are struggling to simply move the player around. Also, the movement controls cannot be accomplished via conventional square grid controls, e.g. a dpad or WASD.

Ordinal directions around hexagon

What I have tried / Ideas

Keyboard

  • Mapping the characters around S directly to the six hexagonal directions, so W->NW, E->NE, A->W, D->E, Z->SW and X->SE. This is what I use basically.
  • Idea: Use WASD only. W is a North modifier, S is a South modifier and A and D correspond to East and West. Holding down the modifier will change what A/D does. Maybe show preview of current move possible with modifiers.

Controller

  • Flick controls: When you reach a certain threshold in displacement of the 2D left stick, this angle counts as as movement and will be mapped directly to a direction. You will see a small line/arrow pointing to the corresponding direction of the stick when you are not fully tilting the stick. Center stick to proceed.
  • Same as before, but you have to press A to go in that direction.

Mouse

  • Idea: Click on the adjacent tile to go there, maybe highlight possible moves.
  • Idea: Press a button and drag from that position to mimick stick controls, e.g. flicks.
\$\endgroup\$
2
\$\begingroup\$

For keyboard inputs, a simple but effective implementation is to have a set of keys that when repeatably pressed, change the player's orientation by rotating through the surrounding tiles in a clockwise or counter-wise direction.

So you could set the 'A' and left arrow keys to cycle through adjacent cells in a counter-clockwise direction and the 'D' and right arrow keys to cycle through adjacent cells in a clockwise direction. And then have the player hit enter (or some other key) to commit the move.

Cycling through orientations in a clockwise or counterclockwise direction can be mapped to a controller as well. Left on the stick or d-pad is counter-clockwise, right on the stick or d-pad is clockwise.

Clicking adjacent tiles makes the most sense for mouse input so I'd stick with that. Plus, you'll be able to use the same underlying logic for touch controls on a mobile device.

\$\endgroup\$
2
  • \$\begingroup\$ This is a valuable suggestion. This will ensure that the user is doing the move that they actually wanted at the cost of extra key presses. I wonder if you could reduce the presses somehow. Or maybe you can use the old WE/AD/ZX direct mapping but have to confirm it. \$\endgroup\$ – Close Call May 27 at 18:40
  • \$\begingroup\$ It also translates well to a controller- the analogue stick can point to a hex, hilight it, push a button to confirm. It keeps both selection methods to use similar verbs. \$\endgroup\$ – Felsir May 28 at 8:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.