First I tell you the current controls weirdness, then I tell you what I think is wrong with that and then I make a proposal to clean this mess up.
Here is what I think is wrong with the current system:
The worst keybindings are those for building, using and sneaking.
The building key is the right mouse button. Actually it is not a building key, it is a combined building and using key.
- Normally, you will build the selected node on the pointed node.
- But if the pointed node reacts on on_rightclick, this function is used instead and the node is not built.
- To actually be able to reliably build something, you have to press [Build]+[Sneak].
And sneaking has, based on the context, 3 different meanings:
- It is used to walk slower and sneak to avoid falling off edges. This only works if you stand on solid ground
- It is used to descent on ladders, in water or while in fly mode. But you only descent ladders if you you haven’t set “‘use’ = climb down”
- You have to press [Build]+[Sneak] to actually reliably build, otherwise, you may use a node accidentally
Even the attack key is not unambigious:
- Normally it means you punch with your current item
- But if the current item is eatable, you eat this item instead!
- If you are pointing to a dropped item, you collect it
The use key is mostly useless (funny, right?). As far I know, there are only 2 uses:
- If you hold it down, you can walk faster with it, if you are in fast mode but not in fly mode.
- If you set it in the options that way, you can alternatively descent with the use key.
- But you can’t fly faster with E if you are in fast mode and in fly mode. In this case, you are always fast. WTF? You can’t even use the Sneak key to slow down, since this would be descending, unless you flipped it with E.
Edit: Okay, another problem:
The [F4] key means “disable camera updates”. This cryptic key can be a game-breaker for the clueless. “camera updates” means that the scene is drawn if you walk throughout the world. If this is off, the world is not drawn for you anymore when you hit the border or simply turn around. This key is therefore completely useless for gameplay. It is easy to hit the F4 key accidentally and people wouldn’t understand the meaning of “camera updates”. I have seen at least one let’s play video of someone who accidentally hit the key and had no idea what happened. The scene didn’t update anymore, he was confused, restart the game and thought it was a bug …
EDIT 2: Thankfully, this has been fixed. This key works only in debug builds or by setting is explicitly in minetest.conf)
Now the problems I see with this are:
- The meaning of some keys is highly context dependent
- Many keys act in unexpectect ways and are not self-explanationary
- The so-called “use” key is a misnomer
- Minetest lacks many keys to unambigiously tell Minetest to do X: using a node, using a tool, collecting an item, ascending, descending
- A switch to change the meaning of Sneak and Use on ladders and flying does only add to the weirdness of the controls and is of no real help.
- The Lua API provides a function “on_rightclick”. This motivates modders to further abuse that key for stuff because the function does not say anything about its intended semantics. Also this does not fit together with other function names. There is “on_punch” but not a “on_leftclick”, for example.
- There is no dedicated key binding for using a certain wielded item when the use is something different than punching. This leads to weird hacks as seen in the Screwdriver mod.
- It is not possible to punch with comestibles. This is needlessly inconsistent, since you can punch with almost everything else (using hand time if it’s not a real tool).
- F4 is a game-breaker for the clueless. (fixed)
Based on these problems, I suggest to make the following changes:
- Introduce the concept of “primary tool use” and “secondary tool use”. There are a few tools where one use key may not be enough. The secondary tool use could be used to standarize that and to avoid hacky solutions as seen on the Screwdriver mod. Note that “item use” refers to any use which is not mining/attacking/punching; this is special and has its own key.
- Introduce the policiy of “one key = one meaning”. Give seperate key assignments to these actions (new assignments in bold):
- Attack / Punch with the wielded item (includes mining)
- Collect pointed_thing
- Jump (only possible when standing on solid ground)
- Sneak (without all its hacky extra meanings!)
- Build (always build, even to usable nodes like furnaces)
- Throw wielded item away.
- Using the wielded item (meaning depends on item type to allow maximum modder flexibiliy, should be used when punching would not be appropriate)
- Secondary use of wielded item (again the meaning depends on item type)
- Interact with pointed node (excludes collecting and mining it)
- Keybindings for the 6 spatial directions:
- Forwards
- Backwards
- Left
- Right
- Ascent (in fly mode, on ladders or in water) (differs from jumping!)
- Descent (in fly mode, on ladders or in water)
- Toggle fast mode (player is always fast in fast mode, no matter if flying or not)
- Toggle fly mode
- Toggle noclip mode
- Remove the option “‘use’ = climb down” because climbing down and using are now treated seperately.
- Based on the above, there have to be serveral API changes:
- Deprecate the function “on_rightclick”.
- For items, introduce the function “on_primary_item_use”. Given parameters are: itemstack (ItemStack of used tool), user (player reference to user), pointed_thing (if the player points to something; if not, is nil. The function does not have to care about the pointet_thing, it is there for convenience reasons). Minetest does not care about the return value. By default, this function is a no-op.
- For items, introduce the function “on_secondary_item_use”. It works the same way as “on_primary_item_use”, but is only for the secondary item use.
- For nodes, introduce the function “on_interact”. This is called when a player presses the “interact” key on the node. Given parameters are: pos (node position), node (node def.), user (player ref.), pointed_thing (the same, but as a pointed_thing), itemstack (the used tool). By default, this function is a no-op.
- For node defintions, introduce the parameter “collectable”. If it is true, the node can be collected if the player points to it and presses the collect key. By default, it is false.
- For entities (includes dropped items), maybe introduce the callback “on_collect(itemstack, collector)”. The function shall return an ItemStack which goes to the collector. Or nil, if the entity is not allowed to be collected. Dropped items have an obvious default function, I am unsure for other entities, but I think their default function should return nil (=not collectable).
- Make the F4 key a no-op by default; only enable it if there is a parameter set in minetest.conf. This parameter is by default off in release builds and on in debug builds. (done in Minetest 0.4.12))
Here are some examples for the key bindings I suggested:
Collect: Taking a torch from a wall, take a dropped itemstack from the floor. Note that not everything can be collected.
Primary item use: Eating comestibles, applying tool on pointed_thing (screwdriver, bucket, hoe). No-op by default.
Secondary item use: Changing tool mode (screwdriver mode, bridge tool mode). Other uses may come up later, who knows? Again, a no-op by default.
Interact pointed node: Editing sign, opening chest menu, opening furnace menu, open closed door, close open door. Excludes mining it and collecting it! If the player presses interact but nothing is pointed at, then nothing happens.
Whew, that’s it. Especially I want to hear feedback from the core developers about how realistic my proposals are. I want to hear from players wheather they think my proposal would actually improve something. I want to hear if other people around here think there is a problem with the controls and the part of the Lua API which interacts with it.
Edit: I added some stuff about F4 “disable camera updates”.
Edit 2: The F4 problem has been fixed. Finally!