nsmryan / RustRoguelike

This Rust Roguelike is a Roguelike written in Rust.
17 stars 3 forks source link

Interaction UI/UX #188

Open MicroChasm opened 3 years ago

MicroChasm commented 3 years ago

We should note examples of interaction that are powerful or gratifying, and outline how they work.

MicroChasm commented 3 years ago

Into The Breach: There is quite a bit of UI, but everything that is represented through text is also represented through icons or bars. There is a lot of information displayed visually on the map. All interaction can be done through the mouse, but action selections can also be done using the keyboard. There is some sophisticated UI, including animations to show how moves work, mouse-overs, etc. The UI/UX is set up specifically for slow, turned-based, squad-based actions. The way the user interacts with the game is most likely something like this-- The user surveys the board, taking in information about locations of mechs, veks, buildings, tile-type (water, buildings, mountains), and tile modifiers like acid or conveyer belts. The user then uses the mouse-over to gather the last bits of necessary info, like how much damage a vek's attack does, or what the enemy turn order will look like. Next the user will select a mech and take an action, usually a move, and then either select an action or select another mech. The UI is exceedingly clear and contains a lot of info, but does not have full mouse support. There can also be a lot to keep in your mind at once, as you plan a turn with three mechs, considering each vek, their attack, their damage, etc. There is also quite a bit of moving the mouse all around the screen. It's useable and informative but I think it is more utilitarian than it is elegant.

MicroChasm commented 3 years ago

3D Modeling:

There is really too much to cover here, but I want to get down a few concepts. In Maya, there isn't really a concept of being in "edit mode" or "object mode" as there is in both Blender and 3ds Max. In Maya, the mode are more based on selection types, so selecting objects is on the same level as selecting vertices or faces.

In Max, there isn't any easy way to modify two objects at the same time, because each objects editing mode is contained within the object itself as a modifier. Because Maya doesn't have this setup, you can select multiple objects and then move to the Select Vertices mode and you will be able to select the vertices on more than one object at the same time.

In Max, when I want to make a change to an object, say making an edge loop, I will usually use the topbar, called the ribbon menu, to select the Edge Loop icon. In Maya, I used to select the edge loop function through the Edit Mesh menu, which is even more cumbersome because it requires you to go into a sub-menu to make your action selection. Now when I am using Maya I tend to go to the Modeling Toolkit menu, which I have open as a tab in the UI, and enter the Quad Draw mode. Once you are in Quad Draw mode, you can make an edge loop by holding Ctrl.

Quad Draw is a modifier-heavy mode, with additional functions being exposed when you use Alt, Ctrl, Shift, and even Tab. The use of modifiers not only helps with reducing key presses, but just as importantly, it keeps the mouse and the users eye in the center of the screen, so that you don't have to be moving your attention off to the side and then back to the center over and over. This is also the benefit of the radial menu-- not only does it keep your cursor and your attention in the center of the screen, but it also helps to keep your attention on the screen overall instead of being split between the screen and the keyboard.

MicroChasm commented 3 years ago

DCSS:

DCSS has a lot that it needs to do, and it achieves its actions with menus and keys that do really specific things.

At the simplest interaction, Crawl uses bump-to-attack. At its most complex, you have to open the magic menu, select a spell, then use the targeting system to select a tile, and then enact the spell.

There are a lot of specific keys to take distinct actions, like "W"earing armor or "w"ielding a weapon. You can "q"uaff or "r"ead, which brings up a menu showing only the items that can accept that action. While this does limit the need to search through a large menu whenever you have to do anything, it does require you to learn a fair number of action keys. There is no general use key as there is in Brogue. In fact, even if you open your inventory and select a scroll, you still have to use the "r" key to read it, even though you have narrowed your selection through the menus.

Crawl also has a lot of shortcuts, which add a layer of complexity to new players but makes the game a lot easier to interact with for experienced players. It is pretty common to see people on Reddit learning for the first time that the ' key switches between weapons which have been adjusted to the "a" and "b" slots in the inventory. You can also create macros, which are almost necessary to make spellcasting bearable. Even with macros, playing as a mage requires many more key presses than playing a combat character.

The complexity of the world of Crawl is made more manageable by the search commands and the ability use the info mode to automatically select up-stairs, down-stairs, to move the interaction view between floors, or to travel to specific places with only a few key presses. The player is given a lot of control to move on both a micro-level, where they are moving their avatar one square at a time, and a macro-level, where they interacting move with the dungeon branch layout instead of individual tiles.

Auto-explore is extremely useful because of how large the levels are, and you also have shift-direction to take multiple moves with one press.

Crawl is a menu-heavy game. To list the ones that I can think of off the top of my head, there is inventory, spell list, spell memorization list, dungeon info, character info, abilities menu, god menu, quaff list, wield list, wear list, read list, evoke list, and skill training list.

I've done a write-up of the info mode elsewhere, but in short Crawl has an info mode the is used entirely for gather information, rather than info and targeting. The targeting mode is similar and does provide some information as well.

The targeting mode also allows for marking up the map with exclusion zones and exclusions on individual tiles. Although this is a gamey thing to do, since it doesn't really have an analog in real life, it does actually make it feel like you are interacting with the game more closely, like you can touch it in some way instead of just moving through it.

Overall, Crawl offers many ways to interact with the world, in a true traditional roguelike way, and it simplifies the interaction in many ways, but

MicroChasm commented 3 years ago

General thoughts:

One possible interaction method that is perhaps too complex but might be interesting is to set up actions as-- state -> modifier -> direction. So the player would choose a state, say sneaking, running, or interacting, then choose a modifier, say using an item or ability, and then a direction. If they don't choose a state then the state from the previous turn is maintained, and if they don't choose a modifier then their action is assumed to be movement.

MicroChasm commented 3 years ago

Jupiter Hell:

Pretty simple interaction here. Jupiter Hell uses 4-directional movement, F to fire, R to reload, number keys to switch weapons. The firing mode auto-targets, so most of the time you only have to press one key. You can redirect your fire using T to Target.

The target mode lets you move a cursor between tiles, and gives simple info about that tile in the top right UI. There are only two ways out of the target mode-- either canceling with ESC or firing with F. This makes it feel like an action-centered interaction-- it's not primarily for information but rather a tool for choosing a target.

There are some additional menus like V to view skills and I for inventory. When you select a grenade you then choose a place to throw it-- it is an immediate interaction. There is no keyboard key for throwing, the action is created through the inventory menu. There is no stored throwing item like in Crawl, and the grenade is never considered to be equipped instead of a weapon. The grenade throwing can be canceled using ESC.

If you target something and then escape the targeting state, and then re-enter the targeting state, your previous target is stored.

There is bump-to-attack in melee, and interacting with environmental objects is bump-to-interact, saving an additional keypress.

Overall the game feels like it is based on putting the fewest steps between you and your ability to shoot stuff.

nsmryan commented 3 years ago

Vim

Modes

vim has three modes insert- direct, small scale, manual normal- compressed, count + action + range command- full syntax, many possible commands

this is similar to rl in having direct commands like movement, and compressed sequences for actions- throw 3 for example.

one of the main advantages of modes is to store information in state, which makes common actions fast (they don't have to re-establish a context).

Concepts

Prefixed

prefix for action (Throw, Use, Skill) followed by a selection.

Radial

mouse use select tile and get radial menu might be able to list all actions radially- instead of selecting throw and then an item, you might be able to select the item under the throw entry.

keyboard use- press key to enter selection, highlight tiles with actions and move between them give list of actions to be taken could allow move complex movements, or assign a key to each tile that you can press to jump there

then you either- select and action and go from there, or have actions listed out for you

Store in UI

A system with weapons and actions displayed, with one hightlighted. By default movement keys move, but if you press a key like space, then the movement key applies the highlighted action.

to select a different one either: a row of characters, like qwert for weapons, asdf for actions

a letter for each action and for each weapon

a selection mode where you press 'u' and then a number which selects from the row.

Splunky

splunky is interesting in that it is very context sensitive- there are very few buttons, only a few items, and most things simply modify movement like jumping higher or sticking to walls. these don't require additional buttons- they modify what happens when a button is pressed

Emacs

emacs using chords, which provides access to variations of themes.

this could be useful if there are only a few modifiers, especially if actions usually occur with same directions as movement.

this doesn't seem applicable- its hard to learn and the types of interactions don't seem to fit that well.

ctrl-direction to throw alt-direction to use item skills seem the hardest to encode- they are varied and don't have a simply scheme. maybe a rework of skills to fit a template would help this.

MicroChasm commented 3 years ago

I think it's interesting to think about this concept of where the information for your actions is stored. It might be interesting to try to list out where the information can be stored. This is my best attempt:

In context, meaning that the same keypress will have different outcomes depending on the board state.

In modifiers, where one action, like a direction press, might have different outcomes depending on an additional keypress that happened just before.

In menus, where the actions are limited by a list of menu items.

On the keyboard, where each different action uses a separate key.

In states, which are like more permanent modifiers that have to be escaped or switched.

In the UI, where there is a different button for each action.

MicroChasm commented 3 years ago

Here are two other ways to store information in an interaction system:

Number of presses. You could have a short list of actions, which you select by scrolling through them by pressing a key, with the list looping bottom to top.

Duration of key press. This is a pretty unusual one, but you could have options cycle over an interval as the player holds the key.

Both of these have a disadvantage in that they will often increase the amount or duration of key presses. However, it is a way to decrease the number of different keys, and it is an interaction method that might work well for someone with limited movement or limited use of their hands.

MicroChasm commented 3 years ago

Modifier-Style Shift toggles run from walk while held alt activates throwing or alternate ability option when held select item or ability by holding z, x, c, v, b Enter action using direction alternatively, you use these modifiers and directions, and then enter using space

Cursor-style You have a constant cursor, which you can move around the board. There is a secondary cursor that shows the currently-selected tile. These are the same if the first cursor is currently on a valid tile. You select an action by using modifiers like in emacs mode, and then enter the action using space. If you just move the cursor and press space, you will move to that spot. Maybe have insertion mode where movements are direct, and normal mode where you make selections with modifiers

For the phone version, we can display all actions on the screen at once, you select options, potentially from different information hierarchies. Your modifiers (run, use item, throw, etc) remain highlighted, and then you enter the action by selecting a tile with a click and drag.

nsmryan commented 3 years ago

A clarification- it seems to me at the moment that there might only need to be one modifier. I was prototyping the chord style in the game, and it seems like: primary movement is a walk, alt is a run. primary use item is just using it, alt is throw primary skill is just using it, alt may be dependent on the skill.

Is this true?

nsmryan commented 3 years ago

Changes to input system for cursor: space is a new cursor command, which checks for modifiers and zxcvb for input. movement keys are the same, but move the cursor instead of the player.

Variations: Shift enables cursor movement. Once used, cursor snaps back to player. Or cursor stays in last location. Shift enables chord system. Some key (Tab) switches chords and cursor. Consider Tab to switch default mode, and shift to temporarily switch modes.

Notes: Try to keep cursor and chord modifiers and selections the same. Consider a way to move the cursor more quickly Consider a way to merge the systems, so that actions either occur on the player or the cursor. This doesn't seem to work out as far as we can determine.

nsmryan commented 3 years ago

UI Changes: Ultimately it would be good to draw some UI for this, even in the Rust game. The idea would be a line along the bottom of the screen which highlights which selections have been made, and which are available, to help the player work out their action. These should be visually clear and slightly separated to make things very clear in one's peripheral vision.

nsmryan commented 3 years ago

Current status: Cursor and chord systems are in place. They are a little hacky to get both working together, but they are in place. Applying the cursor (pressing space) just re-uses the chord system. The problem with this is that throwing should throw to the cursor, but instead throws in a direction. This is true for other actions as well.

One note- moving towards the cursor currently does some path finding. I think this is better then just going in its direction.

There is a visual for the cursor, but not the 'valid cursor' location yet.

nsmryan commented 3 years ago

Current issues: There is some kind of issue where actions are taken twice. Skill selections do not use the cursor or directions- they enter selection mode. Animations do not play out when using the new system.

MicroChasm commented 3 years ago

Things that need to be changed in order to evaluate the two systems:

Alternate ability option Grass throw-- default throws a line of grass, while alternate places a patch at your feet and around you in a plus Grass blade-- default is to create a sword, alternate is to create a dagger

Shadow/Alt cursor in some form This should, in its simplest form, show the next tile that would be moved to

Remove current tile selection functionality

nsmryan commented 3 years ago

The system has been updated in the cursor branch. It merges the two systems (chord and space bar), and uses selections from the direction (for chords), or the cursor position. I redid a bit of the input system, such that it now translates external inputs into an internal input format. This should make unity communication easier as inputs don't need to know anything about the state of the game.

I haven't added the visual yet, or the new abilities. It could also use some play testing.

nsmryan commented 3 years ago

I added the grass sword/dagger alternate.

nsmryan commented 3 years ago

I added a kind of cursor visual. Its currently the player's own animation, but more transparent.

We should probably discuss what to use for the cursor, and for the shadow cursor.

nsmryan commented 3 years ago

Three ideas for how a cursor might work:

Absolute/Relative Mode (double cursor mode)- toggle cursor modes. One mode is current system, other mode the cursor stays in relative position with player, but also effectively re-centers when moves.

Layered- standing/running actions are immediate (with running when holding shift), while crouching actions use the cursor.

Normal- most actions use the cursor, but movement does not. Movement is all immediate, as with other games.