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

Add small consumer battery rechargers #39772

Merged
merged 5 commits into from Apr 29, 2020

Conversation

AlexMooney
Copy link
Contributor

@AlexMooney AlexMooney commented Apr 21, 2020

Summary

SUMMARY: Content "Adds consumer wireless charging device and vehicle attachment"

Purpose of change

There seems like there aren't early game options to recharge batteries, outside of the nearly useless hand crank charger.

Describe the solution

This PR adds a device based on the Qi charging standard, which supplies 15 watts to batteries in the same tile as it's installed on. It's found in homes and offices, based on SUS groups and an approximate 20% adoption rate of the devices according to the linked Wikipedia article.

Describe alternatives you've considered

Attempted in #39391 to add the ability to wire up a hand crank charger as an alternative recharging option, but that proved difficult because it would have involved chatter between the map and the vehicle class to figure out when the crank can deliver power based on which engine its attached to, and so forth.

Testing

Spawned a humvee and verified that a battery in the proper recharging station is charging at 600 watts. Spawned a wireless charger and installed it, dropped a battery, got like 4 charge after 5 minutes of waiting a few times (300 s * 15 W = 4.5 kJ). Tested removing and adding wireless charger, especially that they can't both be on the same cargo.

Spawned an electric bicycle and installed wireless_charger on the cargo. Waited 30 minutes and saw 25 kJ consumed from the bike and 23 kJ added to the battery. Expected for that time was 27 kJ.

Crafted and disassembled a battery charger.

Additional context

The item looks terrible in tilesets right now, since a recharging station is a huge thing. I'd be happy to add looks_like if anyone can think of a good candidate.

@mlangsdorf, you reviewed the previous PR and I'd appreciate it you can take a look at this version too.

@kevingranade
Copy link
Member

Why make it wireless? That's orthogonal to the functionality you want, and takes it outside the use case you're describing.

@AlexMooney
Copy link
Contributor Author

Why make it wireless? That's orthogonal to the functionality you want, and takes it outside the use case you're describing.

The wireless part is the lack of wires between the device and the batteries being charged, not between the car and the device.

image

I could rename it though; it's just descriptive of the real life object I modeled it from.

@kevingranade
Copy link
Member

Please do, those chargers are mostly integrated into phones, not standalone batteries.

@AlexMooney
Copy link
Contributor Author

@kevingranade what would you like it to be called? Are you imagining a wall charger or a cigarette charger plug? Craft / disassemble with copper wire and an amplifier circuit?

@AlexMooney AlexMooney changed the title Add small consumer wireless rechargers Add small consumer battery rechargers Apr 24, 2020
@curstwist curstwist added [JSON] Changes (can be) made in JSON Crafting / Construction / Recipes Includes: Uncrafting / Disassembling Items: Battery / UPS Electric power management [C++] Changes (can be) made in C++. Previously named `Code` Items / Item Actions / Item Qualities Items and how they work and interact and removed Crafting / Construction / Recipes Includes: Uncrafting / Disassembling labels Apr 25, 2020
@enaantd
Copy link
Contributor

enaantd commented Apr 25, 2020

The item looks terrible in tilesets right now, since a recharging station is a huge thing. I'd be happy to add looks_like if anyone can think of a good candidate.

Maybe a copper wire?

@Tamiore
Copy link
Contributor

Tamiore commented Apr 27, 2020

Shouldn't this be craft-able (given that "bigger and better" recharging station is)?

Copy link
Member

@kevingranade kevingranade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thematically, don't see any problems in the code, but I haven't had a chance to do a quick test which is all this needs.

@AlexMooney
Copy link
Contributor Author

Reran the charging tests and it was able to charge a battery dropped into the attached cargo.

It'd be in every home with a rechargeable battery and every desk that
someone uses electronics at.
Copy link
Contributor

@ifreund ifreund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ifreund ifreund merged commit c808faa into CleverRaven:master Apr 29, 2020
@AlexMooney AlexMooney deleted the wireless_charger branch April 29, 2020 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants