-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Saner Inventory through Unified, Nestable Containers [$255] #3671
Comments
wondered why this isn't a feature yet. It's more convenient to "let go" of the bag when you need to and retrieve later without having to drop any items aswell. They should act like shopping carts basically with their own respective volume limit. |
This is something we've planned for a loooong time. The reason it hasn't |
Sounds like the way inventory management works on your average MUD. A good idea, and it would make #2846 easy. But to fully support this, you'd need to add commands to put an item into a container, take an item out of a container, move an item from one container to another, empty a container into another container, empty a container on the ground... Some of them can be done with current commands (emptying containers is already done with 'U'nload) but others need more commands, and we're starting to run out of letters. |
A naive ui would be disastrous. (See df adventure mode inventory) |
@ianestrachan, @kevingranade : I could see some dialogs added to existing commands for example. On pressing 'd' (aka. drop item) We could put 'moving items from a container to a container' under 'T' (take off). This way, we wouldn't run out of letters. |
Yeah definitely planned, it's just that what's currently there is such a horrifying mess that it would almost be easier to rewrite it instead of trying to fix it. Combine that with the fact that inventory code touches on almost every part of the game, and you can see why it hasn't happened yet. :P |
There are a couple ways to handle this.... In NetHack, 'a' (apply) on a sack gives you the option to put items in or take items out.... It would be nice if, say you have a bag with inventory letter 'b', putting an item inside would give it a compound letter, like |
Actually, it'd be really nice to have something like the Advanced Inventory screen for shuffling stuff between containers. But instead of the 9-square grid, have a column with a list of all containers in your inventory. Instead of pressing 0-9 to change the square for the active panel, use a-z to select a container from the list for the active panel. Add one special entry to that list for the ground, and another for stuff not in containers (your weapon, the +2 grace volume, and 0-vol items) and you're set. |
I really like how much thought everyone is putting into this. At their essence, Survival games and Roguelikes are games about inventory management, so inventory code and UI deserves to be the most polished part of Cataclysm, not the most feared! |
I've arrived at this issue again, semi-randomly, and I'm struck by how much I like this idea:
The one part that bothers me, however, is turning single-key selections into at least three keys (and that's the minimum, and only if you're referencing something directly worn): backtick, item letter, Enter (to signify the end of input). But there's no reason you couldn't still have both. Use the shortkeys as they are right now -- player-assignable and everything -- and add the backtick addressing scheme as the item's "full address" within your inventory. The only limitation then is what happens when there are too many items in a container to address with a single character, to which I can see two possible solutions:
Both of these are feasible, though the one interface problem of showing the long addresses remains. But we'd have to redo the inventory screen to display a (flatten-able) tree of items anyway. |
So a path-based key sequence, I agree that sounds good for moving items |
Yeah, it seems like a decent implementation for AIM-less inventory management. AIM would just work as a Norton Commander-alike. |
Was pondering this exact issue. |
How does player know a dropped container has items in them? How are containers with items and without differentiated when dropped? |
Color differentiation. |
How would the Player (Not the player character) know that by looking at it with the "x" command or by looking at the V items men? Additionally what happens if multiple containers of the same type (say a leather backpack) are on the same tile? This would need to be managed as well. |
What about a Dwarf Fortress trading screen style? When selecting containers you select them all, or you can select item in the containers individually. |
I have been out of the loop regarding item storage discussion, but I think creating a Project for how containers should work would be practical. Gathering established ideas, putting them in a central place, and chunking them would allow small-time contributors to chip away at the project without losing their motivation and leaving it unfinished. |
I second this suggestion. Container flagging for quick sorting sounds rad. Your character already auto-deposits arrows into a corresponding quiver when you pick them up. Could that be extended to an overhauled inventory structure? |
To be clear, especially since this issue has such a large bounty attached, a candidate feature to enable this must have the following features:
Some nice-to-haves:
|
An extremely simple algorithm that is about as efficient as possible is this:
As far as code efficiency, I speculate that a fairly good approach might be to quicksort the list of containers by their remaining unused space, from least to greatest, then iterate through the list until you reach the first one with enough space to hold the item in question. (Whether it'd be more efficient to calculate each container's free space on the fly whenever an item is picked up up (more calculation), or for each container to have a persistent "free space" property that is updated every time something is added to or removed from that container (more memory usage), is a question I'll leave to those with more experience here.) |
How about an option to switch into both container catagory and item type catagory, item type catagory is your average catagory that groups what kind of item and the container catagory is where items grouped by container that stores them. And/or a collapsible list to hide and show (sub-)catagorys Also a filter where picked up items automatically placed on targeted container, based on item kind or multiple list of names. And volume should be replaced with total volume and volume from container. |
Just had an idea for the interface to move items between containers:
This could also be used to unload/reload items. A quick mock-up:
Here, the asterisk indicates a container that can only hold certain types of things - liquids in the bottles, tinder in the stove, etc., or for the canvas bag, that its volume will increase when things are added to it. |
2 years and this one is still staying out of the Project tab. The inventory system must be really messed up |
there was a project for it on this repo at some point, but it didn't go anywhere. i've got a personal project for it, and plan to pick this up once 0.E is in sight or released |
Alternate proposed implementation approach, moved here to deduplicate: Proposed solution: Volume Assignment Items gain a new internal field indicating the parent container that contains them. When the parent container is moved, all nested items are also moved with it, for free, without losing their parent. (Their encumbrance is accounted for by the parent container's encumbrance.) When picking up an item that has child items in the same inventory, the child items are likewise moved for free. Additional notes I'm calling this "volume assignment" because items are assigned to the item which provides the volume that contains them. It would be logically cleaner to represent contained items as a list of children in the surrounding container, as has been proposed here. However, this would require all code that handles inventories to be changed. Using a parent field allows for a gradual introduction. The ability to assign items to containers would be handy, but is not necessary for the usecase of divesting yourself of encumbrance before combat. There is no need to represent this in the inventory UI in the initial implementation, though it could be done by a gray right-aligned text in the inventory stating the container. Indentation is less useful in the player inventory, because the containing inventories will usually be [W]orn. When picking up items, the default sort mode should show contained items indented under their parent container, similar to Dwarf Fortress. Proposed implementation tasks Each of those tasks could be handled in a separate PR.
Don't forget to assert that parent items are in the same inventory as the child item! |
This issue has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there: https://discourse.cataclysmdda.org/t/mr-roboto-a-diy-robot-idea/22446/12 |
This issue has been mentioned on Cataclysm: Dark Days Ahead. There might be relevant details there: https://discourse.cataclysmdda.org/t/new-things-ive-noticed/23541/15 |
Change backpacks, duffel bags, etc. such that they're
This will fix the gross absurdities of the inventory-letter-based item limit, and will make e.g. duffel bags useful for melee characters.
(For example, Joe the Swordsman sees zeds approaching; he drops his duffel bags full of crafting gear and skill books, and proceeds to hack and slash unencumbered. If Joe has to retreat, then retrieving his bags makes for an interesting tactical challenge [cf. the duffel bag Rick drops in downtown Atlanta in Season 1 of "The Walking Dead"].... especially if an NPC tries to grab the gear first!)
This will also be useful if you want to sort your gear by intended purpose, for quick mission-specific load-outs.
(Currently the closest thing to this goodness is the humble shopping cart, but those don't fit into trunks very well... ;)
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: