-
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
Remove charges from solid comestibles #60885
Conversation
0ef68ff
to
214070f
Compare
This is going to be horrible without some serious reworks to how non-charge items work. |
Nothing will change in menus, except the number will be in the front instead of the back of the name.
There is no "just fix the problems with charges", they're horrible from an infastructure and maintainability standpoint with special cases and separate logic at every corner. |
214070f
to
ecee132
Compare
@anoobindisguise however raises some valid points. There's already at least one open issue about many items being laggy (thread, rags). This looks likely to exacerbate this... |
It's not likely to, it absolutely will make these issues worse. They just need someone to work on them. |
Alright, so perhaps this PR should be on hold until those issues are fixed then? Otherwise you are just making life miserable for players, and reducing the number of people playing the latest experimentals, on whom the project depends for reporting bugs. |
It's not for me to decide if and when this gets merged and it's kinda pointless to talk about it to this extent at this point in time. |
As it currently is, items are migrated to a single item with all the other charges as single items in its migration pocket, which isn't subject to the limit. This state will persist until you put the item in your inventory, where it will unload the migration pocket. I think currently you can even wield it without it unloading as long as you don't touch anything else in your inventory, so if you're smart about it, nothing will be lost. I still need to look at it later on because of the amount and nature of the items affected, since I'm not sure how it behaves when crafting/consuming. But that's just the finishing touches of the PR once everything else is in place. |
Or if you put something in your medication storage trunk, right after the update? 'cause that'll update that tile, yeah? If it does, that will cause spillage, and thus item deletion when it can't spill anything else. As it stands, my powdered food & adjacent goods storage has upwards of 82 thousand charges of items stored in it. Beside it is the chemical storage has 248k charges of items in it. Not including liquids. That'll end up being upwards of 85 hours of picking up items, one by one, second by second, in game and trying to find new places to store them, if they don't flow into the 'can't place item' error. Side note, possible issue is that gunpowder and all of the items that copy-from it come in a count of 4540 charges when you get them. Will these just be expected to spill? It's also gonna feel kind of like a waste when you can't place more than a single jar of gunpowder into a cargo hold. |
Currently only things in your inventory get updated. Map/vehicle tiles don't do anything. As long as gunpowder comes in a container, there is no issue whatsoever. Containers are not affected by the item limit. And only the container itself counts towards the item limit. And frankly if this update stops people from storing their foodstuffs, chemicals and powders of any kind directly on the floor, it's mostly a good thing. |
Sure, yeah, if there was a way to do that without involving even more highly annoying, repetitive button pressing, I'd agree. But we currently can't put things into pre-existing containers while they are in storage yet, other than fluids. How will this deal with merging multiple partially filled containers? Will it be rate-limited to the roughly 1 second per item transfer rate of normal items? Given a lack of bulk movement transfer, that is. Common cases of this would be all of the 100-units of salt you find in kitchens, that you'd probably want to put into a single container so as to not have half your storage wasted by small plastic bottles and vials. Uncommon case would come from disassembling a car battery for lead, where you'd get 4 thousand or so. Picking that off the workbench beside you, and throwing that into a box would take some time, yeah? |
As said before, that's explicitly not a concern of this PR. There are issues for that kind of stuff already (and if not feel free to open one). If the main dev team deems those issues critical for this PR, it won't be merged until they're closed and that's that. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not 'bump' or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered. |
ecee132
to
167b884
Compare
- remove charges from solid comestibles - default to migrating charges if an item shouldn't have any - allow consuming comestibles without charges
…th migrated charges in their migration pocket
ec7156d
to
e02978c
Compare
I'm guessing this is probably something going on with my local copy but this is the only errors I found and it was on start.
If you aren't experiencing this error on start let me know and I'll go ahead and merge. Ping me in discord to let me know. |
This is gonna suck. Fixes things borked by CleverRaven/Cataclysm-DDA#60885
Fix stuff caused by CleverRaven/Cataclysm-DDA#60885, I'm gonna have to check other mods too, bleh. Fixes #358
good now we have to wait 1 month (or more) untill all the performance issues and bugs fixed |
It's sad that my concerns about performance were brushed aside only to be validated after this got merged :( |
Eventually when pocket contents' total weight and volume can be cached, there shouldn't be too much difference. |
I'll say it again, it was obvious to me and everyone involved that performance would take a hit. The PR was around for almost a year and some things were already addressed. Some more things are already in the works or at least identified. And chances aren't too bad that in the end performance will be better than before. |
I'm locking conversation because the PR is closed and as I have been having to say quite a bit lately "Closed PRs are not the place to have conversations about the effects of PRs". There is zero visibility to anyone who isn't already in the PR conversation, any words said on closed PRs are words that are wasted. |
Summary
Infrastructure "Remove charges from solid comestibles"
Purpose of change
Starting to phase out
count_by_charges
.Fixes #47842: In general
count_by_charges
items should never have pockets, because ahide bag (1)
has the same amount of pocket space as ahide bag (2)
anyway. Might be worth it to add a check for that.Describe the solution
count_by_charges
count_by_charges
anymore get migrated, unless they get added to the charge removal listcharges
work both for items with and withoutcount_by_charges
count_by_charges
itemsPossible todos/issues:
_inf
count
instead ofcharges
, so it either needs code support or explicitly calculated max amounts for these groups.sealed container issuesshould be mostly fixed by Itemgroups can seal their containers #66971Spawning sealed containers seems to depend on the container being completely filled, with a remaining volume of 0 ml. The charge removal and volume changes break that for some items.for example 4 charges in 250ml put into a glass jar turns into 4 items of 62ml, so 248ml, which causes the glass jar to not be sealed anymore, because it's not fullOther observations:
"charges": [ 0, 2 ]
can't actually spawn 0 charges from what I have seen. Since this got changed to"count": [ 0, 2 ]
, this can actually spawn nothing now. Because some of these cases got moved to their own item groups due to container issues, a count of 0 in those cases means an empty container is spawned. This may or may not be what people intended with these groups, but there's not much to do about it with just automated changes.Describe alternatives you've considered
Also including liquids/gases in this, but I don't wanna imagine the kinds of things that would break.
Testing
Tests pass, and old games seem to load fine, but only minor testing was done for now.
Additional context
Gist with some data from the automated json changes:
https://gist.github.com/mqrause/dc234737bfd5c4309aa4dc496d17bd53