Jump to content

Poll: hotkey presets?  

8 members have voted

  1. 1. Would you like to have hotkey presets in 0 A.D.?



Recommended Posts

I've been working on a new feature to add to the game. The idea is to provide an easy way to preserve our hotkeys, create templates, and quickly switch between them. Potentially export presets into a plain text file.

I currently have a basic implementation that covers the minimum functionality: duplicating and deleting hotkey presets, while always keeping a Default Preset as a baseline.

image.thumb.png.4dc238cf76c2aab6859119ea68dc6c8c.png

image.thumb.png.cc5edbcee61520fabd6e7f7a9c5ade89.png

image.thumb.png.86e5a19ce0ac2b4641e21cc09ea917d0.png

 

The presets are stored in binaries\data\mods\public\moddata\hotkeypresets.json (in theory, this would be mods/user in a compiled redistributable version). Just like with user.cfg, this .json file only stores hotkeys that differ from the default hotkeys. Initially, I wanted to use an INI-style file structure, but I'm not sure if there is an equivalent function to WriteJSONFile for that. I chose this location because it is already included in the whitelist, so I can avoid making changes to the Engine. I also didn't want to use user.cfg and add dozens of extra lines to it.

So basically, the code adds a .json file that stores, reads, and modifies hotkey presets, and then copies/applies the active hotkeys to user.cfg.

As for mods that interact with hotkeys, the idea is to change the current workflow as little as possible. So if there are any details I should take into account from a modding perspective, please let me know.

Do you think this functionality would be useful to have?

And, especially for the devs, does this seem like an appropriate approach, or would you recommend a better alternative?

  • Like 4
  • Thanks 1
Link to comment
Share on other sites

  • 1 month later...

Preset hotkey profiles would be a genuine quality-of-life win, especially for players coming from other RTS games who already have years of muscle memory. Right now rebinding every key by hand is the tax you pay for switching, and most people just give up and play handicapped. Shipping two or three sensible presets — the current default, a grid-style layout, and maybe a classic StarCraft/AoE-flavored set — would lower the entry barrier without taking anything away from players who like the existing scheme. It also gives the tutorial something concrete to point at instead of a wall of unbound keys.

Link to comment
Share on other sites

Definitely useful. Your approach is smart JSON diff plus user. cfg keeps things clean and avoids engine changes. Just make sure there's an API hook so other mods can interact with the presets easily.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...