HotKeys refactoring

Discuss the future of Warzone 2100 with us.
Post Reply
User avatar
Prot
Trained
Trained
Posts: 242
Joined: 29 Nov 2010, 12:41

HotKeys refactoring

Post by Prot »

I'd like to talk about hotkeys. For some reason, initially in the game hot keys are made in order to complicate the life of players, well, or they are made for pianists.
Almost all the necessary commands are assigned to several keyboard shortcuts(ex. Shift+ Ctrl+ etc.), although the commands of the first importance should be assigned to the fastest execution with one key.
Of course, professional gamers first of all reassign the keys for themselves like Ctrl+A to just single "A", Ctrl+C to single C and so on, but the problem is that some keys are still impossible to reassign (F1-F6), and some important functions are not even pre-assigned ("Next factory", "Next labs" etc.).
I really interestingly, did call menu all factories/laboratories(hotkey penta-menu F1-F6), and then fuss and clicking with the mouse more important instant call "Next factory"?
But these are my thoughts, although it would not be bad to give the opportunity to reassign F1-F6 and here's why:
The Russian community of players told me about a hidden feature that I did not even suspect, and which is not described anywhere in the documentation.
I'm talking about markers / anchors that you can set a position on the map, and then quickly return to it.
I was very surprised, and happy enough, that in warzone2100 there is something similar as, for example, in StarCraft. This will greatly facilitate the game, using hot keys, but not everything was so simple, and there is a bad catch.
I found functions in the source code responsible for these actions:
keymap.cpp line 552

Code: Select all

/* Allows _new_ mappings to be made at runtime */
static bool checkQwertyKeys()
{
    KEY_CODE qKey;
    UDWORD tableEntry;
    bool aquired = false;

    /* Are we trying to make a new map marker? */
    if (keyDown(KEY_LALT))
    {
        /* Did we press a key */
        qKey = getQwertyKey();
        if (qKey)
        {
            tableEntry = asciiKeyCodeToTable(qKey);
            /* We're assigning something to the key */
            debug(LOG_NEVER, "Assigning keymapping to tableEntry: %i", tableEntry);
            if (qwertyKeyMappings[tableEntry].psMapping)
            {
                /* Get rid of the old mapping on this key if there was one */
                keyRemoveMappingPt(qwertyKeyMappings[tableEntry].psMapping);
            }
            /* Now add the new one for this location */
            qwertyKeyMappings[tableEntry].psMapping =
                keyAddMapping(KEYMAP_ALWAYS, KEY_LSHIFT, qKey, KEYMAP_PRESSED, kf_JumpToMapMarker, "Jump to new map marker");
            aquired = true;

            /* Store away the position and view angle */
            qwertyKeyMappings[tableEntry].xPos = player.p.x;
            qwertyKeyMappings[tableEntry].yPos = player.p.z;
            qwertyKeyMappings[tableEntry].spin = player.r.y;
        }
    }
    return aquired;
}
As you can see, the function works by reassigning the keys "on the fly" during the match. This is very good on the one hand, but on the other hand, the assignment of the hardcode keys are spelled out on the ALT key + any "qwerty"-key. That immediately causes conflict with such combinations as ALT+S, ALT+H etc.
And then worse, because the jump at the marker/anchor hardcoded written on the SHIFT key which causes even more conflicts with "Shift+" hotkey combinations like Shift+A, Shift+C and so on.
Of course, working with markers on the map is a very, very necessary thing in the game, but it is implemented very poorly, without a description in the documentation, and without the possibility of reassignment.

I think it would be nice to be able to untie the functions of the F1-F6 quick menu from these keys, of course, for those who are used to them, but give the opportunity to reconfigure them.
The way I see the use of markers on the map is to assign them via Ctrl+F1-F12, and jump to a place by pressing just one F1-F12 key with no extra combinations(like StarCraft).
Let's be honest, we need to simplify everything related to hotkeys. I don't see the point in complex combinations with extra meta keys like Shift+ Alt+ Ctrl + players are not pianists ;)
nick87720z
Trained
Trained
Posts: 130
Joined: 25 Feb 2014, 16:37

Re: HotKeys refactoring

Post by nick87720z »

Specially for F1..F6 - imho, it is just easy to remember. As for next factory, lab, etc - I did it not so long ago, and I found it convenient fo have same F1..F6 with some modifier. I.e, to quickly setup production, you go to F1 to see factories, while setting another finger to modifier (I used Shift or so), then go through factories, doing setup. Same for labs.

There is one inconvenience - different "next factory" actions for ground, cyborg factories, and nothing for vtol (I would prefer to go through all 15 factories with one shortcut instead of remembering, which for what factory type, since they are in one list).

Same for trucks (in build menu) - F3 build menu, Shift+F3 - iterating trucks (one wish for development - highlight selected trucks in ribbon, as if selected by clicking unit itself or in ribbon).

Edit
Btw, it is possible to get rid of separate "select next factory/lab/truck/commander" actions if proper action automatically performed on second press of same key. I.e., F1 could open production menu if not opened (or in different menu), otherwise act like "next factory" (at least this key should traverse through all types of factories). The only advantage for special "next X" keys is that they work immediately before opening menu, but it is still usually necessary to open proper action menu.
Those, who sacrifice culture for bit of freedom don't diserve any.
Post Reply