Skip to content
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

Capacity-based storage system #10095

Merged
merged 6 commits into from
Jan 7, 2016
Merged

Capacity-based storage system #10095

merged 6 commits into from
Jan 7, 2016

Conversation

RavingManiac
Copy link
Contributor

Storage system for backpacks, boxes, etc. altered to be storage-capacity based. Items take up space based on w_class by default, with custom storage costs also possible. Space in container represented as a bar, with each stored item positioned along the bar with an overlay representing how much space they are taking up.

Backpacks have a capacity of 16, boxes have a capacity of 8 and toolboxes have a capacity of 14. A backpack can store 2 spacesuits, 4 fire extinguishers, 8 emergency oxygen tanks or 16 pens.

Belts, excavation kits and some other containers still use the slot system.

Current screenshots (5 January 2016):

Backpack with various items
Backpack with spacesuit
Box
Toolbox


//src.boxes.screen_loc = "4:16,2:16 to [4+cols]:16,[2+rows]:16"
var/icon/I = new(src.storage_box_continue.icon)
I.Scale(storage_box_length-4,32)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ew icon procs :(

@mwerezak
Copy link
Contributor

Please do not generate and manipulate new icons every time the inventory is displayed.

@GinjaNinja32
Copy link
Contributor

As mwerezak said, don't do /icon stuff every time it's displayed. If you really have to use /icon, cache it, otherwise use /image.

@Dennok
Copy link
Contributor

Dennok commented Jul 10, 2015

Yes! I know it! Someone make system what i offered.
Really nice window for items.

@RemieRichards
Copy link

Use /image and some matrix maths.

Scale() example:

var/image/I = image(file,state)
var/matrix/M = Matrix()
M.Scale(X_axis,Y_axis)
I.transform = M

and Shift() would be a Matrix Translate() etc.

@mwerezak
Copy link
Contributor

You may want to reduce storage capacities across the board with this, as it represents an overall buff to the amount of things that people can easily store (which itself has been creeping up with widespread webbings and security now having pockets in their armour vests).

Making backpacks able to carry 3 or 4 large items (instead of 7) seems like a reasonable place to start IMO.

underlay_end.Shift(EAST,endpoint-object_offset-2)
O.underlays += underlay_start
O.underlays += underlay_continue
O.underlays += underlay_end
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In theory, this should give items an underlay in the storage menu. Nothing is showing up, though. Any idea what might be the problem?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would hazard a guess that it is because underlay_start, end, and continue are icons, not images.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mwerezak as far as I'm aware the overlays and underlays lists can contain the following:

  • Images
  • Icons
  • Appearences (overlays += "state" adds an Appearence not an icon or image)
  • Objects (Byond will deal with it)

@RavingManiac RavingManiac changed the title [WIP] Capacity-based storage system (help needed) [WIP] Capacity-based storage system Jul 10, 2015
@scrdest
Copy link
Contributor

scrdest commented Jul 10, 2015

I wonder, does this support items with separate 'pockets'? Because the dual slots for storage in most storage-type coats seem to represent two pockets, and purely volumetric storage means instead of a cigarette packet and a lighter, you may elect to store a twice as large cane (I don't know actual sizes, but you get the idea), presumably with each end in a separate pocket and the middle just kinda hanging there.

@RavingManiac
Copy link
Contributor Author

Right now, I'm planning for some storage items like belts, excavation kits and coats to still use slot-based storage

@mwerezak
Copy link
Contributor

Yes it does. In fact, this is the same system we have currently, with some parameters tweaked and a new UI. So it should support everything the existing system does.

@RavingManiac
Copy link
Contributor Author

Managed to get the bars representing storage cost to work. Mostly a matter of balancing and modifying other systems to fit now

@SkowronX
Copy link

Icons appear a bit too bunched up and messy, is the interface a work in progress?

@Dennok
Copy link
Contributor

Dennok commented Jul 10, 2015

@SkowronX No no. I'm sure as intended. If you stick a bunch of things in a backpack will be difficult to pull something one, it presents it.
Dark background shows the amount of occupied thing.

@SkowronX
Copy link

Then that should be changed. It's not aesthetically great looking.

@atlantiscze
Copy link
Contributor

I agree with @SkowronX - While i like the general idea, the visual look of the UI is not good. The items are too close together and overlap the boxes, that should not happen.

@Dennok
Copy link
Contributor

Dennok commented Jul 10, 2015

@atlantiscze @SkowronX It only one way to show many icons of many obj in one row.

It bade by some VV cheat but show ...
tau ceti station 2014-06-17 164101

@atlantiscze
Copy link
Contributor

I counted about 60 lines in that, each 7 items. That is a total of 420 items. Even with tiny ones, nothing should fit that many items at once. For example a backpack with 7 slots /as it is now/ would store 7 large items (wclass 4), therefore 7*4 tiny items (wclass 1). Four rows. Not sixty. Your argument is not valid in this case.

And of course, we can always have limit to amount of items in one storage if we ever have storages that are so large they would take up whole screen.

EDIT: I also don't think that "ICly backpack full of small stuff would mean it will be hard to pull something out of it" warrants creating UI that is uncomfortable to use. Keep IC things IC, and keep mechanical changes OOCly comfortable to players.

@MistakeNot4892
Copy link
Contributor

I actually really like the way it looks. It's not as parsable as the previous version but that's kind of a good thing, and it does give you an immediate indication of how much space something is taking up.

@Fox-McCloud
Copy link

@Dennok

And that's why you enable item stacks for storage =V

@mwerezak
Copy link
Contributor

@atlantiscze A w_class 4 item takes up eight times the space as a w_class 1 item.

@@ -10,7 +10,6 @@
throw_speed = 1
throw_range = 7
w_class = 4
max_w_class = 3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you removing these?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having a max_w_class makes sense when storage is slot-based, but with capacity-based storage, it no longer makes sense to arbitrarily limit the size of items that can be put in when this is already balanced by storage capacity.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not true at all. For instance, items should not be able to fit in a container the smaller than them. And storing items involves more than pure volumes - things like the shape of the items being stored and the size of openings matter as well.

I'm not sure if you've taken any time to think about this at all. Fire axes, shotguns and similar items should not fit in backpacks and similar containers, both for balance reasons and because otherwise it does not "make sense." Being able to store infinite amounts of backpacks/toolboxes/anything else inside each other hardly "makes sense" either.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Except it's not balanced, because if you have containers with combined w_class more than 4 you can stack them inside each other forever.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plan is to give storage items a "storage_cost" value one greater than their max_storage_capacity. I'm still tweaking the values to keep things balanced.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems like an inelegant solution.

Either you are going to have storage items that are bizarrely humongous compared to every other item in the game, or your storage item capacities are going to become very small.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also i think it was a nice feature how using boxes to organize the contents of your backpack would yield more storage space. Under your system that would be impossible to implement.

It just seems like pointless cutting away of design space for no good reason. With max_w_class we already achieve the same thing and have more control over how the storage item behaves.

@Dennok
Copy link
Contributor

Dennok commented Jul 11, 2015

Backpack not is box, it don't hold his volume. Empty backpack can be pasted into another backpack. Tool belt with tools must have more volume when 1 slot and less when empty.
Containers like a box must calculate its volume in another way : w_class = all_what_can_hold + 1
All elastic storages like backpack, belts, itc : w_class = all_what_actually_hold + 1
w_class can be volume modifier and real_volume_of_thing = thing.w_class * constanta
this make items wisch w_class = 5 more bigger when w_class = 1

For security, must completely cut inserting objects in container, that in container.

@mwerezak
Copy link
Contributor

@RavingManiac

Having slept on it, I've realized that my biggest objection to this PR as-planned (because as-is it is completely broken) is the fact that it will make organizing the contents of a backpack using boxes provide no benefit whatsoever.

I'm not happy with this feature being axed with little to no justification whatsoever. Especially since the only argument for removing it is on the grounds of "making sense" and I would argue that organizing your backpack using smaller containers to gain extra storage space does in fact make a good deal of sense - In addition to the gameplay aspect that rewarding players for taking a little bit of extra effort gives boxes a purpose and provides players with the choice to use them or not.

As far as I can tell, max_w_class does everything we need and works very well for the purposes that we want of it. Replacing it with a new system, especially deciding that it should go when it's replacement has not even been fully fleshed out yet seems unsettling and... like a waste of effort, honestly.

Still, as long as whatever new system you are playing with allows for players to be rewarded with some extra storage space for organizing their backpacks using boxes, then I guess I'm not one to tell you that you can't do that.

@RavingManiac
Copy link
Contributor Author

Busy at the moment, but I'll get back to this in a few weeks.

@RavingManiac
Copy link
Contributor Author

Fixed

@MistakeNot4892
Copy link
Contributor

A decision is needed for this.

@headswe
Copy link
Contributor

headswe commented Dec 20, 2015

All the yes!

@RavingManiac
Copy link
Contributor Author

I'm happy to update and balance this as soon as you folks decide that it should go in

@headswe
Copy link
Contributor

headswe commented Jan 3, 2016

Another two weeks ;)

@PsiOmegaDelta
Copy link
Member

Asked how it was working out for Yonagoni/Europa. Quick answer was that while no intensive testing has been done things do seem to work fine with some minor concerns of some sprites being larger than their storage slot.
I am willing to 👍 this, get some more IG testing done, and tweaks can be made based on that.

@@ -12,10 +12,16 @@
var/list/can_hold = new/list() //List of objects which this item can store (if set, it can't store anything else)
var/list/cant_hold = new/list() //List of objects which this item can't store (in effect only if can_hold isn't set)
var/list/is_seeing = new/list() //List of mobs which are currently seeing the contents of this item's storage
var/max_w_class = 2 //Max size of objects that this object can store (in effect only if can_hold isn't set)
var/max_w_class = null //Max size of objects that this object can store (in effect only if can_hold isn't set)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change removes size restrictions from a bunch of subtypes that don't have max_w_class set.
Found so far: boxes, bibles, and first aid kits.

…um w-class set to 4 and 3 respectively.

Storage box sprite made lighter to improve visibility against dark backgrounds.
@RavingManiac
Copy link
Contributor Author

Updated and balanced.

@Techhead0
Copy link
Contributor

As far as I can tell, this means you can fit two backpacks inside a backpack or two boxes inside a box. I don't think infinite fractal storage is desirable, balance wise.

@RavingManiac
Copy link
Contributor Author

It doesn't allow containers to be placed inside other containers with equal or lesser w_class.

I initially made containers always have equal or less storage space than they take up, but this would have made boxes useless for increasing storage capacity, among other changes to gameplay balance.

@Techhead0
Copy link
Contributor

Ah. Thanks for clarifying that.
Honeybee Professor approves.

@PsiOmegaDelta
Copy link
Member

👍

@comma
Copy link
Contributor

comma commented Jan 7, 2016

Oh well what can possibly go wrong

comma added a commit that referenced this pull request Jan 7, 2016
Capacity-based storage system
@comma comma merged commit f7b0f27 into Baystation12:dev Jan 7, 2016
@headswe
Copy link
Contributor

headswe commented Jan 8, 2016

Yay!

2ecd0439479dcd77f54567dbac71e5a8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet