Skip to content

Commit

Permalink
Make ground mounted solar panels more efficient
Browse files Browse the repository at this point in the history
Because vehicles are smaller than ground tiles are, ground solar panels
are very inefficient per their area. Fix this by making special ground
solar panels that have an appropriate area.

Vehicle tile width comes from tile_to_width in src/vehicle.cpp, is ~0.5m
for most vehicles.
  • Loading branch information
ehughsbaird committed Oct 11, 2023
1 parent 11a2c1e commit 51b0d64
Show file tree
Hide file tree
Showing 6 changed files with 144 additions and 12 deletions.
26 changes: 26 additions & 0 deletions data/json/construction.json
Original file line number Diff line number Diff line change
Expand Up @@ -5329,6 +5329,19 @@
"post_special": "done_appliance",
"activity_level": "LIGHT_EXERCISE"
},
{
"type": "construction",
"id": "app_ground_solar",
"group": "place_ground_solar_panel",
"category": "APPLIANCE",
"required_skills": [ [ "fabrication", 1 ] ],
"time": "6 m",
"qualities": [ [ { "id": "WRENCH", "level": 1 } ] ],
"components": [ [ [ "ground_solar_panel", 1 ] ] ],
"pre_special": "check_empty",
"post_special": "done_appliance",
"activity_level": "LIGHT_EXERCISE"
},
{
"type": "construction",
"id": "app_reinforced_solar",
Expand All @@ -5355,6 +5368,19 @@
"post_special": "done_appliance",
"activity_level": "LIGHT_EXERCISE"
},
{
"type": "construction",
"id": "app_ground_solar_v2",
"group": "place_ground_solar_panel_v2",
"category": "APPLIANCE",
"required_skills": [ [ "fabrication", 1 ] ],
"time": "6 m",
"qualities": [ [ { "id": "WRENCH", "level": 1 } ] ],
"components": [ [ [ "ground_solar_panel_v2", 1 ] ] ],
"pre_special": "check_empty",
"post_special": "done_appliance",
"activity_level": "LIGHT_EXERCISE"
},
{
"type": "construction",
"id": "app_reinfoced_solar_v2",
Expand Down
10 changes: 10 additions & 0 deletions data/json/construction_group.json
Original file line number Diff line number Diff line change
Expand Up @@ -1327,6 +1327,11 @@
{
"type": "construction_group",
"id": "place_solar_panel",
"name": "Place Small Solar Panel"
},
{
"type": "construction_group",
"id": "place_ground_solar_panel",
"name": "Place Solar Panel"
},
{
Expand All @@ -1337,6 +1342,11 @@
{
"type": "construction_group",
"id": "place_solar_panel_v2",
"name": "Place Small Advanced Solar Panel"
},
{
"type": "construction_group",
"id": "place_ground_solar_panel_v2",
"name": "Place Advanced Solar Panel"
},
{
Expand Down
54 changes: 52 additions & 2 deletions data/json/furniture_and_terrain/appliances.json
Original file line number Diff line number Diff line change
Expand Up @@ -674,13 +674,39 @@
{
"type": "vehicle_part",
"id": "ap_solar_panel",
"name": { "str": "small solar panel" },
"flags": [ "SOLAR_PANEL", "OBSTACLE", "APPLIANCE" ],
"description": "A solar panel, mounted on a frame and ready to power other appliances.",
"description": "A small solar panel, mounted on a frame and ready to power other appliances.",
"copy-from": "solar_panel",
"proportional": { "epower": 1.2 },
"requirements": { "removal": { "time": "3 m", "using": [ [ "vehicle_wrench_2", 1 ] ] } },
"variants": [ { "symbols": "#", "symbols_broken": "x" } ]
},
{
"type": "vehicle_part",
"id": "ap_ground_solar_panel",
"flags": [ "SOLAR_PANEL", "OBSTACLE", "APPLIANCE" ],
"description": "A solar panel, mounted on a frame and ready to power other appliances.",
"item": "ground_solar_panel",
"copy-from": "solar_panel",
"//": "4 times the panels, 1.2x matching the above appliance",
"proportional": { "epower": 4.8 },
"requirements": {
"removal": { "time": "3 m", "using": [ [ "vehicle_wrench_2", 1 ] ] },
"repair": {
"skills": [ [ "electronics", 6 ] ],
"time": "120 m",
"using": [ [ "vehicle_screw", 1 ], [ "solar_panel", 4 ], [ "soldering_standard", 8 ] ]
}
},
"breaks_into": [
{ "item": "steel_lump", "count": [ 8, 32 ] },
{ "item": "steel_chunk", "count": [ 8, 32 ] },
{ "item": "scrap", "count": [ 8, 32 ] },
{ "item": "solar_cell", "count": [ 4, 16 ] }
],
"variants": [ { "symbols": "#", "symbols_broken": "x" } ]
},
{
"type": "vehicle_part",
"id": "ap_reinforced_solar_panel",
Expand All @@ -695,13 +721,37 @@
{
"type": "vehicle_part",
"id": "ap_solar_panel_v2",
"name": { "str": "small advanced solar panel" },
"flags": [ "SOLAR_PANEL", "OBSTACLE", "APPLIANCE" ],
"description": "A high-performance solar panel, mounted on a frame and ready to power other appliances.",
"description": "A small, high-performance solar panel, mounted on a frame and ready to power other appliances.",
"copy-from": "solar_panel_v2",
"proportional": { "epower": 1.2 },
"requirements": { "removal": { "time": "3 m", "using": [ [ "vehicle_wrench_2", 1 ] ] } },
"variants": [ { "symbols": "#", "symbols_broken": "x" } ]
},
{
"type": "vehicle_part",
"id": "ap_ground_solar_panel_v2",
"copy-from": "solar_panel_v2",
"flags": [ "SOLAR_PANEL", "OBSTACLE", "APPLIANCE" ],
"item": "ground_solar_panel_v2",
"//": "4 times from 4 more panels, 1.2 times as is done above",
"proportional": { "epower": 4.8 },
"requirements": {
"removal": { "time": "3 m", "using": [ [ "vehicle_wrench_2", 1 ] ] },
"repair": {
"skills": [ [ "electronics", 8 ] ],
"time": "150 m",
"using": [ [ "vehicle_screw", 1 ], [ "solar_panel_v2", 4 ], [ "soldering_standard", 64 ] ]
}
},
"breaks_into": [
{ "item": "steel_lump", "count": [ 8, 16 ] },
{ "item": "steel_chunk", "count": [ 8, 16 ] },
{ "item": "scrap", "count": [ 8, 16 ] },
{ "item": "solar_cell_v2", "count": [ 4, 24 ] }
]
},
{
"type": "vehicle_part",
"id": "ap_reinforced_solar_panel_v2",
Expand Down
20 changes: 10 additions & 10 deletions data/json/furniture_and_terrain/furniture-appliances.json
Original file line number Diff line number Diff line change
Expand Up @@ -694,23 +694,23 @@
"color": "yellow",
"move_cost_mod": 2,
"required_str": -1,
"examine_action": { "type": "appliance_convert", "furn_set": "f_null", "item": "solar_panel" },
"examine_action": { "type": "appliance_convert", "furn_set": "f_null", "item": "ground_solar_panel" },
"flags": [ "TRANSPARENT" ],
"deconstruct": { "items": [ { "item": "solar_panel", "count": 1 } ] },
"deconstruct": { "items": [ { "item": "ground_solar_panel", "count": 1 } ] },
"bash": {
"str_min": 10,
"str_max": 20,
"sound": "whack!",
"sound_fail": "clang!",
"items": [
{ "item": "solar_cell", "count": [ 1, 5 ] },
{ "item": "scrap", "count": [ 3, 6 ] },
{ "item": "amplifier", "prob": 50 },
{ "item": "cable", "charges": [ 10, 15 ] },
{ "item": "power_supply", "prob": 50 },
{ "item": "scrap", "count": [ 4, 6 ] },
{ "item": "plastic_chunk", "count": [ 1, 2 ] },
{ "item": "steel_chunk", "count": 3 }
{ "item": "solar_cell", "count": [ 4, 20 ] },
{ "item": "scrap", "count": [ 12, 24 ] },
{ "item": "amplifier", "count": [ 0, 2 ] },
{ "item": "cable", "charges": [ 40, 60 ] },
{ "item": "power_supply", "count": [ 0, 2 ] },
{ "item": "scrap", "count": [ 16, 24 ] },
{ "item": "plastic_chunk", "count": [ 4, 8 ] },
{ "item": "steel_chunk", "count": 12 }
]
}
},
Expand Down
20 changes: 20 additions & 0 deletions data/json/items/vehicle/solar.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[
{
"//": "Assumed to be ~0.5x0.5m to fit in a vehicle tile",
"type": "GENERIC",
"id": "solar_panel",
"name": { "str": "solar panel" },
Expand All @@ -16,6 +17,15 @@
"price_postapoc": 1000,
"melee_damage": { "bash": 1 }
},
{
"//": "Four solar panels stuck together to fit in 1x1m",
"type": "GENERIC",
"id": "ground_solar_panel",
"name": { "str": "solar panel array" },
"description": "A collection of four solar panels, ready to get to work converting solar radiation into electric power. Install them to use them in a static power grid.",
"copy-from": "solar_panel",
"proportional": { "weight": 4, "volume": 4, "price": 4, "price_postapoc": 4 }
},
{
"type": "GENERIC",
"copy-from": "solar_panel",
Expand Down Expand Up @@ -49,6 +59,7 @@
"copy-from": "solar_panel"
},
{
"//": "Assumed to be ~0.5mx0.5m to fit in a vehicle tile",
"type": "GENERIC",
"id": "solar_panel_v2",
"name": { "str": "advanced solar panel" },
Expand All @@ -57,6 +68,15 @@
"price_postapoc": 3000,
"copy-from": "solar_panel"
},
{
"//": "Four advanced solar panels stuck together for 1mx1m area",
"type": "GENERIC",
"id": "ground_solar_panel_v2",
"name": { "str": "advanced solar panel array" },
"description": "A collection of four smaller solar panels, read to convert solar radiation into electric power. These panels are high-performance, made with monocrystalline silicon cells.",
"copy-from": "solar_panel_v2",
"proportional": { "price": 4, "price_postapoc": 4, "weight": 4, "volume": 4 }
},
{
"type": "GENERIC",
"id": "reinforced_solar_panel_v2",
Expand Down
26 changes: 26 additions & 0 deletions data/json/recipes/other/power_supplies.json
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,32 @@
],
"components": [ [ [ "power_supply", 2 ] ], [ [ "amplifier", 2 ] ], [ [ "solar_cell", 12 ] ], [ [ "cable", 20 ] ] ]
},
{
"type": "recipe",
"activity_level": "LIGHT_EXERCISE",
"result": "ground_solar_panel",
"category": "CC_ELECTRONIC",
"subcategory": "CSC_ELECTRONIC_PARTS",
"skill_used": "electronics",
"difficulty": 2,
"time": "50 m",
"reversible": true,
"autolearn": true,
"components": [ [ [ "solar_panel", 4 ] ], [ [ "cable", 20 ] ] ]
},
{
"type": "recipe",
"activity_level": "LIGHT_EXERCISE",
"result": "ground_solar_panel_v2",
"category": "CC_ELECTRONIC",
"subcategory": "CSC_ELECTRONIC_PARTS",
"skill_used": "electronics",
"difficulty": 2,
"time": "50 m",
"reversible": true,
"autolearn": true,
"components": [ [ [ "solar_panel_v2", 4 ] ], [ [ "cable", 20 ] ] ]
},
{
"type": "recipe",
"activity_level": "LIGHT_EXERCISE",
Expand Down

0 comments on commit 51b0d64

Please sign in to comment.