CleverRaven / Cataclysm-DDA

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

Rubic bionic offers don't update between restocks #75975

Closed Vgoloshivskiy closed 1 week ago

Vgoloshivskiy commented 2 weeks ago

Describe the bug

Rubic bionic offers don't update between restocks unless you buy bionics that he already have Rubic bionic stockpile don't get cleared after each restock so his bionics stockpile growth to insane amounts They are updated if you buy old bionics

Attach save file

Bells-trimmed.tar.gz

Steps to reproduce

  1. Load Save
  2. Check stock in Rubic
  3. Wait for stuff to restock (2h in game)
  4. See that no new bionics spawned and no old one got removed Or You can just change date by 6 day increments and ask hin for trade after each time for me it as around day 60 that he stopped spawning new bionics

Expected behavior

New bionics appear old item/ sold item dissapear

Screenshots

image 29 LED Tatoos

Versions and configuration

Additional context

No response

andrei8l commented 2 weeks ago

Can't reproduce. From your save and with the 2024-08-26-1250 release, on linux:

On load (day 54) ![Screenshot from 2024-08-26 18-56-46](https://github.com/user-attachments/assets/5cfc5cba-e56b-4bf3-99af-5d7ac33fd17d)
First restock after advancing time by 6 days and 1 hour (day 60) ![Screenshot from 2024-08-26 19-01-05](https://github.com/user-attachments/assets/a3f13cbe-3990-419c-996d-738fd9cbeea6)
Second restock after a further 6 days and 1 hour (day 66) ![Screenshot from 2024-08-26 19-01-18](https://github.com/user-attachments/assets/25e7f296-1a17-44b2-883c-d912218ac725)

The stock is clearly changing. Just to be sure, I ran a further test where I teleported away before advancing time and had the same result.

There's a very high number of CBMs in your save though, so there could still be something wrong. Maybe we're missing a step or this only reproduces on Windows.

Vgoloshivskiy commented 2 weeks ago

Can't reproduce. From your save and with the 2024-08-26-1250 release, on linux:

On load (day 54) First restock after advancing time by 6 days and 1 hour (day 60) Second restock after a further 6 days and 1 hour (day 66) The stock is clearly changing. Just to be sure, I ran a further test where I teleported away before advancing time and had the same result.

There's a very high number of CBMs in your save though, so there could still be something wrong. Maybe we're missing a step or this only reproduces on Windows.

i m pretty sure it related to large amount of CBMs that accunulate maybe just related to Windows, i managed to fix for myself by buying out all trashy cbms before restock and then it worked properly (how did you advance time by waiting or changing date?) he should restock in around 2 h from the moment i made save On load is not day 54 on load is day 54 of summer + 30 days of spring

PatrikLundell commented 2 weeks ago

There's a debug command to change the time. I think you need to bind the debug menu to a key to access it, but then I think it's under map and then time.

Edit: Failed to reproduce on Windows (just downloaded and recompiled). Loaded save, teleported away, debug waited 10 days, teleported back to the entrance and walked up to Rubik, initiated trade, the huge inventory had been changed and reduced to a reasonable level (including the CBM section).

Vgoloshivskiy commented 2 weeks ago

There's a debug command to change the time. I think you need to bind the debug menu to a key to access it, but then I think it's under map and then time.

Edit: Failed to reproduce on Windows (just downloaded and recompiled). Loaded save, teleported away, debug waited 10 days, teleported back to the entrance and walked up to Rubik, initiated trade, the huge inventory had been changed and reduced to a reasonable level (including the CBM section).

can you just try spending 2h next to him so his stock updates without debug you can ask him how long till next batch and it will be like 1h 30 min or something like that? I m pretty sure nowhere in steps to reproduce is written debug change date by 10 days (it might be that those 10 days cleared some of his stock without adding new items so he is clear when you talk to him again but i m visiting him evry 6 days as i want to prevent negative mutations by getting bionics to compensate for them).

andrei8l commented 2 weeks ago

can you just try spending 2h next to him so his stock updates without debug you can ask him how long till next batch and it will be like 1h 30 min or something like that?

It wasn't clear where you got the 2 hours from. Looks like that's a new dialogue feature.

/confirmed Elapsed time isn't calculated correctly for shop consumption. It uses time elapsed since next/current restock rather than previous. If you check exactly at the restock point, time elapsed is pretty much zero so nothing is consumed.

https://github.com/CleverRaven/Cataclysm-DDA/blob/8d2ad4c0ed09a349476179fad4f4ba9c87eb5b10/src/npc.cpp#L1964-L1965

https://github.com/CleverRaven/Cataclysm-DDA/blob/8d2ad4c0ed09a349476179fad4f4ba9c87eb5b10/src/npctrade_utils.cpp#L35

Vgoloshivskiy commented 2 weeks ago

can you just try spending 2h next to him so his stock updates without debug you can ask him how long till next batch and it will be like 1h 30 min or something like that?

It wasn't clear where you got the 2 hours from. Looks like that's a new dialogue feature.

/confirmed Elapsed time isn't calculated correctly for shop consumption. It uses time elapsed since next/current restock rather than previous. If you check exactly at the restock point, time elapsed is pretty much zero so nothing is consumed.

https://github.com/CleverRaven/Cataclysm-DDA/blob/8d2ad4c0ed09a349476179fad4f4ba9c87eb5b10/src/npc.cpp#L1964-L1965

https://github.com/CleverRaven/Cataclysm-DDA/blob/8d2ad4c0ed09a349476179fad4f4ba9c87eb5b10/src/npctrade_utils.cpp#L35

Finally i was thinking that i was going insane (also probably increase consumption rate for bionics from default 5 to 6 or 7 as there anyway spawns way to much) in later weeks