I’m trying to decide on the most graceful way to handle a design decision regarding type-specific input action bindings.
At run-time, a player is able to change which pawn they are currently in control of and there is a hierarchy of various pawn types which each need to provide their own action mappings specific to their own type and players need to be able to customize their own keybinds to these mappings. The best way to describe it would be Input action map hot-swapping.
There’s some great ideas in the community for rebinding input action mappings at run-time within the wiki/forums and here on answerhub but I haven’t encountered any reference material on this specific requirement yet.
I’m trying to find a graceful way to do this while keeping performance in mind. The only feasible solution I’ve been able to come up with so far is to store separate configs for each required type in a special directory and, during game initialization, read each of these files and cache them in an array of input action maps. Then when a player possesses a new pawn where a swap is needed, the map would be grabbed from the cached array and assigned to the current settings.
Am I looking in the right direction here or anyone have a nicer way to do this?
I should mention, this is all planned to be handled in c++ only but I would prefer solutions where the mappings are accessible from blueprints for the sake of user keybind UI’s similar to the examples found within the community.