CleverRaven / Cataclysm-DDA

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

Basket fish trap doesn't seem to work outside the reality bubble #62151

Open PatrikLundell opened 2 years ago

PatrikLundell commented 2 years ago

Describe the bug

I made a basket fish trap, made bait for it, and placed it in various places about a dozen time without catching anything at all, while still losing bait. Only one place stated that I wouldn't have much luck, while another, tried several times, had 3 visible fish in a rather small shallow pond of a size 5*4 tiles or so. In all of these attempts I moved to the body of water, set the trap, and then returned to do whatever I needed to do elsewhere, checking back after a number of hours (at most the next day).

The only time I actually did catch anything was when I placed the trap two (in-game) tiles away from the PC extracting clay on a river bank.

Steps to reproduce

  1. Craft a basket fish trap
  2. Craft fish bait
  3. Load the trap fully with bait
  4. Travel to a body of water and set the trap.
  5. See the trap is marked as "active".
  6. Move away to do something useful.
  7. Return after the 3 hours is up and find the trap no longer active, bait missing, but nothing caught.
  8. Repeat until you think it's not working.

Expected behavior

The trap should work regardless of whether it's in the reality bubble or not when it times out. That's sort of the point of a passive trap.

Screenshots

No response

Versions and configuration

Additional context

My PC's Survival skill is 8, which I think should be sufficient.

mqrause commented 2 years ago

I pretty sure that it did work when I made #58549. Haven't used traps much since then, though.

PatrikLundell commented 2 years ago

This is the first time I've tried to do so (after first making a net, only to find that it can't actually be used for its primary purpose). After writing the report I tried twice more, this time setting the trap at the remote side of the small body of water with known fishes in it, moved away a bunch of world tiles, debug waited 3 hours, and then returned. Neither attempt yielded any fish. I've seen the known fish on the same tile as the trap while it was active (before moving away) without catching anything.

Fishing isn't critical to my character, so it's just an annoyance to me, but I still think it should be reported.

Edit: Forgot to mention the reasoning behind the tests. I did have the idea that evaluation of fish presence might depend on the number of fish available within the vicinity when the trap is evaluated, and if just enters the reality bubble triggers evaluation there often isn't much water to evaluate, since the PC typically arrives from the land side.

mqrause commented 2 years ago

https://github.com/CleverRaven/Cataclysm-DDA/blob/4ea1c29045ea71a87dee41f995078d234a26c9e7/src/iuse.cpp#L1838

The logic is after that. Fish traps aren't actual traps, they're just items that do stuff after a timer ticks down. As far as I can see success only depends on your survival skill. But spawning actual fish in the trap seems to depend on nearby fish monsters in a waterbody connected to the place of the fish trap (radius 60, independent of reality bubbly), with just a 5% chance per success for one fish if there's none nearby. That comment is slightly wrong. With 8 survival you should be pretty much guaranteed to catch 1-2 existing fish, so if that doesn't happen, I can only imagine that the water tiles aren't actually flagged as fishable and some check informing you of that doesn't work properly.

PatrikLundell commented 2 years ago

Tested to teleport to my little "definitely fish here" pond, set a trap, and just pressed wait for 3 hours, moving some 5 in-game tiles away until it got too dark, after which I moved to two tiles away. When the trap triggered it contained 5 fish, so there's something fishy going on.

mqrause commented 2 years ago

Can you attach a save with your test pond?

PatrikLundell commented 2 years ago

I'll try. I think I'll have to shrink the save to fit, though, but it should be possible.

PatrikLundell commented 2 years ago

Standing by the pond, trap in inventory: Indialantic - Copy (2) - Copy.zip

mqrause commented 2 years ago

So it seems the code looking for fishable monsters is the issue somehow. The fishable locations are detected properly, but it can't find any of the fish in the pond. Teleporting on top of it from far away even leaves the list of monsters to check completely empty. I'm still fairly sure it used to work back when I made the other issue, so assuming I'm not misremembering that, maybe some point conversion error slipped in since then.

github-actions[bot] commented 1 year ago

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.

RenechCDDA commented 1 year ago

Related/duplicate: #48485

If one is resolved in the future both should likely be considered resolved