-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[READY] Sort out my loot, please! #24488
Conversation
Fantastic feature! However what if my loot zone is very small and sorting keep spilling them into adjacent unsorted pile. |
Also add some ingame help and tips for the player so that they can know how to use this awesome feature. |
Should not happen, there is a check if destination loot pile has enough free space. Such items would be skipped and left on the unsorted pile. |
This seems kinda familiar... So as far as balance is concerned, unless the plan is to wipe the functionality from NPCs, are you designating a single pile to sort out of as opposed to the existing area sort? What are you expecting your time requirements for the player to be adjusted to? |
Does this apply to vehicle parts? I like to keep different things in different storage spaces, so this would be a godsend if so. |
That is not my plan, I don't even play with NPCs enabled in the first place. I am personally designating a single pile to be a source of unsorted items, though technically zone can be bigger than one tile and the code covers that. I did not tested multiple tiles behavior though. Limitation is that player has to be in max 10 tiles range from unsorted pile for feature to work at all, and only zones in 10 tiles from player are covered. It is meant to cover crafting area and have some leeway for where the player is standing. The only cost is the cost of moving of items, the cost of moving around to pick / drop location is neglected (as is in AFAIK in crafting). |
Zones currently do not support vehicles. But it is quite possible I'l add the feature later, after I build new deathmobile. Unless someone beats me to it. |
darn. |
But if it's essentially free and instant, why would any one ever bother with having NPCs do it in exchange for food, slowly? The existing function covers most of the reality bubble but I intended to scale that based on how much stuff they had to move, the more stuff, the less radius they would sort in 3 hours. You're certainly a better coder than me but it does kinda undercut the primary feature of a low level camp, literally 10 days after it got merged. There's got to be some kinda balance otherwise it just invalidates what I just worked on. |
I don't know about that, maybe more experienced, but probably not even that, as I am not really a C++ programmer.
I can assure you that was not my intention. It was as I said in the OP, I returned recently to the game and got fer up with manual loot sorting while playing. So I browsed the forum, found this thread with Kevin's post in it. Then I browsed issues and commits at git. That is when I found out that there is some recent camp / NPC stuff does some loot sorting, though i did not study it thoroughly. I decided that Zones are the way to go and implemented it.
It costs equivalent time as it would take to move same items via move all action from Advanced Inventroy. Argument could be made that it should take longer - because of distances, and that it shouldn't - because of crafting in crafting range. I seriously don't know what the the cost of the low level camp is or how you pay your NPCs to sort the loot for you, but balancing of time (or other) cost should not be against NPCs, but against the player who would do it manually (and went insane in the process). What I am trying to say is, we should not IMO have unfriendly user interface forcing the player to do repetitive and boring manual tasks just to justify some NPCs existence. |
It'd be great if the two systems could be merged. Let the player sort items themselves at the cost of having to spend their own time, or let an NPC do it at the cost of food and the NPC's time. One benefit that could be given to NPC sorting would be to make it automatic. Instead of assigning an NPC to a "sort" job, it'd be cool if they could just be given a role as "loot sorter" and have them continuously sort any loot dropped off by the player (possibly requiring the loot to be dropped into a designated "dropoff" point). |
The NPC suggestions would be a better addition on a different PR, I think. No need to delay this for additional features. |
I agree, this should be merged asap, robik and acidia could maybe collab. at a later time to heavily improve such a feature...possibly even make designation zones like in df. |
Have you tried it? The sort process is instant for the player and only takes "time" in the since that the clock ticked and you have become hungrier. Since you have to feed NPCs anyways, just skip the whole camp. Without any sort of balancing there is literally no reason to have an NPCs sorting gear at all. Which is why I didn't make auto-sort immediately available to the player when I added it. If everything is instant why would anyone ever invest time into NPCs? |
I think it's quite safe to say that most of us are waiting for someone who would be able to fix Npcs in general. Ones that are actually functioning entities that makes it feel like you're not the only intelligent being in the universe. Until then, NPCs by default just don't have much use. I also think it's safe to say that everyone here is also extremely pleased and satisfied with what you recently accomplished. Like @DracoGriffin said, it's a step in the right direction.
Ofc there is. Having them do it means you don't have too. But the reverse should also be true. If you do it, that just means theybdont have to and you can let them focus on some thing else. Currently with the rarity of npcs, I wouldn't want to waste an Npc entity to only sort loot. As your camp grows, I don't see a problem with using an Npc as a hauler. |
PC time is basically the games primary resource. Having NPCs sort items turns an action that normally takes potentially large amounts of PC time into an action that takes NPC time, so it's not made useless by this PR. |
All of ya'll are actually testing the change right? 4min to sort 100 steel frames, which is accomplished by a single press of the "O" key as soon as you generate a new character. As opposed to NPCs taking 3 hours to sort items on top of requiring navigating a menu 2x (once to tell them to do it and another to recall them since sorting shouldn't magically be done instantaneously), starting an NPC camp, and recruiting NPCs. I don't see why anyone would go through all of the work for NPCs if we just make the reward instantly available? |
Just to clarify with examples: Currently, if a player comes back from looting the city, say it takes 15 minutes in-game (assuming the player doesn't make a mistake and put stuff in the wrong piles), but might take a few minutes or longer outside of the game using AIM and such to place everything. In-game: 15 minutes Using this option to autosort, should also take 15 minutes in-game but time spent outside the game may be instant. In-game: 15 minutes Likewise, using NPC autosort should also take 15 minutes in-game BUT it's at the expense of the NPC, so the survivor (and player) are free to do something else in the meantime. Also costs food to "pay" NPC for this work. Again, time spent outside the game should be instant (as soon as survivor drops off loot, they are free to do other actions while NPC(s) begin their work). The caveat to this option is there may not be Strength/volume differentiation (potentially favoring either survivor or NPC in ability to sort) and/or reality bubble/coding limitations. In-game: 15 minutes So basically, either autosort option is a QOL improvement (one costs survivor time and the other costs food/NPC time), and not some type of exploit. So like acidia is pointing out, it should not be a shortcut for in-game time that can be exploited, it should still take the same amount of time regardless, only removing the need for player micromanaging item placement via dropping/AIM use. |
I mean yea in this sense there should be a HUGE balance change, I thought you meant in general "if you can do x, then this just makes npcs obsolete again" EDIT: what about the AIM system? I'd imagine that would need an adjustment aswell since it does instantly move items that would collectively weigh in the tons? |
src/activity_item_handling.cpp
Outdated
|
||
// Check that we can pick it up. | ||
if( !it.made_of( LIQUID ) ) { | ||
g->u.mod_moves( -Pickup::cost_to_move_item( g->u, it ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to factor in cost to shuttle player between loot and target pile.
If you want to reduce trips it can be one trip per available inventory capacity, but then it needs to include inventory insertion/removal time as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed here 774ee22 (?)
The reason moe costs are neglected in crafting is that it's assumed to be a very small portion of the action, most of the time is spent doing crafting. |
Makes sense.
That would depend on whether you are using shopping cart / how much free space you have in inventory, amount of items you need to move, whether or not you are taking items for multiple zones "on the way" in one go...
I agree that time cost should be increased, but precise simulation would need more code than this PR has to date, potentially much more, and I don't think that we need to do such complex simulation. How about we assume the player would move items intelligently and approximate necessary time? How about cost_to_move_item (already in) + pickup cost + drop cost for each item? |
I'm fine with an approximation, but move cost should be included as well. This is in addition to pickup and drop costs per item if you're planning on leveraging player inventory. |
Looks sensible. I'l implement it as pickup + drop + your formula for move cost and remove the redundant move cost that is already in. |
Yes, it is redundant at that point. |
gorgon and travis complaints
for food that goes bad but doesn't, like canned stuff
to prevent "food" like ammonia or paper on food piles, even though they do have nutritional values
to not use tiles which are in UNSORTED and also in IGNORE as a source also prevents tiles on fire as a source
prevent using tiles with inaccessible furniture, like filled charcoal kiln, as a source or destination when sortung
where necessary
adds a flag FIREWOOD and adds it to 2x4, log, splinter, stick, pine_bough and stick_long
as per Kevin's request "Alternately, only use available inventory capacity when calculating things in move_item() instead of using max capacity."
I apologise for how long this has taken, move cost looks good now. I noticed a few major issues. The second issue is simple, juct check for clear paths to item sources and destinations. |
Yes, I agree that this feature could be misused to teleport stuff from sealed / guarded location. Would have to be done by intentionally misusing the feature for unintended purpose and not by accident though, so it is akin to cheating and at that point, player could use wish for an item. Because this is not multiplayer game and the cheater would ruin the game only for himself, I do not think it is a big deal. If you disagree, I would like to ask for a temporary leniency instead. I do have prepared branch for tilling zones, as described in #24826 for PR, which contains the code that would help solve the issue. We would be able to force the player to move to the loot source piles before any item teleportation, which would keep the player honest. I can't PR it beforehand though, as it is dependent on code in this PR. |
If you plan on moving the player around to make the action happen, we can tolerate the exploit for a while. A note on exploits, some players characterize exploits as distinct from "cheating", and are therefore willing to use exploits until they are closed, even if it indirectly harms their game experience. Basically, "if the game let's you do it, its allowed". |
There is a bug I often experience where I get stuck in a sorting loop (with the only way to stop being force quit), I wonder if there is already an issue written for it? |
There was similar problem, when spilled liquid was around, but that was fixed. If you could provide save or description how it could be reliable reproduced, I will look into it. |
I would love to provide save, but haven't been able to determine where my save files are on Mac with Homebrew. |
Saves are in |
What it does
This PR adds a feature to sort out the pile of loot you just made in the middle of your base.
Why I did it
Well, you see, Zones was almost useless game feature nobody ever used and it was kind of sad... Naah, just kidding. I was happily playing the game, and after I moved to a new base, I was staring on the fore-mentioned pile of loot, wanting to trow up and jump out of the window, not necessarily in this order.
Sorting the loot is annoying busywork, not that funny even the first time you are doing it, not to mention for hundredth time. Also, it was sort of silly to sit in the middle of 3x3 squares of loot piles... efficient, but silly to look at.
It is time for some neat QoL feature, I say!
How it works
Since picture is worth thousand words... let's spam the PR with several of them.
This is me, sadly looking at the loot pile near the stairs (paper box). By the way, that corpse down there is a body of a volunteering zombie cop, who contributed some filthy clothing and armor for testing purposes. Round of applause for our MVP, please!
I defined a zone or two, here and there... name and type are the same text, that is because I tweaked adding zones to offer name of the type as default for the name of the zone, and had no reason to change it to something else, really.
Here's complete list of zone types. You don't have to define them all, loot without defined zone will either fall-through to parent zone (like Perishable Drink->Drink->Food), or stay on the unsorted loot pile.
Here is the result of "Sort out loot" action - you can compare it with picture of defined zones.
And here is the log.
Hope you liked it and "Death to manual sorting!".
Extra features: