CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
9.99k stars 4.09k forks source link

you are limited to 4096 items per tile #63409

Closed alp7292 closed 1 year ago

alp7292 commented 1 year ago

Describe the bug

you are limited to 4096 items per tile

Steps to reproduce

get 4097 cotton patch drop it on the ground or vehicle cargo see that 4096 cotton patch is on the ground and one next to it

Expected behavior

you shouldnt limited by item count or at least the number should increased

Screenshots

Ekran Görüntüsü (127) Ekran Görüntüsü (124)

Versions and configuration

latest

Additional context

you shouldnt limited by items per tile or at least its number should be increased not sure how coding works but its number is max 12 bit number. increasing it to 14 bit would be enough i am having trouble with storing my tailoring and fabrication items as they dont fit into my vehicle cargo even though it has enough space

ZhilkinSerg commented 1 year ago

See https://github.com/CleverRaven/Cataclysm-DDA/pull/35411

alp7292 commented 1 year ago

ok kevin said "I'm fine with a different limit" so i think 16 bit is good if its too high 14 also someone said that some code is optimized so a bit higher number shouldnt be issue or we need to make every chunk lump patch and sheet counted as ammo as 4000 clothing patch is just 24L but you cant use other 475L space in your cargo

anoobindisguise commented 1 year ago

One thing that amplifies this issue is that while you can "cheat" the system by putting your hundreds of patches in containers, this creates an obscene amount of slowdown, even if you still only have 4096 items in those bags. For example, try spawning 4096 plastic chunks onto a tile and then examining the tile. This takes a few seconds. Then try putting all those chunks into 4 separate body bags and put the body bags all in one tile. It takes 15-20 seconds to examine the tile. And all this is because we're trying to avoid using charges, due to the issues with charges, but the issues with not using charges are also really extreme when you accumulate large amounts of items (which can easily happen with for example fabric patches or scrap aluminum)

mqrause commented 1 year ago

For example, try spawning 4096 plastic chunks onto a tile and then examining the tile. This takes a few seconds. Then try putting all those chunks into 4 separate body bags and put the body bags all in one tile. It takes 15-20 seconds to examine the tile.

That's a different issue that should get it's own report if it doesn't have one yet.

alp7292 commented 1 year ago

One thing that amplifies this issue is that while you can "cheat" the system by putting your hundreds of patches in containers, this creates an obscene amount of slowdown, even if you still only have 4096 items in those bags. For example, try spawning 4096 plastic chunks onto a tile and then examining the tile. This takes a few seconds. Then try putting all those chunks into 4 separate body bags and put the body bags all in one tile. It takes 15-20 seconds to examine the tile. And all this is because we're trying to avoid using charges, due to the issues with charges, but the issues with not using charges are also really extreme when you accumulate large amounts of items (which can easily happen with for example fabric patches or scrap aluminum)

i dont think we cheat the system as we obey the laws of physics and if items dont fit in a single tile due to arbitrary item limit you are forces to put into the next one and that loading time will be same its a issue of code optimization

anoobindisguise commented 1 year ago

That's a different issue that should get it's own report if it doesn't have one yet.

It's highly related though as the 4096 limit forces you to do this. I've tried storing stuff in warehouse shelves and for many resources you just run out of the 4096 really fast especially with tailoring resources, well before you hit the limit for volume. With charges you can have literal hundreds of thousands of an item with no lag, and there's no need to subdivide the items into containers, but non-charged items force this to happen and cause extreme lag because of their limitations.

i dont think we cheat the system as we obey the laws of physics and if items dont fit in a single tile you are forces to put into the next one and that loading time will be same its a issue of code optimization

It's not cheating the system logically, as while you could fit over 583,000 cotton patches on a warehouse shelf you can only make use of less than 1% of that space due to the 4096 limit. (if cotton patches were measured with charges, there would be no issue). but it's cheating the "game engine" limitation if that makes sense. Since an item with thousands of sub-items stored inside it is counted as one single item for the 4096 limit.

mqrause commented 1 year ago

It's highly related though

Frankly it is not. What you described is a performance issue, presumably related to containers and inventory selector menus.

Qrox commented 1 year ago

We could rename tile to harddrive and item to file so that each file occupies at least 1000/4096 liter harddrive space.

Zireael07 commented 1 year ago

@mqrause That performance issue has been reported several times and apart from saying 'we don't want more charges/more hacks' nothing is happening on that end (#41934, #48937 and probably others)

mqrause commented 1 year ago

Those are also different things to what anoobindisguise described.

Cenness commented 1 year ago

Those are also different things to what anoobindisguise described.

It seems you glossed over all mentioned issues in those. I'll point out just two of them - https://github.com/CleverRaven/Cataclysm-DDA/issues/35292 with quote:

kevingranade commented on Dec 13, 2020 Other than Aivean's proposal, this needs pervasive nested item caching, which isn't a reasonable thing to try and shim in before 0,F

With 0.G nearing its release, maybe that caching will finally have a chance at existing?

and second - https://github.com/CleverRaven/Cataclysm-DDA/issues/55654 - closed as stale.

mqrause commented 1 year ago

There's a lot of mixing up issues happening here that is not helpful at all. Item limits on tiles, performance of menus, charges yes/no and moving large amounts of items might have some overlap from a player perspective, but are completely different things codewise. Focusing on one of those might make others less noticeable, but will not fix them.

Kamayana commented 1 year ago

Can anyone give a reason the limit has to be set at 4096? There should be some kind of sanity limit, yes, but 4096 is very easy to run up against once you do something like make a crafting base with warehouse shelves, and the 4096 limit is very obviously arbitrary and immersion-breaking when you hit it while the shelves say they have plenty of volume left. Kevin's comments on #35411 were from 2019 and the game's changed a lot since then - a 4096 limit does not seem to be nearly as unreachable anymore.

Performance definitely starts to slow down when you get a ton of items in one place, but personally I can understand and accept a little slowdown when I'm doing something like keeping huge amounts of junk in one shelf (it's interesting that the AIM is lightning fast even with massive piles; that thing's optimized particularly well). Because of that I don't think slowdown is enough of a reason to not increase the limit - more of a task to work on in the future like has been discussed here already.

Cenness commented 1 year ago

some overlap from a player perspective, but are completely different things codewise

Are you asking for a player that is intimately aware of the game's code? /s (Yeah, I know that there are some) Users can only perceive symptoms and, if support is lucky, provide sufficient info for a repro.

alp7292 commented 1 year ago

slowdown due to items is a different issue and it is still a issue even with limit because you are forced to drop items on next tile so slowdown will be the same its a issue with optimization. scope of this issue is a arbitrary item limit causing you to unable to store items you should. i think increasing the limit to 16,383 would solve this current issue.

andrei8l commented 1 year ago

i think increasing the limit to 16,383 would solve this current issue.

So open a PR for it and make your arguments there.

alp7292 commented 1 year ago

i think increasing the limit to 16,383 would solve this current issue.

So open a PR for it and make your arguments there.

i dont know coding

andrei8l commented 1 year ago

i dont know coding

https://github.com/CleverRaven/Cataclysm-DDA/blob/1c6c4501738a0b31b99bc91bee8a9a6d4fcca9e5/src/game_constants.h#L29

alp7292 commented 1 year ago

that was simple lol never done pr before will try

kevingranade commented 1 year ago

Do pervasive testing in every area of the game impacted by the limits and state your results in detail. Until that happens, the answer is no.