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

Item Snapshot #72697

Open
1 of 28 tasks
Brambor opened this issue Mar 29, 2024 · 28 comments
Open
1 of 28 tasks

Item Snapshot #72697

Brambor opened this issue Mar 29, 2024 · 28 comments
Assignees
Labels
<Suggestion / Discussion> Talk it out before implementing

Comments

@Brambor
Copy link
Contributor

Brambor commented Mar 29, 2024

Is your feature request related to a problem? Please describe.

What items were (somewhere), again? What loot is in the city? I saw it, why can't I remember it? The optimal play would be to write down every single item on a real-world piece of paper. That is ridiculous, let the game handle that!

Storytime

Map memory #25551 was a huge QoL. It shifted the optimal play from pen and paper to a simple in-game feature. No longer was a huge pain exploring basements without light and navigating complex places.

I want something similar for items. It needs to be more flexible, the PC probably cannot remember all items (see alternatives).

Solution you would like.

I am implementing item snapshot(s). They are a list of items. The player can make a zone associated with item snapshot. Your character can run over the zone to update the list. There can be other sources for item snapshots than zones, more about that later (ctrl+f for origin can be in Personal todo below).

Use cases

  1. Cook food - The crafting menu only tells the player what they can cook with items and tools around them. What if they had a fire going and they had access to the food stockpile in the basement? Simply make an item snapshot for the basement, and one containing fire. Combine those two with the surroundings and the player can see what they can craft. (Had they fetched the basement items and started a fire.)
  2. A city is cleared of zombies. What items are in all of it? Make one item snapshot per house. Make an item snapshot aggregate of all the houses. Now the player can browse all the items in the entire city. They can add this aggregate to their crafting to see what they can make from it.

Implementation

An item snapshot is a list of items and their counts std::map<itype_id, int>.
Then the last update date and possibly linked source.
Multiple item snapshots can be aggregated into a new item snapshot. It would add up all children's items and their quantities.

Personal todo

todo: move this to PR, once it's made

  • persistent item snapshots
    • persistent
    • origin can be
      • associated to a zone
        • QoL - jump from zone menu here and from here to zone menu
      • aggregate of multiple item snapshots
        • cycle detection (A includes B, B includes A)
      • fabricated from a list of all possible items
      • items on entity
        • ? default item snapshot of a character, auto-update
      • items in a vehicle
      • surroundings for crafting
        • default item snapshot that updates automatically when needed (when called)
      • everything the player sees right now
    • time of last update cata::turn or ??
    • map<itype_id: int> - count of items
    • distance() from current pos (only for zones?)
    • name() - user created name
    • allow selecting a rectangle without fully exploring it
      • an intersection of the rectangle and what can player see
      • useful for inaccessible or dangerous places
      • partial updates? (sparse update)
        • one could circle a house without entering it
        • Press "start recording"
        • items are remembered together with their positions
        • on stop recording, forget item positions
        • OR make it a zone aggregate of all the tiles which are individual item snapshots that are sparsely updated
      • bool fully_explored
      • differentiate close inspection (saw all content of all furniture) from looking from far away
    • When updating a zone, show the diff of items at the end (Example: "removed 7 ice creams, added 25 string since last update")
      • This is optional, make settings for it
        • per zone
        • global
  • integrate into crafting menu
  • integrate into Acquire graph #69831

Describe alternatives you have considered

  • Seeing all items - shows what the PC shouldn't see.
  • Remember all items - Would be performance-heavy, probably. It would still need useful sorting (don't include items in dangerous/inaccessible areas). This still doesn't solve some future problems namely "What if I had a fire going?" "What if I had this tool?"
  • Revealing all items doesn't work. When somebody takes a gun on the other side of a wall into their inventory, the player mustn't be notified.
  • Have it take time and resources (PC with Excel or pieces of paper) - this is just unnecessary bloat.

Additional context

I wanna this for #69831. Then the player can plan what they want to craft and see what items in what quantity they are missing.

@Brambor Brambor added the <Suggestion / Discussion> Talk it out before implementing label Mar 29, 2024
@Procyonae
Copy link
Contributor

Use case 1 sounds interesting but performance heavy given the small range around the player for crafting has already run into performance issues before. Handling items that are there in memory but have since moved/disappeared etc when you go to craft with them though could be tricky too tho, like does your character physically auto go collect everything first? If so where do they put it? (Within 5 tiles, in their inventory etc) How do they move it? (Need inv space (how do you deal with big items), haul it (how do you deal with tiles you can't haul over) etc)
Use case 2 sounds really overkill and not useful to most players.

@Brambor
Copy link
Contributor Author

Brambor commented Mar 29, 2024

Use case 1 sounds interesting but performance heavy given the small range around the player for crafting has already run into performance issues before.

I am not going to iterate over any more tiles. Just hand in a single map<item_id, count>. This should not have any performance issues.

Handling items that are there in memory but have since moved/disappeared etc when you go to craft with them though could be tricky too tho, like does your character physically auto go collect everything first?

Going to it is just another QoL. The first implementation is to display if a player can craft if they have the items. And what items are they missing. And in which item snapshots those items are.

Use case 2 sounds really overkill and not useful to most players.

I would love to have my character once run over a city instead of looting everything I might need. This would save me hours of real-time. And days in in-game time. The player optimizes and has to think "What do I need? What will I need? Do I have this already?".

Players opt out of the optimal strategy: write everything down. Instead, they glance over a list of items one time they enter a building. Sometimes, they miss an important item. And glancing is still more time-intensive, than making an item snapshot. I get bored of it. This is related to #51173.

@kevingranade
Copy link
Member

I don't disagree with either of your use cases (assuming in understanding them), but I don't think this snapshots thing is really the way to do it.

For looting this is something I've been thinking about for a while, mentoned here https://discord.com/channels/598523535169945603/598523535169945607/1220507359676203030

In short a looting management system that does things like:
Maintain a list of items you're interested in looting.
List the items you find in a room, highlight ones you haven't seen before and ones you've noted as looting targets, and automate retrieving them all.
Remember where items of interest are seen if you didn't loot them.

For the crafting use case, you just want a convinience feature like "remember what I can use to craft right now" and then go elsewhere and use that memory to highlight what is craftable using both sets of items OR select some recipes in the crafting menu and remember a list of items you need to craft them for later reference.

@Brambor
Copy link
Contributor Author

Brambor commented Mar 29, 2024

I like everything about the looting management except:

List the items you find in a room

I would expand it:

  1. Boot up the looting manager.
  2. Select a rectangle.
  3. The character runs around and finds all the items.

I don't like "room" because then you have to do it for every room in a building. When the building is cleared of zombies, I want to loot the whole building. "room" still can be some default space around you, if there is a use case, but it is too constraining as the only option.

In the discussion on Discord, you linked, the message reads:

so I'm in favor of having an interface where you enter a room and pop open a "looting menu" that spends some turns and makes some skill checks to enumerate all the stuff in the room, then you just get a sortable, searchable list that lets you highlight the stuff you want and then hit enter to grab it all

I agree wholeheartedly, except for "and makes some skill checks". There should be no skill checks, what would they be for?

And again, I don't like the "room".

@Brambor
Copy link
Contributor Author

Brambor commented Mar 29, 2024

For the crafting use case, you just want a convenience(!) feature like "remember what I can use to craft right now" and then go elsewhere and use that memory to highlight what is craftable using both sets of items

(I assume if you click "remember" twice, or after moving one tile, it will update the entries rather than duplicate them.)

This issue is to discuss how to implement that precisely. I don't like "remember what I can use to craft right now" because that implies a circle with a radius of 5. I want precisely the whole building or precisely some other space. I would have to click "remember" many many times to cover some arbitrary space and then I could miss something too.

I could continue but I would just get back to my proposal.

OR select some recipes in the crafting menu and remember a list of items you need to craft them for later reference.

I do want to do that in #69831. I have it thought out including the UI the player would use. It is described in this comment I just added.

@XygenSS
Copy link
Contributor

XygenSS commented Mar 30, 2024

I would love to have my character once run over a city instead of looting everything I might need. This would save me hours of real-time. And days in in-game time. The player optimizes and has to think "What do I need? What will I need? Do I have this already?".

This is done by bringing your followers to a cleared city and setting a large area as an unsorted zone. You then set up zones for items of interest to be brought back at your feet and let your followers sort everything.

Map memory is fine but the survivor having photographic memory of every item in every house from just glancing at it & being able to recall where specific items are is pretty gamey and makes looting too cheap. There has to be a time investment if you want to loot large areas. You are supposed to rummage through miles and miles of junk. It will take hours and days ingame. The only desired optimization is reducing the time spent IRL and this is already achieved with zones - once you set it up you never have to reconfigure anything except moving the unsorted zone.

@Brambor
Copy link
Contributor Author

Brambor commented Mar 30, 2024

Map memory is fine but the survivor having photographic memory of every item in every house from just glancing at it & being able to recall where specific items are is pretty gamey and makes looting too cheap.

Why is map memory fine then? Nobody could remember all that. It is a game is the only reason. Can do it with IRL paper though.

As seen in "Additional context", I considered using an in-game PC or paper. Time would be spent writing things down. But then it is again suboptimal to IRL pen and paper for no good reason.

I actually want a per-zone list, so the character would know items are in the zone, but not where. The other could be done too, but I am starting with the easier stuff.

You can already pinpoint items by spending IRL time and write it on a paper. That is what I don't like.

There has to be a time investment if you want to loot large areas.

The character still has to run over all of the things to figure out what is there.

You are supposed to rummage through miles and miles of junk. It will take hours and days ingame.

Why do you have to? If I know what I am looking for, I don't need to sort all the clothing and televisions, just looting for toothbrushes.

The only desired optimization is reducing the time spent IRL and this is already achieved with zones - once you set it up you never have to reconfigure anything except moving the unsorted zone.

I disagree. I don't want my character spending in-game days when I could spend IRL time and do all looting I want in under in-game hour. I want my character to be smarter. Do things more similarly to what I would do, if I had the IRL time.

@XygenSS
Copy link
Contributor

XygenSS commented Mar 30, 2024

Why is map memory fine then?

Remembering what a place looks like and recalling it is much easier than remembering what every little trinket is in a house.

Besides, if anything, map memory is indeed op and it should erode just like skill rust.

@Brambor
Copy link
Contributor Author

Brambor commented Mar 30, 2024

Besides, if anything, map memory is indeed op and it should erode just like skill rust.

It did erode before #47253. Why is it OP? You can just write it all on paper.

@Brambor
Copy link
Contributor Author

Brambor commented Mar 30, 2024

@XygenSS

These two must be differentiated in the game: QoL and game balance.

QoL doesn't add anything that you could not do on paper or with more clicks etc.

Game balance is stuff like character skill or recipes. Knowing IRL the recipe doesn't help you, the character still has to find it. Similarly, if you are a brilliant programmer, your character still has 0 skill in computers.

There is never ever a time that a QoL shouldn't be implemented from the user's perspective. Even though it does add code, it adds complexity, so sometimes it is not worth the maintenance cost on the code side.

Meanwhile, game balance should be discussed on the user's level.

This is why I don't understand why you disagree. You can still use the suboptimal way if you want looting to be more difficult than it has to be,

@kevingranade
Copy link
Member

I don't see "whole building" ever being a reasonable thing to do, that's a heck of a lot of navigation through a potentially complex set of areas, and we can never assert things like "the building is clear of enemies" in order to streamline things without revealing out of character knowledge to the player. Even if that's restricted to a 24x24 structure it's a stretch, and when you try to apply it to a larger structure it's clearly past the breaking point. Fundamentally it's making too many decisions for the player, like which route to take through the building, potentially the player would ignore certain rooms, etc.

I agree wholeheartedly, except for "and makes some skill checks". There should be no skill checks, what would they be for?

If you're not making any stat/skill/proficiency checks, you are asserting that no one is any better at the task than anyone else. That's not a reasonable statement. When characters have different levels of ability they have ability checks. That might be fine characters mixing certain things or it might just scale the amount of time it takes to do the search.

@Brambor
Copy link
Contributor Author

Brambor commented Mar 30, 2024

To be clear, I am not making a loot manager. I am making "remember items in an area". So I will stop digging into the loot manager here.

I want to approach exploring space in two ways:

  1. manually
    • Player plays as normal, but within the space, overlay shows them what tiles they haven't explored. I imagine this as blinking "?". They can end the exploring session and save results.
  2. automatically
    • PC runs according to my algo through the space exploring all tiles. Might be dangerous, but I would use it after I have cleared a space or when only easy enemies would be there.

Both have safe mode on. If you meet enemy in automatic, it switches to manual.

If the player knows it is dangerous to use automatic they will not use it. Running around isn't supposed to be 100% safe.

True, if there was 3x3x3 overmap tiles building, I would probably split it into multiple spaces (4 or 9 per z-level, probably). Every item is easier to find then. Then aggregate the results. I will see how it plays out.

@kevingranade
Copy link
Member

I have to second the point XygenSS made, if your goal is "memorize every item in the given area" that's pushing things way too far.

You're either claiming the character has world- class memory that only dozens of people have, or it's abstracting away the process of writing everything down.

I'm going to assert the first is nonsense.

Imagine if you did write every item down along with notes about their locations (but as a QoL measure we don't require the character to manage an actual notebook). For a typical house that would take hours, why would you spend that much time? Looting would proceed at a rate of a few houses a day just to record everything.

@XygenSS
Copy link
Contributor

XygenSS commented Apr 1, 2024

It did erode before #47253. Why is it OP? You can just write it all on paper.

It eroded because of technical limitations. Not the same thing.

"Just write everything down" is not a good argument when your goal is to optimize time spent. In fact writing everything down would be counterproductive to that goal...

@Brambor
Copy link
Contributor Author

Brambor commented Apr 2, 2024

Ok, I think it is stupid to go against you @kevingranade. What if we limit this then? Player is able to memorize only one snapshot. They DO use it for looting purposes.

  1. The player P would open Looting Manager, the last area is shown.
  2. P clicks "Loot new place". This forgets the last place.
  3. P selects the new rectangle to explore and then loot.
  4. Rectangle is explored automatically/manually. (Described two comments higher.)
  5. P is shown the menu as you described in there:

Maintain a list of items you're interested in looting.
List the items you find in a room, highlight ones you haven't seen before and ones you've noted as looting targets, and automate retrieving them all.

If it is still too OP to remember the last snapshot, it could be forgotten after 16h automatically.

Note: it would solve my other issue:

@Brambor
Copy link
Contributor Author

Brambor commented Apr 2, 2024

I would still like to expand it to two snapshots: one permanent (probably your base) and one temporary (looting manager).

The base snapshot would be used as a list of items the player has for planning crafting.

@IdleSol
Copy link

IdleSol commented Apr 2, 2024

As I understand it, the main problem is automation. You come in, click a button, and get a list of everything that's available. That's not good. Even if you limit the area to one tile.

Take away the automation. You come in, you find what you need. You pressed a button and that's the item that goes into the "loot manager". Repeat for the next item.

@Brambor
Copy link
Contributor Author

Brambor commented Apr 2, 2024

IdleSol:

As I understand it, the main problem is automation. You come in, click a button, and get a list of everything that's available. That's not good. Even if you limit the area to one tile.

Automation is the point of Loot Manager. I believe Kevin wanted exactly that:

Kevin:

List the items you find in a room, highlight ones you haven't seen before and ones you've noted as looting targets, and automate retrieving them all.

IdleSol:

Even if you limit the area to one tile.

I don't get this part at all. If you "pick up items from one nearby tile" g right now, this is exactly what you get (a list of everything available on that tile after a click of a single button). If you use AIM, you get it for 9 tiles centred around the PC.

@IdleSol
Copy link

IdleSol commented Apr 3, 2024

I don't get this part at all. If you "pick up items from one nearby tile" g right now, this is exactly what you get (a list of everything available on that tile after a click of a single button). If you use AIM, you get it for 9 tiles centred around the PC.

You've said several times that it's useful for the player and necessary for graph creation (cata hellmod?). I'm judging from the player's perspective and what needs I've encountered while playing the game.

It's hard for me to imagine a case where I need to know all the things that are in an area. In most cases, it would only get in the way.

Imagine, you on base create a shot like this and get a few thousand positions. You are missing a hammer. In an ideal situation, you would mark that hammer and know that you need to find it. Or added some components and tools to create it. Before you start searching for items, you look at this list and remember what you need. Perhaps automation and the game gives you a hint that what you need is nearby.

What if there are 1000 and 1 items in this list? Do you need to manually remove the unnecessary? Or find what you need and mark it? Isn't it easier to mark what you need?

I admit that maybe I don't understand your idea correctly. Because I envision a notebook in front of me, in which I could write down the items I need, their quantity and some notes. This is to create, this I have, and this I need to find.

P.S. Can't you get the list of items you need from the save file? The save already has all the items in it. Take the coordinates of the player, look at the corresponding tiles in the save and get a list of all items. Then sort, combine the same items and the list of items is ready.

If I understand correctly:

  {"version":33,
  "coordinates":[530,567,0],
  "turn_last_touched":5212819,
  "temperature":0,
  "terrain":[...],
  "radiation":[0,144],
  "furniture":[...],
  "items":[5,5, [
    {"typeid":"scrap","charges":1000,"bday":5212814,"last_temp_check":0},
    {"typeid":"pockknife","bday":5212800,"item_vars":{"magazine_converted":"1"},"owner":"your_followers","last_temp_check":0},
    {"typeid":"rm13_armor",...}
    ]
  ],
  "traps":[],
  "fields":[],
  "cosmetics":[],
  "spawns":[],
  "vehicles":[],
  "partial_constructions":[]
  }

That's what you need.

UPD. Corrected a mistake. I inserted the wrong lines from the save.

@Brambor
Copy link
Contributor Author

Brambor commented Apr 3, 2024

My bad because I drag this out to more ideas without specifying.

Thanks for clearing it out! I see you are against the idea of item snapshot. But you are not against Loot manager. Specifically, you are not against auto searching room to show immediate menu for looting. But you are against any automatic memorization. Calling memorization automatic is what confused me originally. I thought automatic is only the PC movement to immediately discover (or loot) items in a room. I got confused but now I see.

Thanks for mentioning "cata hellmod". I will look into it :)

@kevingranade
Copy link
Member

Yes, as I outlined here: #72697 (comment) but probably not clearly enough, the issues I have are:

  1. making "create a snapshot" a separate action independent of any use cases.
  2. making it indiscriminately memorize all items in an area, especially if repeated.

My proposal for 1 is to embed it in a looting interface so it's clearer how to use it and it's automatically integrated with the related actions of finding and picking up the target items.
My proposal for 2 is to maintain a list of the kinds of items the player is interested in, and only ever remember the locations of matching items.

This leaves the player to apply what they're good at, their sense of discrimination about what items are and are not important without burdening them with a ton of mostly useless data.

@Brambor
Copy link
Contributor Author

Brambor commented Apr 3, 2024

I am thinking about the Loot Manager which I will focus from now on. Rather than just ordering "pick" and "don't pick", we could let the player order the items by how much they want them. I personally would place food at the top, since it can spoil. Then rare metals etc.

I already wrote a long description for myself, here it is. It's not well written, sorry.
todo: fix grammar tomorrow night

In CDDA, lets make list of items the player would like to loot. Lets make a long list that the player can order. Then items to be looted can be shown in that order. With 11k total items in CDDA, let's show only items the player have seen. Whenever looting, NEW items are marked as such (Kevin's idea) and player can sort them into the priority list. Let's make NEW category and unsorted category for items the player cannot be bothered to sort right now.

One big list is hard to manage. We can split them into smaller lists and order them in a folder-like structure. Moving groups would then become as easy as moving items. And the player can be shown and can sort by the groups they made for more granularity.

Possible QoL: Also a simple algo can be made to maximize the loot value to the player. When viewing a loot list. The algo will simply look at player's loot and the present loot, sort by priority, pick from top. The player will see "Drop these items and pick up these". Typically, as player continues looting, they will drop less and less, as their loot will be more and more subjectively valuable.

On top of that. The list can have count wanted. [[Item snapshot issue]] of base is needed for that. Player specifies: I want 1k thread with priority X, 1k-10k with priority Y and 10k-inf with priority Z. With that, telling NPC what should they loot could become really easy.

With that, add a group for quest items. These mainly include player made todo made from [[acquire graph]] I am just calling it fancy. This group would default to highest priority, but the player can sort it however they can.

Macros: Player can add item filter (like in autopickup) to get "all items with gold component" and such. For clearer and easier management.

@Brambor
Copy link
Contributor Author

Brambor commented Apr 3, 2024

I don't completely agree @kevingranade, but maybe we just talk about it differently. Maybe If I make this and acquire graph then you might see how Item Snapshot ties it all together for the player.

Maybe not. I just want to point out I haven't given up yet :) But I will show (later) rather than tell (now) since the systems aren't in place yet.

I wanted to point out that player could say "I wanna loot everything later" as a mistake in your description. But now I see you maybe don't want to forbid the player from doing that? See the following:

This leaves the player to apply what they're good at, their sense of discrimination about what items are and are not important without burdening them with a ton of mostly useless data.

Or would you limit the player differently? Such as letting the player remember only 50 items total?

When I play CDDA I don't usually even mark houses as "explored", since there are still like fridges to take apart, even if every house has them. So I would definitely mark all items to be "looted later".

If you are for limit at 50, you will probably be against the "priority list" too. I am fine with leaving it out for the time being.

@IdleSol
Copy link

IdleSol commented Apr 4, 2024

Possible QoL: Also a simple algo can be made to maximize the loot value to the player.

Why? Leave it to the player. He'll figure out what he needs. Just tell them that there is an item in a certain radius marked "to be found."

The player will see "Drop these items and pick up these"

In my opinion, telling a player what to do is a very bad idea. Say there is a wanted item nearby. Let the player look for the item and decide for himself if he needs it and what he needs to do to carry it away.

@kevingranade
Copy link
Member

Or would you limit the player differently? Such as letting the player remember only 50 items total?

That circles back around to the observation that the player isn't just glancing around and memorizing everything instantly, there should be some time cost for each item you "memorize" as part of the looting action, if you want to add everything to the list you can, but welcome to spending an hour per house writing down a manifest.

@Brambor
Copy link
Contributor Author

Brambor commented Apr 4, 2024

Ok, then, let's discuss the magnitude of the time cost. I think it should

  • Take ~ 10 seconds per item. If player is writing it down, it makes sense.
  • Same items (item counts) in the same tile should take no additional time to remember. If you disagree, then like ½ second per item to simulate counting 1000 rags. But what about thread? There are like 200 thread that just mean 1 meter or so. It shouldn't take additional 100 seconds per meter of thread, more like ½s per 1m.
  • To count charges, you spend ½ second per default stack. With 200 in default stack, 1000 charges means 5 * ½ seconds.
  • Items on different tiles would be counted as separate items. Is it needed? I don't lobby for that. We just have to address it.

Updating is important too:

  1. Let's say you memorized all items in your base.
  2. Now you have added new loot of 10 items.
  3. You want to update the memory of your base. I suggest that it takes only as long as memorizing the 10 new items would. Are you ok with that? Alternatively, I suggest adding a small constant per each memorized item, but I would like to avoid that.
  4. You used up 20 items, then you want to update. I suggest it takes only the time to forget 20 items. If that is any time at all.

@waxcatape
Copy link
Contributor

As far as how a person could "remember" in detail the contents of a room, you could just make a bunch of photos of the room and the containers in it. Should be cheaper on average than 10 seconds/item too.

@kevingranade
Copy link
Member

Yeah, I think you have roughly the right magnitude. If anything probably about half that base cost or so because you're not having to write out the precise location for every individual item.

Concerning photos, it's surprisingly difficult to capture every item you might be interested in with photos, not to mentoned things like piles of items where you need to rearrange them to make them all visible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Suggestion / Discussion> Talk it out before implementing
Projects
None yet
Development

No branches or pull requests

6 participants