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

Charge bionics from UPS via Cable Charger System CBM + bugfixes for solar backpacks #33546

Merged
merged 11 commits into from
Sep 4, 2019
Merged

Conversation

nexusmrsep
Copy link
Contributor

@nexusmrsep nexusmrsep commented Aug 25, 2019

Summary

SUMMARY: Features "Charge bionics from UPS via Cable Charger System CBM"
Also some bugfixes on solar backpacks that had to be done along the way.

Purpose of change

There is a lot of discussion lately about the validity of certain methods of power generation for the CBM by CBMs. This led to some bionics being obsoleted, as there is a limit to what you can put inside a body that can generate power, because those things are usually big and/or dangerous.

In all this I noticed that one obvious path was overlooked, or alt least not discussed extensively.

While it is natural that many power-related CBMs are focused on mobility, but the prototypes and most early versions must have used Cable Charger System CBM extensively. With development, the high-end versions might have gone off-line, while civilian versions could as well use Cable Charger System to pull the energy from the grid. You'd plug yourself in for the night, like you plug in your smartphone or an electric car.

There is a middle ground between using grid (now: vehicles) and full mobility of integrated CBMs. This middle ground are external power generating devices or power storage devices that can by plugged in by cable, and carried in inventory.

First of a kind, that I also had a privilege to introduce, were solar backpacks. Wear one, unfold, plug in and get some power with time.

So I though: if Universal Power Supply was designed to power mobile weapon platforms, then why would it not power bionic systems? Power is power, and a soldier / bionic operator could just carry a plugged UPS to power himself in the field. External power, high capacity, universal standardized connectors, mobility. Can't see a reason why it wouldn't be implemented before fully integrated power-generation CBMs.

Describe the solution

I've done few things here:

  • fixed some bugs in solar backpacks regarding to cable connection not working properly (prerequisite of this PR),
  • while at it, I rebalanced power output of solar backpack to be in line with power output of solar panel (50W in sunlight) and made it dependent on sunlight; take note: this is a nerf from previous values, but previous values were predating solar panels rebalance,
  • made UPS and advanced UPS connectable via jumper cables / heavy-duty cables to Cable Charger System CBM installed in character's body,
  • game tracks available options of 'attaching' cable actively, switching them on/off when power source (UPS, solar pack) is available, and graying them out to avoid unsupported connections,
  • game tracks loss of cable or power source

Describe alternatives you've considered

  • when using various utility CBMs in the absence of internal power storage, game could allow direct power pull from the UPS
  • There are some interactions that need a thought or two, like for example "should a UPS plugged to CCS CBM be available to other systems?". Left at "yes" for now.
  • for solar backpacks: there is a place for upgraded solar backpack (one between normal and quantum) for better power output

Additional context

If you have a UPS with some juice and Cable Power System CBM you can use jumper cables:
image
image
image
image
image

Or other way around.
It will activate your UPS and you will draw power from it.

image

TODO

  • main features
  • some descriptions have to change to hint this new feature
  • some more testing need to be done to check all the paths of attach/drop

@nexusmrsep nexusmrsep added <Enhancement / Feature> New features, or enhancements on existing Bionics CBM (Compact Bionic Modules) Items: Battery / UPS Electric power management <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` labels Aug 25, 2019
@Rail-Runner
Copy link
Contributor

Would it be possible to have an ability to just plug self to a battery directly? Maybe even recharge it using your own power, if you want to stockpile energy that you generate in external bateries.

@nexusmrsep
Copy link
Contributor Author

nexusmrsep commented Aug 25, 2019

Battery System CBM is for that I believe.
EDIT: For the second part, it's not out of scope of possibility to dump CBM power to external storage IMHO.

@dunstad
Copy link
Contributor

dunstad commented Aug 26, 2019

Since the solar backpack charges you through the Cable Charger CBM, which seems to use jumper cables, would it make sense for the backpack to also allow charging vehicle batteries?

Not that you have to implement that by any means, just curious if the logic checks out or if I've got low electronics skill.

@nexusmrsep
Copy link
Contributor Author

Yes. It's basically an equivalent to one solar panel. To do that in game, some infrastructure would have to be built, but it's plausible.

@Fris0uman
Copy link
Contributor

Fris0uman commented Aug 26, 2019

While you're at it could you replace is_wearing( "solarpack_on" ) with a flag check so that solar clothe can be modded in?

@nexusmrsep
Copy link
Contributor Author

I agree that it would be beneficial, but it would also require JSON entry for epower generation (efficiency) and thus more infrastructure that meets the eye. Simple flag would not be enough. I don't want to bloat this PR with something it's not intended to achieve, so let's maybe put it for later. I also stated that there is a place for some more solar backpack variants and such infrastructure would help achieve that goal. I will place it on my ToDo list, but no promises on "when". I already code less then I wish I would, due to time constraints.

src/item.cpp Outdated Show resolved Hide resolved
src/item.cpp Outdated Show resolved Hide resolved
src/item.h Show resolved Hide resolved
src/item.cpp Outdated Show resolved Hide resolved
@nexusmrsep nexusmrsep marked this pull request as ready for review August 26, 2019 21:31
src/item.cpp Outdated Show resolved Hide resolved
src/bionics.cpp Outdated Show resolved Hide resolved
src/item.cpp Outdated Show resolved Hide resolved
@nexusmrsep nexusmrsep changed the title [CR] Charge bionics from UPS via Cable Charger System CBM + bugfixes for solar backpacks Charge bionics from UPS via Cable Charger System CBM + bugfixes for solar backpacks Aug 30, 2019
@ZhilkinSerg ZhilkinSerg self-assigned this Sep 1, 2019
@ZhilkinSerg ZhilkinSerg merged commit adf6a8a into CleverRaven:master Sep 4, 2019
@ZhilkinSerg ZhilkinSerg removed their assignment Sep 4, 2019
misterprimus pushed a commit to misterprimus/Cataclysm-DDA that referenced this pull request Sep 21, 2019
…olar backpacks (CleverRaven#33546)

* charge bionics from UPS via cable

* descriptions, fixes, astyle, cleanup

* p==nullptr check in cable processing

* Update src/item.cpp

Co-Authored-By: BevapDin <[email protected]>

* var naming convention unification, etc. for clang-tidy

* Apply suggestions from code review

Co-Authored-By: BevapDin <[email protected]>

* typo fix
@nexusmrsep nexusmrsep deleted the UPS-cable-CBM branch May 4, 2020 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bionics CBM (Compact Bionic Modules) <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` <Enhancement / Feature> New features, or enhancements on existing Items: Battery / UPS Electric power management
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants