Angband Forums

Angband Forums (http://angband.oook.cz/forum/index.php)
-   Development (http://angband.oook.cz/forum/forumdisplay.php?f=10)
-   -   why sort the pack? (http://angband.oook.cz/forum/showthread.php?t=3077)

PowerDiver April 14, 2010 18:22

why sort the pack?
 
I think it is a mistake to move items around in the pack. The standard complaint is that when you identify an item, it isn't there any more when you go to use it, but there are more problems than that. It would be reasonable if there was a tradeoff and you got something useful in return, but ...

I see hardly any value at all in sorting the pack. Why should the pack be sorted?

This is separate from how you should display lists. I am all in favor of sorted lists, keeping potions or scrolls etc together in the inventory list, although even there I question whether the current sorting rules are the best.

E.g. with items in arbitrary slots you might be asked
Code:

Quaff which potion?

(g) healing
(r) enlightenment
(m) speed

although perhaps the potions would be better sorted alphabetically rather than by sval as I believe is done currently.


A tangentially related issue is why to have the phantom extra slot in the pack? That seems to exist only so that when you unwield an item with a full pack you drop the last item in the resorted pack rather than the item you unwielded, which IMO is the wrong behavior anyway.

Atriel April 14, 2010 18:49

As long as items of the same kind are kept together, I'm OK with anything! (Potions with potions, etc) ^^

Derakon April 14, 2010 18:57

I definitely think that the display should always be sorted. Always having spellbooks at the top of the list, followed by potions and scrolls (um, food goes in there somewhere...whatever) is important. As for whether or not the visual display should correspond to the letters is a different matter, but personally I think that should also stay. My reasoning is twofold:

1) It makes it easier to deal with a series of items. If, for example, I'm sorting through the weapons I've just picked up, and the first weapon is in slot 'p', then I know that I can check the item in slot 'p', decide to chuck it, check the next weapon, which is now in slot 'p', decide to chuck it, check the next weapon in slot 'p', decide to keep it, check the next weapon in slot 'q', and so on. If your inventory didn't get resorted as you pick up and drop new items, then very rapidly the letters next to items in inventory would have absolutely nothing to do with their order in the visual list, which would render this approach pointless.

2) It's easier on newbies who need to do repetitive actions and haven't learned to use the macro system yet. They can easily train their muscle memory to type 'mad' and 'mcf' and so on, and that will work for every spellcaster they play regardless of when they get their books. With a non-sorting inventory, each spellcaster has to learn where their spellbooks go each time -- and worse, if they happen to lose one of their spellbooks temporarily, when they get it back it'll be in a new slot.

What does a non-sorting inventory gain us?

Incidentally, I agree with your reasoning about the phantom slot. If you're forced to drop something, it should be the item that you tried to stick into an overfull pack, not the notional "last" item in said pack.

PowerDiver April 14, 2010 19:10

Quote:

Originally Posted by Derakon (Post 32329)
2) It's easier on newbies who need to do repetitive actions and haven't learned to use the macro system yet. They can easily train their muscle memory to type 'mad' and 'mcf' and so on, and that will work for every spellcaster they play regardless of when they get their books. With a non-sorting inventory, each spellcaster has to learn where their spellbooks go each time -- and worse, if they happen to lose one of their spellbooks temporarily, when they get it back it'll be in a new slot.

What does a non-sorting inventory gain us?

For one thing, it gets you what you want in (2), which currently IS NOT TRUE. If your (a) book gets burnt, the others move, and muscle memory results in casting the wrong spell. Or if you get book four before you get book three, etc. With unsorted inventory, you can [and the code should by default] assign forced slots to particular items, guaranteeing that the third book is in slot (c) if present, and no other usable book is ever in slot (c).

Unsorted inventory is easier on newbies than sorted inventory in this case.

RogerN April 14, 2010 19:28

Quote:

A tangentially related issue is why to have the phantom extra slot in the pack? That seems to exist only so that when you unwield an item with a full pack you drop the last item in the resorted pack rather than the item you unwielded, which IMO is the wrong behavior anyway.
That sounds like a bug. The correct behavior is to store the unwielded item in the "phantom slot". Pack overflowing occurs before inventory sorting (or at least it ought to) so that the unwielded item is dropped. Perhaps some recent code changes broke the order of events in certain circumstances?

It's also possible that I'm remembering code from a variant instead of Vanilla.

PowerDiver April 14, 2010 20:07

Quote:

Originally Posted by Derakon (Post 32329)
If, for example, I'm sorting through the weapons I've just picked up, and the first weapon is in slot 'p', then I know that I can check the item in slot 'p', decide to chuck it, check the next weapon, which is now in slot 'p', decide to chuck it, check the next weapon in slot 'p', decide to keep it, check the next weapon in slot 'q', and so on.

This is a good point, but I think the answer might be to implement an orthogonal solution. I cannot imagine that anyone tests items more than I do, and in my experience it does not quite work. When testing consumables, you need to increment the letter only sometimes. When testing weapons, the mix of slice vs thrust vs blunt means that I still have to examine the letters. I found that I was wrong so often I just had to instill the discipline to read the letter every time.

Better sorting would help, placing all tested/id'ed weapons before all untested regardless of tval, actually untested before tested probably works better, but that is still only a partial solution.

How about a change to the item selection hook so that, say, ',' means to use an item that has not previously been tried [unless it has a !use modifier]? So when I find the stairs, I can repeatedly 'r' ',' to test all the new scrolls in my pack. When you collect a bunch of wieldables from a pit, 'w' ',' to try each in turn. Perhaps there should be both ',' and '.' with the difference being one is safe and only wields pseudoed non-cursed items, and the other also wields jewelry and non-pseudoed stuff.

I've never thought about this before, so it may have some glaring flaws, but I think it would be useful.

Sirridan April 14, 2010 23:38

Quote:

Originally Posted by PowerDiver (Post 32335)
How about a change to the item selection hook so that, say, ',' means to use an item that has not previously been tried [unless it has a !use modifier]? So when I find the stairs, I can repeatedly 'r' ',' to test all the new scrolls in my pack. When you collect a bunch of wieldables from a pit, 'w' ',' to try each in turn. Perhaps there should be both ',' and '.' with the difference being one is safe and only wields pseudoed non-cursed items, and the other also wields jewelry and non-pseudoed stuff.

I've never thought about this before, so it may have some glaring flaws, but I think it would be useful.

Huh, I'd use that. It would be easy to keep one from drinking the last !CCW when there is an unid potion below it. Also it supports the shift to pseudo id that has happened.

fph April 15, 2010 23:17

Quote:

Originally Posted by Sirridan (Post 32345)
It would be easy to keep one from drinking the last !CCW when there is an unid potion below it.

This can easily be avoided by inscribing them {!*}. You gotta learn this inscription, it's one of @'s best friends. :)

Sirridan April 16, 2010 01:21

Quote:

Originally Posted by fph (Post 32378)
This can easily be avoided by inscribing them {!*}. You gotta learn this inscription, it's one of @'s best friends. :)

I actually do this to pretty much everything, and have for a while. But there are those times I forget, and I don't really like auto-inscriptions much.


All times are GMT +1. The time now is 12:00.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.