Stop inventory shuffling and implement better macros UI

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • t4nk
    Swordsman
    • May 2016
    • 336

    Stop inventory shuffling and implement better macros UI

    Anomymous Hero's post reminded me of that.
    Inventory shuffling is just an awful and indefensible thing. The only argument I've heard in favor of it is that it is neat to have your junk sorted. But you don't have to shuffle the inventory (meaning player->upkeep->inven array) for that. It could be done in the UI (item menu) and presented like that:
    Code:
    f) a Book of Magic Spells [Magic for Beginners]
    e) 5 Flasks of Oil
    n) a Potion of Berserk Strength
    c) 3 Scrolls of Phase Door
    a) a Scroll of Word of Recall
    That is, the items are sorted, but the menu tags are not. So if your book is in 'f' slot, it will be there no matter what you pick up or drop.
    Then it will be much easier to implement better macros ui - the macros will be tied to inventory slots, rather then to the items. E.g., you press F1 and that uses slot 'm' (or whatever slot you set F1 to select), and uses the item there, similar to DO_CMD_USE (a bit of additional logic will be needed for spells). The macro menu could become a part of context menu - say, you open inventory (with 'i') and select slot 'm'; if there is an item there, "Add macro" will be added to item's context menu; like so:
    Code:
    a) Study
    b) Browse
    c) Drop
    d) Throw
    e) Macro
    f) Ignore
    If there is no item, it will display a menu with only "Macro" entry.
    There are some corner cases, for example, if F1 selects 't' slot, and the item in 't' gets destroyed and you later pick up an item and it goes into 't', that will change the meaning of F1 macro. If that's a problem, macros could be invalidated when you lose an item in that slot. For example, your only Magic for Beginners is in 't' and it got burned; then F1 macro is invalidated and will have to be recreated.
    There could also be a method to swap items. E.g., you have Magic for Beginners in 't' and Word of Recall in 'a', and you want it to be the other way around. So you select slot 'a'; the context menu displays (among other things) "Swap item"; if you choose that, it asks which slot to swap with. Say, you answered 't'; now Word of Recall is in 't' and Magic for Beginners is in 'a'. So you can manually sort inventory that way, if you want.

    Takkaria (I think) mentioned another way to implement better macros, using tval/sval, but there are some problems with that. For example, should 'w' (wield) command be supported? If yes (and I think that's reasonable), then tval and sval alone are not good enough for that, and it's necessary to track the exact item.

    In any case, macros tied to inventory slots would be easier to implement, easier for player (especially new ones!) to understand, and as a bonus, it will require to get rid of inventory shuffling, which is an entirely good and desirable thing.
    Thoughts?
  • Derakon
    Prophet
    • Dec 2009
    • 9022

    #2
    I am used to a sorted inventory, and would absolutely hate it if my inventory weren't tidy. It's one of the things that bugged me most about NetHack back in the day. So there's one counterexample.

    I do definitely think that we need a better keymap system, but I don't think that unsorted inventory is the way to go about it, chiefly because of those corner cases you mentioned. Keymaps really should be "do something with this item", and the keymap should be smart enough to know how specific to be. Keymaps that use a specific spellbook should always "target" that spellbook even if it's in a different slot, or you found an enchanted fireproof version and ditched the store-bought one. Keymaps that use equipment need to be tied to that specific item and are invalidated if the item isn't available...except that keymaps that use archery can go by slot, because ammo is roughly sorted by power and you usually want to be firing your cheapest ammo.

    One simple way to get most of this is to allow for selecting items by substring. So e.g. you could do "m@Beginners\ra" to cast Magic Missile, because "Beginners" is part of the title of the spellbook that has Magic Missile in its first spell slot. ToME2 uses a system roughly like this.

    Comment

    • t4nk
      Swordsman
      • May 2016
      • 336

      #3
      Originally posted by Derakon
      I am used to a sorted inventory, and would absolutely hate it if my inventory weren't tidy. It's one of the things that bugged me most about NetHack back in the day. So there's one counterexample.
      And how's that not 'tidy':
      Code:
      f) a Book of Magic Spells [Magic for Beginners]
      e) 5 Flasks of Oil
      n) a Potion of Berserk Strength
      c) 3 Scrolls of Phase Door
      a) a Scroll of Word of Recall
      That's exactly how Angband sorts items?
      Or are you saying that it's important to you to have inventory tags ("a)", "b)", etc.) in ASCIIbetical order? (which is as arbitrary as any other order)

      I do definitely think that we need a better keymap system, but I don't think that unsorted inventory is the way to go about it, chiefly because of those corner cases you mentioned. Keymaps really should be "do something with this item", and the keymap should be smart enough to know how specific to be. Keymaps that use a specific spellbook should always "target" that spellbook even if it's in a different slot, or you found an enchanted fireproof version and ditched the store-bought one. Keymaps that use equipment need to be tied to that specific item and are invalidated if the item isn't available...except that keymaps that use archery can go by slot, because ammo is roughly sorted by power and you usually want to be firing your cheapest ammo.
      1) It still doesn't solve problems with inventory shuffling (such as the fact that typing "maa" into the game is a noob trap)
      2) No one will do it, while someone (namely, I) could actually implement what I proposed

      One simple way to get most of this is to allow for selecting items by substring. So e.g. you could do "m@Beginners\ra" to cast Magic Missile, because "Beginners" is part of the title of the spellbook that has Magic Missile in its first spell slot. ToME2 uses a system roughly like this
      That doesn't seem much better than the current system?

      Comment

      • Derakon
        Prophet
        • Dec 2009
        • 9022

        #4
        Originally posted by t4nk
        Or are you saying that it's important to you to have inventory tags ("a)", "b)", etc.) in ASCIIbetical order? (which is as arbitrary as any other order)
        That's exactly what I'm saying, and it's not arbitrary; it matches alphabetical order for English, which unfortunately Angband is rather intimately tied to. Come back to me when the game can easily be internationalized to other languages and we'll talk.

        1) It still doesn't solve problems with inventory shuffling (such as the fact that typing "maa" into the game is a noob trap)
        2) No one will do it, while someone (namely, I) could actually implement what I proposed
        You're daring me to dive into this, aren't you? I can do it, I just have other projects I'm working on that usually take priority.

        The way you fix the noob trap is to make it so you can set up keymaps while using the items you want to keymap. As was mentioned in another thread, when casting a spell, you should be able to hit a key to bind the spell to that key. Ditto when drinking a potion, reading a scroll, etc. Basically every item should have a "standard use action" (hey ho, Angband should have a unified use command) and binding a key to "do that action" should be a standard ability of the UI.


        That doesn't seem much better than the current system?
        It lets you refer to objects independent of the slot they're in, without needing any magic inscriptions. I mean, I love the power of Angband's inscription and keymap system, but it's completely non-discoverable.

        Comment

        • droof
          Apprentice
          • Dec 2013
          • 71

          #5
          Originally posted by t4nk
          2) No one will do it, while someone (namely, I) could actually implement what I proposed
          You definitely seem to know your way around the code. Wouldn't it be easier to just make the change and send the patch or pull request to the team?

          Comment

          • AnonymousHero
            Veteran
            • Jun 2007
            • 1393

            #6
            Originally posted by droof
            You definitely seem to know your way around the code. Wouldn't it be easier to just make the change and send the patch or pull request to the team?
            Don't be hasty, Master Meriadoc! It's not always just a question of "have you got an implementation?" -- sometimes there are higher-level concerns that supercede that. The more general approach is to ask if there's "interest" in trying something, obtaining that general interest and then perhaps implementing it for people to try. Or you can just usurp maintainership and do whatever you like! (That last bit was a joke!)

            Comment

            • t4nk
              Swordsman
              • May 2016
              • 336

              #7
              Originally posted by Derakon
              That's exactly what I'm saying, and it's not arbitrary; it matches alphabetical order for English, which unfortunately Angband is rather intimately tied to.
              And so what? That doesn't matter. Proof: DCSS displays items exactly like I said, and no one ever complained about it. So thats $some_big_number of examples, which perhaps compensates for one of you?

              Come back to me when the game can easily be internationalized to other languages and we'll talk.
              But I want to talk now, even if the codebase is ancient garbage.

              You're daring me to dive into this, aren't you? I can do it, I just have other projects I'm working on that usually take priority.
              So you're saying that you can, but you won't. Just like I said?

              Basically, your only counterargument is that you like "abcde" because it's 'tidy' and American? Ok, but that seems like a pretty weak counterargument to me. I mean, it's fine to make this tradeoff... why not?

              edit: Consider: currently the inventory (and quiver) look 'tidy' (to some people), but have very poor usability. If improving usability makes it look less tidy, why is it not a worthy tradeoff?

              You definitely seem to know your way around the code. Wouldn't it be easier to just make the change and send the patch or pull request to the team?
              Well, not if no one cares about this proposal...
              Last edited by t4nk; December 17, 2016, 01:48.

              Comment

              • Carnivean
                Knight
                • Sep 2013
                • 527

                #8
                Originally posted by t4nk
                Takkaria (I think) mentioned another way to implement better macros, using tval/sval, but there are some problems with that.
                Spells can use a variant of the squelch menu to have keys attached to them. This is about an easy for new players implementation as I can think of. It involves no mechanical knowledge to use.

                The game knows which book the spell is from, so applies the relevant macros invisibly to the user. I always map "spell:Identify" to F1 in my games. My menu interface would allow me to scroll through a list of known mage spells, find identify and apply a key to use to cast this spell.

                This allows you to ignore the inventory sorting issue, or make it optional and irrelevant to the macro process.

                Comment

                • Nick
                  Vanilla maintainer
                  • Apr 2007
                  • 9637

                  #9
                  Originally posted by t4nk
                  Thoughts?
                  I would suggest implementing it - as an option.

                  Angband has a significant long-term player base, to whom the current situation is second nature (like that dinosaur Derakon ). I can see the appeal of your idea, and would kind of like to try it, but I think just changing cold turkey would be very difficult for lots of people. Making it an option allows everyone to try it, and then a bit later on we can assess whether it's a success or not.
                  One for the Dark Lord on his dark throne
                  In the Land of Mordor where the Shadows lie.

                  Comment

                  • Sky
                    Veteran
                    • Oct 2016
                    • 2321

                    #10
                    I think *macros* as a whole need to die and be completely replaced by "fast action" which need to be built from the ground up, as actions which function without referencing the inventory at all.

                    So, if F1 is "zap rod of TO/query target" the engine needs to find a rod of TO, without needing the process of you inscribing that rod.

                    This might need every object to have a new invisible inscription added (like any modern game has a objectid# ) that the fast action UI automatically uses to set up the function.


                    Or essentially what Derakon said.
                    Last edited by Sky; December 17, 2016, 16:24.
                    "i can take this dracolich"

                    Comment

                    • Pete Mack
                      Prophet
                      • Apr 2007
                      • 6883

                      #11
                      Sky--
                      What we have now are keymaps. What you are describing *is* a macro, in the sense of task automation. It's a whole lot more complicated. Keymaps are perfectly adequate, so long as you have a standard set of preference files for automatic inscriptions and keymaps. It'd be worth making a standard one of these for users to customize. (You'd need two: one for each command binding option, and possibly two for each class.) But complicated macro systems are a huge pain in the ass for developers. I seriously would not want to deal with maintaining one again without being paid for it.

                      Comment

                      • t4nk
                        Swordsman
                        • May 2016
                        • 336

                        #12
                        Originally posted by Nick
                        I would suggest implementing it - as an option
                        No, I'm not adding it as an option.

                        Comment

                        • PowerDiver
                          Prophet
                          • Mar 2008
                          • 2820

                          #13
                          I implemented non-shuffling inventory once, got it mostly working, good enough to test. I expected to love it. Made no difference to me. Not worth the effort to get it right.

                          If you want to protect newbies from themselves, auto-inscribe the spellbooks, and disable selecting them by letter.

                          A "middle" ground is to change all the spells.

                          I changed spells so that, regardless of class or book, each letter is a particular type of spell. E.g. in my implementation, (d) are escape spells, so if you get the wrong book, you cast the wrong escape, but at least it is still an escape spell.

                          Comment

                          Working...
                          😀
                          😂
                          🥰
                          😘
                          🤢
                          😎
                          😞
                          😡
                          👍
                          👎