Project

General

Profile

Bug #4112

Inventory sort order is inconsistent

Added by Dark Locq about 1 month ago. Updated 28 days ago.

Status:
Closed
Priority:
Normal
Category:
GUI
Target version:
Start date:
09/18/2017
% Done:

100%

Reproducibility:
Always
Operating system:
Other
Severity:
Normal

Description

It's really unhelpful that inventory items with the same base name randomize their order, and keep re-randomizing any time the inventory is altered in any way, even while the inventory window is still open. This affects both personal and container inventory (and NPC, i.e. companion, inventory for that matter).

Example: I have three filled Grand Soul Gems, and ten empty ones. I open my inventory to pick one, and the order is (for example): Ascended Sleeper, stack of empty ones, Skeleton Champion, Hunger (with no rationale for this order). I move the Hunger one into a container, or use it. The first one listed in inventory is no longer Ascended Sleeper now, but maybe Skeleton Champion, or the stack of empties. Not a big deal until you consider a case with 37 Grand Soul Gems. It can become a really tedious hassle to do something as simple as sorting all the Golden Saint and Ascended Sleeper ones (i.e., those that are good for Constant Effect enchantments) into a specific chest. You have to start at the top of the list of gems all over again every single time you move one from inventory to the container.

Example: I have a plain Glass Longsword, another I've enchanted with 400 charges and paralyze on touch when strikes, and another with 200 charges and absorb health on target when used, and I didn't give the enchanted ones special names. They appear randomly in the inventory each time I look.

The ideal solution is probably something like the following:
  • Alphabetical by name
  • If same name, and some other name or ID (e.g., of a trapped soul) also applies, then alpha order by that secondary name/ID.
  • Enchanted above non-enchanted if multiple items of the same name (and alpha order of enchantment name if 2+ items of same name and different enchantments). Simplest approach is probably to concatenate the enchantment details into a single string, e.g. "Fire Damage when strikes on target" above "Fire Damage when strikes on touch" above "Fire Damage when used on target"; could even appended magnitude, duration, and area as additional substrings.
  • If the item type has condition, then for two items of the same name, higher condition above lower (but still enchanted above non-enchanted)
  • If the item has charges, then for two enchanted items of the same name and enchantment and condition, then higher charge above lower. CE above expendable charges.

I'm on MacOS, so I'm listing it as that, but I doubt the behavior is Mac-specific. I'm not sure what the difference is between Category: GUI and Category: MyGUI, so I picked the shorter one.


Related issues

Duplicated by OpenMW - Feature #4080: Better sorting of self-made potions in inventory Rejected 09/05/2017

History

#1 Updated by scrawl . about 1 month ago

  • Subject changed from Inventory pointlessly randomizing and re-randomizing to Inventory sort order is inconsistent
  • Status changed from New to Confirmed
  • Operating system changed from MacOS to Other

Currently, we only sort by type and name - if those are the same, all bets are off.

I'm not sure what the difference is between Category: GUI and Category: MyGUI, so I picked the shorter one.

MyGUI is an external dependency we use. See https://wiki.openmw.org/index.php?title=Bug_Triaging_Guidelines#Category

#2 Updated by Andrei Kortunov about 1 month ago

So which ordering we can treat as correct?

#3 Updated by scrawl . about 1 month ago

Doesn't matter much, as long as it's consistent. We should take into account anything from cellref that's also user-visible.

#4 Updated by scrawl . about 1 month ago

... and the item ID.

#5 Updated by Loriel 2 about 1 month ago

See also #4080 feature request for better sorting of self-made potions - restricted version of the same problem. I classed that as a feature request because I think the same problem is present in vanilla Morrowind, and whilst it's inconvenient and annoying, it's not clearly "wrong".

#6 Updated by Andrei Kortunov 30 days ago

  • Status changed from Confirmed to In Progress
  • Assignee set to Andrei Kortunov
  • Target version set to openmw-0.43
  • % Done changed from 0 to 40

#7 Updated by Andrei Kortunov 29 days ago

  • % Done changed from 40 to 80

#8 Updated by Alexei Dobrohotov 29 days ago

  • Duplicated by Feature #4080: Better sorting of self-made potions in inventory added

#9 Updated by Andrei Kortunov 28 days ago

  • Status changed from In Progress to Resolved
  • % Done changed from 80 to 100

#10 Updated by Andrei Kortunov 28 days ago

  • Status changed from Resolved to Closed

Applied in the 9d826b2 changeset.

Also available in: Atom PDF