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

Revamp foldable solar panels #68705

Merged
merged 5 commits into from
Oct 20, 2023
Merged

Conversation

ehughsbaird
Copy link
Contributor

Summary

Content "Revamp foldable solar panels"

Purpose of change

Fixes #68642
These didn't spawn anywhere, but could be crafted. When crafted, they functioned as worse solar panels, despite being made from solar panels.

Revamp them to be based on real items
The folding solar panel is now a camping solar panel.
Small folding solar panel, unfolded on a white background

The advanced folding solar panel is now a solar suitcase.
Solar suitcase, deployed with a stand to have a favorable angle, on a white background

Describe the solution

In the first commit, add an iuse actor that enables activating an item to place it as an appliance.

In the second commit, allow vehicle parts to be removed into different items than they use for the items. Having a pseudo item for the solar panel appliances.

In the other two commits, revamp the stats based on the items linked above, and add an appliance version. The appliance uses a new fake item that has a capacity of one battery charge, to enable charging items off of it.

Add to some relevant item groups, and remove the crafting recipes.

Both deploys to an area larger than a vehicle tile, so they probably shouldn't be allowed on vehicles, but I didn't want to break existing vehicles.

Testing

Spawn in folding solar panels and solar suitcases. Install them on a vehicle, then smash them. See a XX solar panel of the appropriate type comes off. Activate each type, and place them as appliances. Items hooked up to them charge.

Folding solar panel in bugout bag:
image
image

Additional context

Crafting recipes might not need to be removed, especially for the suitcase, I'm just not sure what to put for them. Hopefully the slightly hacky single-battery-charge thing is acceptable.

@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. [JSON] Changes (can be) made in JSON Vehicles Vehicles, parts, mechanics & interactions Spawn Creatures, items, vehicles, locations appearing on map [C++] Changes (can be) made in C++. Previously named `Code` [Markdown] Markdown issues and PRs Appliance/Power Grid Anything to do with appliances and power grid astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions labels Oct 17, 2023
@kevingranade
Copy link
Member

Both deploys to an area larger than a vehicle tile, so they probably shouldn't be allowed on vehicles, but I didn't want to break existing vehicles.

Sounds like it needs to be a new item then.

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Oct 17, 2023
Enabled activating an item to place an appliance.
Allow vehicle parts to have a different base item than the item they are
removed to. This allows having fake items for appliances that are not
the same item they remove to.
Folding solar panels seem to be normal solar panels, modified in some
way to fold (add hinges?). Outside of spacecraft, I'm not sure such
things exist in real life, and this camping solar panel is probably a
lot more familiar to most people.

Remove the recipe for the folding solar panel, and add some spawns in
the camping ground (and add it to some large bugout bags).

Make it deployable as an appliance, so it can be used on the go to
charge devices. It's done in a bit of a hacky way due to the requirement
for a battery, but I think it's fine.

It probably shouldn't really be installable on vehicles, as it's got too
large of a surface area (and so is better than a normal vehicle solar
panel), but I didn't want to cause problems with existing vehicles.

Since it doesn't have components any more, I've made it break into an XX
damaged folding solar panel.
Instead of not-spawning, have turn the solar_panel_v2 into a solar
suitcase. Add some spawns to vehicles, and allow it to be deployed as an
appliance for charging items.

Still a bit hacky, like the smaller folding solar panel.
Recipe was also removed, though it is potentially reasonable to craft a
solar suitcase. I just don't know enough about it to say the recipe is
still accurate.
These are voluminous enough that it doesn't make sense to have a whole
lot on a folding vehicle, and they don't deliver that much juice either.
It just makes more sense to carry around the folding panels and deploy
them.
Also, these are too big (surface area) to fit on a vehicle tile.
@ehughsbaird
Copy link
Contributor Author

I have removed the vehicle-mounted folding panels. I can't figure out what a real analogue would be, and the appliance versions of these provide all the functionality I could think you might want with a vehicle using folding solar panels.

@Alm999
Copy link
Contributor

Alm999 commented Oct 18, 2023

If new folding solar panels are just appliances, then what are their benefits compared to regular solar panels placed as appliances? Is it ease of installation (reduced time)?

As far as I can understand, old "folding solar panels" are a means to have a foldable vehicle (an e-bike?) with a panel. Personally I intended to construct a portable solar farm using foldable solar panels (because using regular ones makes vehicle un-foldable), but the old ones were just not worth it compared to just placing ordinary solar panels one-by-one as appliances (beside huge game slowdown due to calculation of large amount of appliances nearby).

I see no benefits in seeking the proposed new un-craftable gadgets (and I hate relying on sheer luck with item spawn) when one can just place a panel from any random rooftop or electric car as appliance.

I would propose making portable foldable solar packs to be just like "battery chargers": small, lightweight, low-power, not requiring any mounting process whatsoever, but acting as chargers for all batteries in a tile if just being dropped on the floor/grass/dirt (provided sun radiation is present).

Oh, and maybe make ordinary solar panels compatible with foldable frames (provided there is no fundamental issues with this).

@ehughsbaird
Copy link
Contributor Author

If new folding solar panels are just appliances, then what are their benefits compared to regular solar panels placed as appliances? Is it ease of installation (reduced time)?

Easier to deploy and remove (no tools, less time).
The camping solar panel is heavier, but less volume than an appliance (small) solar panel for twice as much power output.
The solar suitcase is less beneficial (200W for 17.5kg/40L instead of 240W for 10.5kg/50L for an appliance solar panel), but is still less voluminous, which tends to be the constraint for vehicles.
They also allow charging items directly from them, with no additional need for a battery, further saving volume/weight.

As far as I can understand, old "folding solar panels" are a means to have a foldable vehicle (an e-bike?) with a panel.

What I have changed these into are real things, I can't find a real thing that looks like this that would be foldable.

Personally I intended to construct a portable solar farm using foldable solar panels (because using regular ones makes vehicle un-foldable), but the old ones were just not worth it compared to just placing ordinary solar panels one-by-one as appliances (beside huge game slowdown due to calculation of large amount of appliances nearby).

I think a portable solar farm with solar suitcases fits this.

I see no benefits in seeking the proposed new un-craftable gadgets (and I hate relying on sheer luck with item spawn) when one can just place a panel from any random rooftop or electric car as appliance.

Yeah, they're niche, but they're based on things that exist. Perhaps there's some downsides that we aren't modeling (with regards to power conversion or the like) of a fixed solar panel.
I think it would probably be feasible to have craftable folding solar panels (with 2 solar_panel_v2?), but I think that can be done in a later PR, if this work gets merged.

I would propose making portable foldable solar packs to be just like "battery chargers": small, lightweight, low-power, not requiring any mounting process whatsoever, but acting as chargers for all batteries in a tile if just being dropped on the floor/grass/dirt (provided sun radiation is present).

I think this would be feasible to craft with a battery charger and a foldable solar panel, but I also think fits best in a later PR. As is, anything with a cable can be connected to charge.

Oh, and maybe make ordinary solar panels compatible with foldable frames (provided there is no fundamental issues with this).

I don't know enough about the criteria for making items foldable. Not to be a broken record, but I also think this belongs in a separate PR.

@Maleclypse Maleclypse merged commit 10cdb0c into CleverRaven:master Oct 20, 2023
26 checks passed
@ehughsbaird ehughsbaird deleted the fold-me-madly branch October 20, 2023 10:49
detahramet pushed a commit to detahramet/Cataclysm-DDA that referenced this pull request Nov 6, 2023
* Add deploy_appliance iuse actor

Enabled activating an item to place an appliance.

* vpart: allow removal into different item

Allow vehicle parts to have a different base item than the item they are
removed to. This allows having fake items for appliances that are not
the same item they remove to.

* Make folding solar panel a camping solar panel

Folding solar panels seem to be normal solar panels, modified in some
way to fold (add hinges?). Outside of spacecraft, I'm not sure such
things exist in real life, and this camping solar panel is probably a
lot more familiar to most people.

Remove the recipe for the folding solar panel, and add some spawns in
the camping ground (and add it to some large bugout bags).

Make it deployable as an appliance, so it can be used on the go to
charge devices. It's done in a bit of a hacky way due to the requirement
for a battery, but I think it's fine.

It probably shouldn't really be installable on vehicles, as it's got too
large of a surface area (and so is better than a normal vehicle solar
panel), but I didn't want to cause problems with existing vehicles.

Since it doesn't have components any more, I've made it break into an XX
damaged folding solar panel.

* Make folding_solar_panel_v2 a solar suitcase

Instead of not-spawning, have turn the solar_panel_v2 into a solar
suitcase. Add some spawns to vehicles, and allow it to be deployed as an
appliance for charging items.

Still a bit hacky, like the smaller folding solar panel.
Recipe was also removed, though it is potentially reasonable to craft a
solar suitcase. I just don't know enough about it to say the recipe is
still accurate.

* Remove vehicle folding solar panels

These are voluminous enough that it doesn't make sense to have a whole
lot on a folding vehicle, and they don't deliver that much juice either.
It just makes more sense to carry around the folding panels and deploy
them.
Also, these are too big (surface area) to fit on a vehicle tile.
Maleclypse pushed a commit to Maleclypse/Cataclysm-DDA that referenced this pull request Nov 16, 2023
* Add deploy_appliance iuse actor

Enabled activating an item to place an appliance.

* vpart: allow removal into different item

Allow vehicle parts to have a different base item than the item they are
removed to. This allows having fake items for appliances that are not
the same item they remove to.

* Make folding solar panel a camping solar panel

Folding solar panels seem to be normal solar panels, modified in some
way to fold (add hinges?). Outside of spacecraft, I'm not sure such
things exist in real life, and this camping solar panel is probably a
lot more familiar to most people.

Remove the recipe for the folding solar panel, and add some spawns in
the camping ground (and add it to some large bugout bags).

Make it deployable as an appliance, so it can be used on the go to
charge devices. It's done in a bit of a hacky way due to the requirement
for a battery, but I think it's fine.

It probably shouldn't really be installable on vehicles, as it's got too
large of a surface area (and so is better than a normal vehicle solar
panel), but I didn't want to cause problems with existing vehicles.

Since it doesn't have components any more, I've made it break into an XX
damaged folding solar panel.

* Make folding_solar_panel_v2 a solar suitcase

Instead of not-spawning, have turn the solar_panel_v2 into a solar
suitcase. Add some spawns to vehicles, and allow it to be deployed as an
appliance for charging items.

Still a bit hacky, like the smaller folding solar panel.
Recipe was also removed, though it is potentially reasonable to craft a
solar suitcase. I just don't know enough about it to say the recipe is
still accurate.

* Remove vehicle folding solar panels

These are voluminous enough that it doesn't make sense to have a whole
lot on a folding vehicle, and they don't deliver that much juice either.
It just makes more sense to carry around the folding panels and deploy
them.
Also, these are too big (surface area) to fit on a vehicle tile.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Appliance/Power Grid Anything to do with appliances and power grid astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` <Documentation> Design documents, internal info, guides and help. [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions [Markdown] Markdown issues and PRs Spawn Creatures, items, vehicles, locations appearing on map Vehicles Vehicles, parts, mechanics & interactions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unjustified Power Loss in Foldable Solar Panels
4 participants