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

Proposal for a battery overhaul #29536

Closed
Inglonias opened this issue Apr 13, 2019 · 8 comments
Closed

Proposal for a battery overhaul #29536

Inglonias opened this issue Apr 13, 2019 · 8 comments
Labels
Items: Battery / UPS Electric power management Items / Item Actions / Item Qualities Items and how they work and interact [JSON] Changes (can be) made in JSON <Suggestion / Discussion> Talk it out before implementing

Comments

@Inglonias
Copy link
Contributor

Inglonias commented Apr 13, 2019

Is your feature request related to a problem? Please describe.
Batteries in this game are a little abstract at the moment. I find that kind of annoying and would like to propose an overhaul of the battery system. The major problems I currently see are as follows:

  • Everything from an mp3 player to an arc furnace accepts the same kind of batteries.
  • You can split a flashlight battery 100 ways if you want to for some reason.

After doing some research, it turns out that tools that run off of batteries can be modded to accept magazines with no extra C++ code whatsoever. I've created this mod as a proof of concept:

MagazineFlashlight.zip

Describe the solution you'd like
All battery powered tools should be converted to run off of magazines rather than raw batteries. My proposal involves three types:

  • Light personal batteries - These can fit in the palm of your hand and are used to power small electronics like flashlights, mp3 players, and watches.
  • Medium personal batteries - These are about the size of your fist and are used to power commercially available power tools and kitchen appliances.
  • Large personal batteries - These are about the size of car batteries and can be used to power industrial grade power tools like furnaces, kilns, and jackhammers.

Describe alternatives you've considered
The battery system works well enough right now, but it's kind of silly. Since it seems like all we would need is some JSON for the lion's share of this proposal to work, this might not be as hard as you'd think.

Additional context
MagazineFlashlight.zip

Additionally, this is a link for a comparison from my branch to the master branch.

Risks and Challenges
While code-wise, this may not be too challenging, this proposal has a number of problems I haven't actually worked out yet.

  1. What do we do about existing save games? If we migrate over carelessly, the best that could happen is that people can load up their existing games and decide themselves how to use the debug menu to migrate to the new system. That's... not great.
  2. Modded tools are a problem. The extra battery mod can be replaced with high capacity versions of these batteries (maybe just taping two light batteries together to make a high-capacity version), but what happens to UPS conversions and vehicle battery conversions?
@DracoGriffin DracoGriffin added <Suggestion / Discussion> Talk it out before implementing [JSON] Changes (can be) made in JSON Items: Battery / UPS Electric power management Items / Item Actions / Item Qualities Items and how they work and interact labels Apr 13, 2019
@CoroNaut
Copy link

It would be neat if we could also have battery mods to convert any of the 3 types to run off of batteries from any other type.

@ghost
Copy link

ghost commented Apr 14, 2019

Car batteries already function very sensibly and are used in real life to power stuff other than cars, so I would probably leave them as they are. However, I agree with the rest. Right now batteries seem to function as individual "energy units" that aren't actually contained by anything-- and while realism shouldn't affect gameplay, it is honestly pretty weird how they work right now. Changing batteries into magazines that contain individual energy units makes a lot more sense, and I don't think would create significant micromanaging by making it more sensible.

@nexusmrsep
Copy link
Contributor

I'd go for standard bartery sizes instead of abstract names. https://en.m.wikipedia.org/wiki/List_of_battery_sizes

@Chryseus
Copy link

My own opinion is the the battery system should differentiate between the different classes of batteries in use:

  • Fixed, battery cannot be removed without disassembly, in most cases such a battery would be rechargeable with exception of simple disposable items, common example would be many tablets, e-readers, rechargeable lights, etc.
  • Primary, batteries that cannot be recharged (at least not easily) and need to be disposed of when flat.
  • Secondary, batteries that can be recharged or replaced, these often but not always need an external charger such as most power tools.

Since the game is set in the near future it would be reasonable to assume primary batteries are now rare, so all devices should be rechargeable without any kind of mod, either directly or by unloading the batteries in to a battery charger, even in the case of finding a rare device that uses primary batteries almost all of these will accept a secondary battery without problem.

As for the different types of removable batteries simplifying them in to three categories would make sense, using real battery types would be extremely unwieldy since there are at least a dozen in common usage, not including custom batteries common in laptops and power tools.

To make things a bit more realistic batteries could degrade over time and with recharge cycles, most batteries will self-discharge within a few years depending on the chemistry and can only be recharged a certain number of times before their maximum capacity starts to drop to unusable levels.

@Inglonias
Copy link
Contributor Author

A quick update before I respond to Chryseus: I've decided that since so much of this can be done with JSON, and trying to migrate existing saves over to a new system would be very complex, this can and should be done first as an optional JSON mod.

Now, getting to Chryseus. I don't feel that battery degradation is in scope for what I'm doing here. Since so much of what I want is JSON right now, no new C++ code will be applied for now.

As for batteries built into devices, I'm going to make an executive decision and say that since most battery-powered devices in this game have user-swappable batteries, humanity decided that's how it should be in the future. (Cell phones in game already have user-swappable batteries, while high-end smartphones require a UPS) To be frank, if batteries are standardized to the degree that they seem to be in this game, there's no reason not to have the ability for anyone to just swap them out.

@Inglonias
Copy link
Contributor Author

I'm using this as my compatibility chart for the mod. I am not an electrical engineer. I am a computer science major, so these numbers are balanced for what I feel would make good gameplay and a smooth transition for now.
image

@jeremyshannon
Copy link
Contributor

This all sounds pretty good. I might suggest for the existing save problem that you just leave the old batteries as-is overall, but remove them from spawn lists and such.
That way legacy games would have their weird battery-liquid items still around and usable (no vanishing stockpiles), but they would slowly be used up and eventually the player would have to switch over to the new batteries, and as the player moved into new areas or collected monster drops, he'd find the new batteries popping up to fill the gap.

@augustocereto
Copy link

This is a good oportunity to turn the UPS and atomic variants into battery variants instead of an item variant. That would also deprecate UPS mods

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Items: Battery / UPS Electric power management Items / Item Actions / Item Qualities Items and how they work and interact [JSON] Changes (can be) made in JSON <Suggestion / Discussion> Talk it out before implementing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants