Cataclysm-BN icon indicating copy to clipboard operation
Cataclysm-BN copied to clipboard

feat(balance,mods): rebalance mod that disables most recharging from UPS

Open Secret-Cisco opened this issue 2 years ago • 11 comments

Summary

SUMMARY: Mods "Adds a rebalance mod that disables most recharging of small electronics from a UPS"

Purpose of change

Smartphones, MP3 players, and such draining my UPS is bothersome and unnecessary to me.

Describe the solution

Makes common electronics recharge only in a recharger and not from your UPS by replacing "USE_UPS" with "RECHARGE"

Describe alternatives you've considered

Make small electronics charging toggleable in some manner, but alas I cannot code.

Testing

Loaded it up in game, everything seemed to check out. Stuff recharged in a charger but left my UPS alone.

Additional context

I'm open to changing the name. image

Secret-Cisco avatar Jun 07 '22 22:06 Secret-Cisco

Every one of these items should already be rechargeable, and if not they really should be in vanilla since this is generally used as a standin for being able to plug it in.

A feature that lets you specifically set a UPS item to toggle charging would be a much better solution here but that'd be code stuff (or dirty hacks involving transform use action to gain or lose the UPS flag), so hmm. :/

chaosvolt avatar Jun 08 '22 15:06 chaosvolt

Every one of these items should already be rechargeable, and if not they really should be in vanilla since this is generally used as a standin for being able to plug it in.

A feature that lets you specifically set a UPS item to toggle charging would be a much better solution here but that'd be code stuff (or dirty hacks involving transform use action to gain or lose the UPS flag), so hmm. :/

They all are indeed rechargeable in a station already, I haven't poked around that much so I don't know if they get that from "USE_UPS" or if they'd have it either way because of their battery charge or what. All I know for sure is that the rechargeable flag adds that line "This tool has a rechargeable power cell..." to the info panel and I was concerned that without it or the UPS flag it'd stop charging. It seems to work perfectly like this so I didn't poke around further at the time.

Adding togglable UPS use would be nice. I also like the idea of separate, in inventory, non-UPS charging system. I did experiment a bit with the idea of a hand-crank charger type tool that charged batteries from the UPS but it didn't work.

I did get a fun hack working well enough on the aftershock UPS (with the integrated charge), when it's "on" UPS_off it works normally but when it's activated it starts working in reverse losing is_ups and gaining use_ups so that I can charge it up on the go from my bionic UPS and use it as a large buffer.

Secret-Cisco avatar Jun 08 '22 16:06 Secret-Cisco

Workaround mods suggest that something is wrong in the core. I'll consider the mod, but wait with it a bit, since removing a mod can be a disturbance (saves, players asking where it is etc.) and we might be able to figure out a way to make rechargeables suck less in core.

Coolthulhu avatar Jun 08 '22 16:06 Coolthulhu

Workaround mods suggest that something is wrong in the core. I'll consider the mod, but wait with it a bit, since removing a mod can be a disturbance (saves, players asking where it is etc.) and we might be able to figure out a way to make rechargeables suck less in core.

That's fine, I mostly made this for my own use and thought I might as well throw it up here too. Tbh I think consumer electronics work pretty well without in-inventory recharging. MP3 players will run almost an entire day in a full charge and are dirt common, and I'm not sure how you'd ever really drain a normal laptop other than using it as a flashlight.

Secret-Cisco avatar Jun 08 '22 17:06 Secret-Cisco

I think they already should be rechargable. They have been remaining to be UPS since times when there was only 2 kind of power supply: batteries or UPS.

AngelicosPhosphoros avatar Jun 09 '22 16:06 AngelicosPhosphoros

As I said, the items do recharge as expected in the base, vanilla game but I just tested it and they do not charge at all if they don't have either the "USE_UPS" OR "RECHARGE" flags.

So "USE_UPS" allows battery chargers and UPS's to charge

and "RECHARGE" allows just chargers but not UPS

Secret-Cisco avatar Jun 09 '22 17:06 Secret-Cisco

It might be nice if recharging and using the UPS were more fully separated, without one implying the other. By which I mean that "RECHARGE" allows charging at stations and "USE_UPS" allows using the UPS's power instead of its own, that way you could have tools with internal batteries that could be recharged and use their own power and also use UPS power (if they run out of their own?) but without constantly topping up their battery from the UPS.

Though unless you added some new behavior of some kind it would then be impossible to recharge any type of battery on the go (via the bionic UPS for example)

Secret-Cisco avatar Jun 09 '22 18:06 Secret-Cisco

@Secret-Cisco, sorry for leaving the PR open for so long. I mostly agree with BFN that it'd be preferable to keep this mod as 3rd-party (not mainline) and fix the issue with code.

Would it be ok to close this PR as stale?

scarf005 avatar Dec 06 '23 04:12 scarf005

@Secret-Cisco, sorry for leaving the PR open for so long. I mostly agree with BFN that it'd be preferable to keep this mod as 3rd-party (not mainline) and fix the issue with code.

Would it be ok to close this PR as stale?

Well I definitely think it'd be better change the code to fix the problem* than a kludgy mod too but that's the best that I can do and I don't plan on doing anything else with this for the foreseeable future so I guess that's fine.

*The problem being that looting things like smartphones/etc creates an unnecessary drain on your UPS. Running out of power for your actual tools & weapons because you picked up a bunch of scrapable small electronics can be inconvenient or hazardous to your health.

Secret-Cisco avatar Dec 07 '23 06:12 Secret-Cisco

thanks for the context. in an ideal solution, would it mean small electronics like phones or mp3 still use UPS but would only charge from recharger (thus not drain from UPS anywhere)?

scarf005 avatar Dec 09 '23 00:12 scarf005

Two possible ideas come to mind:

  1. Per suggestion, have household accessories stay RECHARGE but remove the flag that makes them drain UPS.
  2. Alternatively, code in a use action for the UPS that can be used to select certain items, which toggles that item between charging off UPS vs. not charging. Possibly via said items defaulting to having a new flag called UPS_COMPAT or something to that effect, which the UPS use action swaps to a valid flag for charging.

chaosvolt avatar Dec 09 '23 01:12 chaosvolt