[WIP] Input mapping

Looks pretty good :+1:

2 Likes

Updated inspired by godot input map (the only i found a code reference to follow). image

Edit: i think it is complete now, if anyone still have any suggestion please tell me! :slight_smile:

Eventually i would do a UI for it when i get motivated.

2 Likes

Updated inspired by godot input map

Very cool!

Eventually i would do a UI for it when i get motivated.

That sounds pretty rad. :smile:

1 Like

After trying it by myself i could figure out many situations and then change a lot of things in the input map.

The changes:

  • Now the ActionMap and the AxisMap is not just the samething and the later does not return a vector anymore, just a single axis. In other words, the axis map does not does normalization anymore (this is non sense). It is how the Unreal Engine does.

  • The scale parameter is now perfect for me. Is possible to control mouse sensitivity, character speed, etc. without have any conflict with the normalization. The scale is not dependent on which is the current config. It will return the biggest scale of the pressed input, no matter if gamepad, mouse or keyboard.

  • Bad news is that is very tedious to setup the inputs now, but this new layout will save time for a possible implementation of UI.

  • Mouse and keyboard is now handled together. This allows to mix mouse modifiers and keyboard modifiers for the same input map.

  • Cleaner code.

A bit confuse now, but in short, there is four types of keys:

For action maps:

  • Keys: keyboard and gamepad buttons.
  • Displacement Keys: mouse buttons (includes movement) and gamepad sticks)

For axis maps:

  • The same as above, but modifiers are the negative keys and keys/displacement keys are the positive keys.

I think that it is all. Everything is working as it should and only the gamepad stills need to be tested as i don’t have one with me. You can test the changes in the github version, i will push a PR tomorrow if there is not contrary suggestion.

For the FSM i also have tested it and looks like it is fine. Only that thing with parent states i couldn’t figure out, but i don’t had missed anything regarding this while using it. I’ve done a few changes to that too and i will push a PR later.

3 Likes