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

Time compressed activities are slower while carrying/wearing switched on UPS powered items. #47264

Open
Quintovir opened this issue Feb 6, 2021 · 3 comments
Labels
<Bug> This needs to be fixed [C++] Changes (can be) made in C++. Previously named `Code` Code: Performance Performance boosting code (CPU, memory, etc.) Items: Battery / UPS Electric power management (S2 - Confirmed) Bug that's been confirmed to exist

Comments

@Quintovir
Copy link

Describe the bug

Time compressed activities are slower when carrying/wearing switched on tools and clothes (does not matter if you are wearing them) that have been modified with UPS conversion mods compared to ones using removable batteries for:
cellphone (UPS)
combat exoskeleton
field combat exoskeleton
flashlight (UPS)
electric blanket (UPS)
geiger counter (UPS) "turn continuous scan on"
headlamp (UPS)
heavy duty exoskeleton
heavy duty flashlight (UPS)
mp3 player (UPS)
laptop computer (UPS)
pair of thermal electric gloves (UPS)
radio (UPS) "the UPS radio lost the ability to scan for stations"
reading light (UPS)
smart lamp (UPS)
smartphone (UPS) "music and/or light"
survivor headlamp (UPS)
thermal electric balaclava (UPS)
thermal electric outfit (UPS)
thermal electric suit (UPS)

All these items share the ability to be manually switched on/off. Using UPS items that are used as needed (soldering iron, arc welder, etc) don't seem to affect the speed of time compressed activities.
There's probably other UPS converted/powered items with manual switches that I missed that also cause time compressed activities to slow down.

Steps To Reproduce

  1. Turn on one of the tools listed above.
  2. Wait 30 minutes, disassemble, craft, read, or do some other time compressed activity.
  3. Note how fast time passes.
  4. Shut off the tool you turned on in step 1.
  5. Turn on a copy of the same tool that has a removable battery installed.
  6. Repeat step 2-4.
  7. Compare how fast the time passed while using UPS modded and non-UPS modded tools.

Expected behavior

Compressed activities while carrying/wearing switched on UPS converted tools and clothes should progress the time about as fast as when using switched on tools/clothes using removable batteries.

Screenshots

N/A

Versions and configuration

  • OS: Linux
    • OS Version: LSB Version: n/a; Distributor ID: ManjaroLinux; Description: Manjaro Linux; Release: 20.2.1; Codename: Nibia;
  • Game Version: 0.E-9434-g1e8a075abd [64-bit]
  • Graphics Version: Tiles
  • Game Language: System language []
  • Mods loaded: [
    Dark Days Ahead [dda],
    Blaze Industries [blazeindustries],
    No Fungal Monsters [No_Fungi],
    Fuji's Military Profession Pack [fuji_mpp],
    SpeedyDex [speedydex],
    Stats Through Kills [stats_through_kills],
    Stats Through Skills [StatsThroughSkills]

Additional context

Save game with the mentioned tools in the inventory or on the floor. There are plenty of materials in the vicinity to use.

Champlin.zip

@anothersimulacrum anothersimulacrum added [C++] Changes (can be) made in C++. Previously named `Code` Code: Performance Performance boosting code (CPU, memory, etc.) labels Feb 6, 2021
@Aivean Aivean added the <Bug> This needs to be fixed label Feb 6, 2021
@Aivean
Copy link
Contributor

Aivean commented Feb 6, 2021

I can confirm the issue.

Without UPS:
image

With UPS:
image

The problem appears to be in how UPS charges are consumed: via the crafting inventory, that currently has to be recreated every turn, and which is based on the inventory class that copies items:
image

I think the solution would be to replace crafting inventory with the new lightweight class temp_crafting_inventory (introduced in #46286). To reduce the scope, as a temporary solution, instead of replacing crafting_inventory everywhere, it can only be replaced inside the Character::use_charges method.

Alternative approach could be to add separate cache for USP items near the player that could be used by Character::use_charges method.

@ZhilkinSerg ZhilkinSerg added the (S2 - Confirmed) Bug that's been confirmed to exist label Feb 8, 2021
@Aivean
Copy link
Contributor

Aivean commented Feb 8, 2021

Seems to be caused by/related to #45781

@Hirmuolio
Copy link
Contributor

#48608 should help with this.

@actual-nh actual-nh added the Items: Battery / UPS Electric power management label May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bug> This needs to be fixed [C++] Changes (can be) made in C++. Previously named `Code` Code: Performance Performance boosting code (CPU, memory, etc.) Items: Battery / UPS Electric power management (S2 - Confirmed) Bug that's been confirmed to exist
Projects
None yet
Development

No branches or pull requests

6 participants