Containers and what they can do for you!

I have started working on a container system that will add a few new possibilities to the game:

[ul][li] The pooled volume system currently in place will be gotten rid of in favor of the new system where you have an individual container (eg Backpack) actually holding items. This will have a few consequences like a reduction in usable capacity if the player does not move objects between containers to optimize volume usage.[/li]
[li]Since containers will now actually hold items instead of just adding to the pool of available volume, dropping your backpack will drop all contained items as well. This will make melee characters more awesome since it will no longer require a dozen+ key presses to drop and pick up the loot you drop in order to fight. To go along with this, it also will make go-bags possible so the player can sort items into containers for different purposes instead of just throwing everything onto the floor and hoping they remember everything they want to bring.[/li][/ul]

This is still very early in development, so nothing is finalized. What I need from you is suggestions on what you think containers in general should be able to do, what they shouldn’t do, and also suggestions for how the UI should be laid out w.r.t. containers.

[size=18pt]UPDATE #1: Initial Progress Report![/size]

Okay, taking a little longer than expected to get the framework for this up and running :stuck_out_tongue:

Things that have been accomplished:

[ul][li] Items can be added and removed from containers[/li]
[li] Items are given letter assignments relative to the container they are within (this is a workaround for the 52-item limit without needing to rewrite all of the Inventory UI)[/li]
[li] Items still stack together! This actually took a little time to figure out since the stacking code in the Inventory object is… sub-par to say the least[/li]
[li] Items can be dumped from one container to another[/li]
[li] Added a way for the inventory to dynamically grab the contents of a container so a lot of the Inventory UI code is now redundant[/li][/ul]

Things I am working on that need to get finished before committing the first developments

[ul][li] Prototype and Finalize a UI for the new inventory[/li]
[li] Testing, lots and lots of testing[/li]
[li] Make items not in the Player/NPC inventories stack together to reduce the item spew you find around dead bodies (workaround to the 26 individual items per tile thing)[/li][/ul]

There are other things to do as well, but they will be dealt with during the second round of development for containerficating the inventory system. Keep the suggestions/discussion coming! I need more information about UI design specifically!

Great to hear this is going to be implemented.

The way I think I’d find it less annoying to transfer items would be by (a)ctivating them, then being asked for another container to transfer to, the same way boiling water does now. Then, ideally, a new menu where the contents of each container are shown side by side (like the current barter screen, showing the volume capacity and max items for each), where left and right cursor moves the currently highlighted item to the other container.

Alternatively a system similar to the “compare items” (I) would work, where you press the new hotkey and select both containers to use for transfer. But as I mention this would require a new hotkey, and we have a gazillion of them already.

Support.

I believe that i read somewhere that Whales had possibly dabbled in this idea at one point before, but that he decided to go with the current weight/volume system because he didnt want players to basically min/max and drop all of their gear before every fight. Being able to instantly remove all of your encumbrance before a battle kindof defeats the point of having the encumbrance system in place to begin with. I believe in a balanced look at all things, so here are the benefits and caveats id expect to see from a system like this:

Pros:

  • Organize bags of items, assuming you can tag with ‘food’ or ‘drink’
  • Items could be left behind if you didnt have time to pick them up before retreating (Assumes pickup/drop takes more than 1 turn per bag)
  • Dropped containers could become damaged/destroyed and cause items to spill out

Cons:

  • Lots more per-container micro management
  • Harder to see or access all items in your inventory
  • Makes existing encumbrance system potentially meaningless
  • No system in place to stop abuse of picking up or dropping containers instantly
  • No system in place to simulate the time it takes to add/remove items from containers

Ultimately, i want to like the idea of containers, but with Cataclysm in its current state i dont think these types of containers would be a good idea. Currently the game asks you to strike a balance between carrying everything, and just carrying what you need to live/fight effectively. Changing containers would unbalance the current systems and would add in even more micromanagement in relatively tedious ways. Ranged characters had to balance carrying a lot of gear with slow melee fighting and/or between creating a lot of noise with guns, while melee characters have to balance not being able to carry a lot, but being exceptionally good/quiet in combat. Late game melee characters can carry more stuff without suffering as much penalty to their skills.

If Cataclysm were a GUI based game ‘similar’ to Neo Scavenger, id say absolutely to the ideas of containers because of the ease of mouse-based inventory management. However, not having a system in place to stop abuse of instant drop and pickup, as well as requiring a complete re-working of the inventory space, and then it being a pain to move items between containers using hotkey letters only and not being able to use arrow keys in the inventory either… Given all of that, i think containers would break too many current game mechanics, upset the balance without the creation of entirely new systems, and add more tedium of inventory management unless the entire inventory was re-worked to allow for cursor scrolling and more modern access methods.

Kenoxite: That sounds like a pretty good idea :smiley: When I move things over from my test-bed into Cata I’ll prototype that and see how easy it is to use.

Ratha: You have a pretty good breakdown of the pros and cons of the situation, but your stance makes it sound like the system has already been finalized. I have nothing finalized quite yet, so hopefully most of the problems you envision will become moot. I’ll go through and comment on as much as possible though, despite not having much beyond containers actually holding stuff implemented:

PROS

- Organize bags of items, assuming you can tag with 'food' or 'drink'
I am planning to add container tags so you can quickly sort items. This will have a time cost associated with it though so it would be best to do when you are back in a safe area like your shelter.
- Items could be left behind if you didnt have time to pick them up before retreating (Assumes pickup/drop takes more than 1 turn per bag)
This is also in the works, pickup/drop/misc actions should all have a time cost associated
- Dropped containers could become damaged/destroyed and cause items to spill out
I'm thinking about how to do this right now, but it should be possible.

CONS

- Lots more per-container micro management
The per-container micro will be lessened as much as possible, but I haven't figured out how to deal with it quite yet so we'll see :P
- Harder to see or access all items in your inventory
I'm going to try and make it as easy as possible, while still working reasonably. IE: you shouldn't be able to see what's in a bag that's in a bag that's in another bag that's completely full of stuff. It just doesn't make realistic sense. You'd know that the bag is in there, but maybe not be able to recall the exact contents
- Makes existing encumbrance system potentially meaningless
Maybe, maybe not. Everything will have an opportunity cost associated with it, I am assuming this point ties in with the next down.
- No system in place to stop abuse of picking up or dropping containers instantly
The system isn't currently in place, but the way it will work is that you will have a few options. 1) Throw the container to the ground as fast as possible (negligible time cost) but risk breaking stuff within the container 2) Place the container onto the ground carefully, with time cost related to weight and how bulky the container is so you don't break stuff. Picking things up would have a time cost related to point 2, and modified a little by natural clothing encumberance (ie. it takes longer to put on a backpack if you wearing a lot of stuff since mobility is decreased)
- No system in place to simulate the time it takes to add/remove items from containers
A system will hopefully be put into place for this. Primarily, containers nested within others will either be unable to be rumaged through or it will take a lot of time. Since I haven't really explained any of the proposed systems yet it is understandable that you would think it will not be added. I hope to, within the next few days, fill out the OP a bit more with my plans and progress and hopefully win you over!

I am trying to keep things balanced so that this isn’t a destructive thing overall. I will try to answer your ending paragraphs later when I actually have an answer to give :smiley: Til then, thanks to the both of you for your suggestions and criticisms! Keep em comin!

[quote=“GalenEvil, post:5, topic:454”]

- Harder to see or access all items in your inventory

I’m going to try and make it as easy as possible, while still working reasonably. IE: you shouldn’t be able to see what’s in a bag that’s in a bag that’s in another bag that’s completely full of stuff. It just doesn’t make realistic sense. You’d know that the bag is in there, but maybe not be able to recall the exact contents[/quote]

Out of curiousity will just looking at a bags contents cost anything? or will it be a free action?

I had similar thoughts as Ratha, but the response put most of them to rest. It would be very interesting if it took more time to access items the more items are stored in a single container.

For all us college students, it’s relatively quick and easy to pull our car keys or wallet out of our pockets. Yet it’s an entirely different matter to find and extract that one page of the essay on 14th century metallurgy out of your full backpack. You also shouldn’t be able to access your backpacks contents without taking it off first (or simply have some containers have a multiplier on how long it takes to find things)

It could also allow for specialized belt rigs that have a total volume and a maximum volume per object, to simulate rigs with many small pockets. No item can exceed the volume of an individual pocket, but they carry a lot of those items, and they can be accessed quickly. For things like stimulants, emergency painkillers and ammo.

Fengferth: Looking inside of a top-level bag should probably be a free action, but if looking into lower levels of containers-in-containers then it should probably cost a little time since you are rumaging around and to simulate a short chain of events that leads to you being able to look into the container. I haven’t figured out if it will even be allowed, but if it is you probably don’t want to be rumaging through too many layers of bags. Something that has been tossed around is the addition of some item specific containers that would be worn. Stuff like bandoliers for quick access to ammunition. You could always store small things in a fanny pack though and wear it which would have top-level access times of 0 always.
It is all still in the works, and I need to figure out how all the pieces will fit together still :stuck_out_tongue:

Greiger: That is an excellent point about the backpacks and the belt rigs (can probably work it into utility/kevlar vests too since they are containers)! There may need to be a time cost to simulate the taking off of the backpack and rumaging through, but I’m not sure if adding time for %fill of the container is necessary. That will be determined during testing and how realistic we want the system to be.

Brill, thanks for clearing that up. I know it’s not final but I’m kinda excited to see how it’ll go. I usually fill out my pockets full of crap. :stuck_out_tongue:

GalenEvil, i didnt mean to imply that the idea was unfeasible. Just a lot of work to pull off, and would require both creating new systems, as well as changing a lot of the current ones. (Some of which are slightly broken and unbalanced and should eventually see some changes and upgrades anyway.) On paper alone it seems to be like it would be a large undertaking. Im not sure if you are a core developer, or if you wish to create a branch with this mod, but i definitely wish ya luck in your project.

Another thing which might bear consideration: How are you going to give feedback to the player about how much time it might take to rummage around in a container, either to look, or to extract an item? Adding an element of uncertain time usage may add to the tension, but it could also lead to some player frustration too.

How automated do you plan on having tasks such as ‘obtaining an item from a backpack?’ Will the player need to manually remove the bag, examine it, extract the items to (where?*), pick it back up, and then re-equip it? Thats a lot of key presses (with potentially changing item letters) to achieve the same goal that we can achieve in 2-3 keypresses currently. This could slow down the pacing of the game a little (which might or might not be a bad thing) just something to consider.

  • If all inventory is going to be container based, will items be used directly from the backpack, put into the hands, or will they be extracted to the floor?

Anyway, just a handful of things to ponder while you are trying to build your system. :stuck_out_tongue:

It’ll be merged into the core branch when it’s done.

[quote=“Ratha, post:10, topic:454”]GalenEvil, i didnt mean to imply that the idea was unfeasible. Just a lot of work to pull off, and would require both creating new systems, as well as changing a lot of the current ones. (Some of which are slightly broken and unbalanced and should eventually see some changes and upgrades anyway.) On paper alone it seems to be like it would be a large undertaking. Im not sure if you are a core developer, or if you wish to create a branch with this mod, but i definitely wish ya luck in your project.

Another thing which might bear consideration: How are you going to give feedback to the player about how much time it might take to rummage around in a container, either to look, or to extract an item? Adding an element of uncertain time usage may add to the tension, but it could also lead to some player frustration too.

How automated do you plan on having tasks such as ‘obtaining an item from a backpack?’ Will the player need to manually remove the bag, examine it, extract the items to (where?*), pick it back up, and then re-equip it? Thats a lot of key presses (with potentially changing item letters) to achieve the same goal that we can achieve in 2-3 keypresses currently. This could slow down the pacing of the game a little (which might or might not be a bad thing) just something to consider.

  • If all inventory is going to be container based, will items be used directly from the backpack, put into the hands, or will they be extracted to the floor?

Anyway, just a handful of things to ponder while you are trying to build your system. :P[/quote]

This is going to be my first contribution to DDA so not a core developer at the moment hehe. It is a rather large undertaking but it will add so much to the potential of this game. I haven’t thought about how to display the timecosts of rummaging around yet since the topic just sorta popped up. It’s hard to conceptualize the UI system to implement without having the pieces ready for display, but I will figure it out during testing what feels right. WRT Automation of tasks: I’ll probably make it abstract the process but be subject to interruption so you can get a bit of tension if you are looking through your pack thinking you’re safe, then suddenly zombies! and you have the option of taking the time to manually put the pack back on, carry it in your hands, or just drop it and flee. Not sure exactly where items will be put when removed from containers, probably into your hands or the floor since both are logical end points for an item removed from a container. The issue with item letters will hopefully be resolved during production of the system. If it isn’t then I’ll figure out something :smiley:

Are you also doing the thing where you can store everything in a backpack and throw it on the ground so that you can come and pick it up later ?

This also means that the way that the items are stored in the map files will also need to be change :X

I really like this and it seems more real, since I can say carry 5 backpacks into an area, take all the items and store them in backpacks, and come up pick them up with my vehicles later.

Do you mean by looking inside the bag, just to open the inventory to see what stuff you got?
If so i dont really like the idea of not being able to see at once all the items i got with me.
I would have to keep my own list of what item is in which bag to avoid wasting absurd amounts of time to just find something i know there is.
It would also make my item comaprison feature kinda unusable/akward to use. :frowning:

Good points Ozone. I really haven’t figured out how to do the UI portions of this yet, and associating time-costs is one of these. I really like the item comparison feature and would like to keep that easy to use. Having the player keep their own lists seems pretty against usability and enjoyability as well… this does not bode well with how I have been thinking. Maybe only apply a cost if you need to actually pull something out and interact with it beyond item comparison. Will need to do some heavy duty testing with this part.

Yeah, gameplay beats realism here and having to keep a notebook with your inventory in it is not particularly good gameplay. Or is amazing gameplay, depending on who you ask I guess :stuck_out_tongue:

Still, costs should only apply for actually taking items out or interacting with them.

[This has turned out to be a giganto-post, sorry about that. I’ve separated it into sections, so hopefully it doesn’t read like crap]

I think it’d be nice to be able to have a list of the objects stored in a container when examining it, the same way we get a list of objects stored in crates, like when examining the ones at FEMA camps.

More suggestions:

Displaying the contents of a container
Maybe a prompt dialog should be displayed when (a)ctivating a container, where you’re asked if you want to open it or transfer items to another container. By opening it, the default inventory screen would display now only the items inside that container. But this poses the problem of how to close this container to display the default inventory again. Ideally you should be able to ©lose it, to keep all the hotkeys streamlined, but I don’t know if that’s possible and if it’d conflict with the default ©lose action in some way.

Comparing items across containers
Say you want to compare an item from the main inventory with an item placed inside a container placed in the main one. You would proceed as usual (I) and press the letter of the first item to use for comparison, then the one of the container where the item resides. The game should be able to detect the item being a container and would ask you if you want to compare the container itself or one of its items. By selecting the latter the container would open and display its inventory screen (as explained above), and there you’d be able to select the item you want to compare to by pressing its letter.

For further comparisons you’d first close the container inventory (which would take you back to the main inventory screen) and proceed again from there.

Alternative method for the container (and inventory) system
This would require a rework of how the inventory system works now, as for this suggestion to work the inventory screen should be tabbed, the same way the crafting (&) menu works.

Display
The first tab displays the contents of the main inventory. This inventory shows the items you’re currently wearing and holding. This includes clothes, armor, weapons and containers. It also displays the items stored in clothes (but not in containers, such as backpacks, purses, etc) and that is readily available.

Further tabs would be inactive unless the following happens:

When the player (a)ctivates a container the second tab is filled with the contents of that container.

Opening a container in the second tab (second container) would display the contents of that container in the third tab. The name of the tab would be that of the tag of container (tag names should have a char limit to make them fit in the tab). The items would be ideally navigated by using the UP and DOWN keys instead by pressing a given letter. In the right side of the item list you’d have a fixed display that automatically shows the
description and actions available.

Opening a container in the second tab would open a third. And so on.

[center][/center]

A container with its tab displayed should be considered as open, so it would be affected by the system that gives a chance to items to be dropped when you’re on the move and a container is opened (if it’s ever implemented).

Transferring items
Right now I can think of anything but adding a new hotkey when using this proposal for inventory. Pressing that key ((t)ransfer?) would display a list of the currently opened tabs, where you’d have to select the one where you want to transfer the item to.

Pros:

  • more easy to navigate the contents through containers
  • probably an easier inventory system to understand.

Cons:

  • A matryoshka doll effect can happen, where we have lots of containers inside containers. This in turn can make the display via tabs difficult, simply because the amount of tabs needed would be more than the amount able to be displayed. But this probably is a non-issue, as if we take volume into account there’s just so many containers you can place inside another container. Or an artificial limit could be placed, where you can’t have more than x containers inside another container.

JA2 1.13 inventory, how do they do it

TBH this new container system reminds somewhat the way Jagged Alliance 2 1.13 works, which I guess most of you are already familiar with. They have a very deep and flexible inventory system there, where you have a fixed number of slots to hold items and in those slots you can place either single items or containers. Each container has their own item capacity, distribution and type of items that can be stored there.

Note that all my comments are based on memory, as I haven’t played it in a good while. So there might be errors.

The upper part shows the items the character is wearing (head gear, eyes gear, hat/helmet, torso clothes, leg clothes and weapons equipped in each hand -none in the screenshot-). That’s the default JA2 inventory.

Below you see the 1.13 inventory in action, which expands on the original (which allow you to carry four generic big items and some small items IIRC). The first row shows the current holstered item (small arm - knife- or object), holstered big weapon (assault rifle) and vest worn. That particular best allows you to (from lef to right) carry a small item (first aid kit), two very small items in the arms (none in the sshot), a pouch or a small item (empty), two medium pouches or objects (such as antigas masks), etc.

Below that you have three waist slots. The first two are used for pouches in the sshot (and a holster in the first character), which in turn have their own capacity and type of items that can be placed there. The third one is an extension of the backpack.

And finally the back slot, where the backpack is. It can hold four very big objects.

This system also allows you to place smaller items than the one displayed as default. So in a big sized slot you can place several medium items (such as stimulant needles), etc.

Containers (mainly backpacks and bags that are worn on the back, but not vests and pouches) also have to be closed before picking them up, which solves the problem of running around with an immediately accessible container. Closing and opening a container has an action point (AP) cost.

As you can see it’s a quite complex system. It allows a lot of flexibility when gearing your mercs, but not as much as the current DDA inv system (where your only limits are volume and capacity). Here you’re restricted by the amount of slots available. Anyway, I thought it’d be nice to throw this here, as it can give some ideas.


EDIT: Polished it a bit, but I don’t have the time and will to go through all of it right now. Just imagine that this post, which could be used to kill a hulk with a single smack, is written in exquisite English.

Logic, bindings then presentation!

No need to worry about UI yet, just make the logic for putting stuff into other stuff, then submit that for code peer review. Don’t do everything at the same time, its way easier to debug problems when you build your logic first then test it, instead of doing everything at once then trying to sort it out. Especially if you haven’t planned it out (like, real planning, UML diagrams and shit)

@Kenoxite:
Awesome ‘giganto-post’ :smiley: I actually haven’t played JA2 or the first for that matter hehe hides
I’ll eventually figure out a UI for it, but that’s secondary for the moment. I am starting my DDA implementation of tests I did yesterday and the day before so I’ll know where to go from there hopefully soon!

@Tase:
Couldn’t agree more. Since this is more off-the-cuff than real planning I’ll be posting for review just about everything as I get things to a usable state. Hopefully the logic part will be done by mid-afternoon at least for the initial stuff so I can get a review of it started while people are still inhabiting the IRC to give me feedback :smiley:

Okay, taking a little longer than expected to get the framework for this up and running :stuck_out_tongue:

Things that have been accomplished:

[ul][li] Items can be added and removed from containers[/li]
[li] Items are given letter assignments relative to the container they are within (this is a workaround for the 52-item limit without needing to rewrite all of the Inventory UI)[/li]
[li] Items still stack together! This actually took a little time to figure out since the stacking code in the Inventory object is… sub-par to say the least[/li][/ul]

Things I am working on that need to get finished before committing the first developments

[ul][li] Prototype and Finalize a UI for the new inventory[/li]
[li] Testing, lots and lots of testing[/li]
[li] Make items not in the Player/NPC inventories stack together to reduce the item spew you find around dead bodies (workaround to the 26 individual items per tile thing)[/li][/ul]

There are other things to do as well, but they will be dealt with during the second round of development for containerficating the inventory system. Keep the suggestions/discussion coming! I need more information about UI design specifically!