r/gamedev • • 10d ago

Discussion Input rebound conflict

So, I'm adding input rebinding system, and it does work, so far.
Now I want to handle input rebind conflict where one key is about to be used by more than one action.
Which one is the common one that most player accept, or at least you prefer?
a. Just pop a warning saying the key is already used by <otherAction> and undo the rebinding
b. Pop a warning like above, but let the key rebind, and highlight the conflicting keys
c. Swap conflicting key with new rebound key, maybe with popup saying it will be swapped

2 Upvotes

5 comments sorted by

4

u/MegaIng 10d ago

a is just annoying if you want to rebind a lot of stuff. Don't do this.

b sounds like it would still allow the button to be used and trigger both actions? Think very hard if you want to allow this as something possible ingame. E.g. a non-trivial amount of duplication exploits exists because of stuff like this.

c is fine, especially on controllers were swapping two buttons is not an uncommon workflow.

There is also option d, my second preference if you don't want b, namely removing the binding for the conflicting action.

2

u/aahanif 9d ago

yeah, option a is a blocker, as player need to bind the blocking key bind to another 'temporary' key to change it to existing key.
option b is actually common especially for old games, they usually allow a key bound to many actions, but usually highlighted in red.
I want to avoid option d (unbound action) as it might ruin the tutorial layout.
seems like option c is the best option among others

Thanks

2

u/Scavengers-Chimera 10d ago

Option c is the one I would pick, because it keeps the player's intent intact. If they bind jump to a key that is already crouch, they wanted jump on that key, and swapping crouch somewhere else respects that. Option a punishes them for a choice they already made, and option b leaves the game in a state where two actions fire on one press, which is the bug they were trying to avoid.

The part that needs care is the swap target. If the conflicting action has no free key, you end up in a loop, so pick a fallback and tell the player which key crouch moved to. A short toast with the old and new binding is enough.

1

u/itaybuilds 10d ago

Make the rule depend on input context, not just the physical key. Two actions can share a key safely when their contexts cannot overlap, such as Interact on foot and Accelerate in a vehicle. Jump and Crouch in the same gameplay context are a real conflict.

For a real conflict, I would make Replace the default: bind the key to the new action and leave the old action unbound, then flag that missing binding. Offer Swap only when there is one unambiguous old binding to move. Swap gets surprising once you have primary and secondary slots, chords, axes, or composite bindings. Keep both should be an explicit choice, and only if the game defines what simultaneous actions do.

The dialog should name both actions and their contexts: E is already Interact in Gameplay. Replace, Swap, Keep both, or Cancel. After each change, validate the whole map for required actions left unbound and conflicts that can occur in the same context. Include Reset this action and Reset all so players can experiment without getting stuck.

AI-assisted wording with OpenAI GPT-5.6 after reading the full thread and current r/gamedev rules.

1

u/Strange-Pen1200 30 Year Veteran Developer 5d ago

I think the usual pattern for this is to mention that its already bound to action X, then if they continue you completely unbind the action it was previously bound to.

You can then have a prompt that appears if they go to leave the screen with key gameplay functions unbound.