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

Use Sun irradiance for solar panels #59179

Merged
merged 22 commits into from
Aug 17, 2022
Merged

Conversation

Hirmuolio
Copy link
Contributor

@Hirmuolio Hirmuolio commented Jul 11, 2022

Summary

Features "Use Sun irradiance for solar panels"

Purpose of change

Solar panels are powered by light. The game uses light system designed for vision where 100 is light level where you have full vision.
In practice you have full vision is relatively low lighting. This causes solar panels to run at nearly full efficiency from early morning to late night.

Describe the solution

Use sun irradiance. This is the amount of radiation energy that hits Earth surfafce.

Sun irradiance is affected by weather multiplicatively instead of additively. So instead of cloudy weather giving -20 to light level it will give *0.15.

This reduces solar power quite a bit.
For example summer day 60 at 08:00. In the old system solar panels would work at 95% efficiency but in new system they would work at only 50% efficiency.
Winter solar panel usage is heavily nerfed in this. On winter day 60 at 12:00. In the old system solar panels would work at 104% efficiency but in new system they work at 60% efficiency.
Solar panels on cloudy weather are even more nerfed than that. On a cloudy summer day the old system would give 75% of power compared to clear weather while the new system will give only 15% of power compared to clear weather.

Some comparison numbers for energy produced per with 5 solar panel vehicle on a clear day (24 hour period).

Date Old New
Spring day 2 10454 kJ 5184 kJ
Summer day 1 14083 kJ 7863 kJ
Autumn day 1 10282 kJ 5098 kJ
Winter day 1 6567 kJ 2074 kJ

So in general about 1/2 power produced compared to before (except winter is 1/3).

The sun irradiance is pretty simple system. It assumes that the solar panel is level with ground and does not track Sun. Modeling angled panels and tracking systems would be possible but in my opinion not worth the effort. If you want to create "flat", "angled" and "tracking" solar panel variants just give the angled and tracking variants something like +20% and +40% power outputs. It is not exactly right but close enough.

The max sun irradiance is set to 1000. In reality it is a bit higher than that. But it is such a nice number, small error doesn't matter and all the calculations (at least for now) use relative values.

I also separated "debug lux meter" from normal lux meter. The normal lux meter now also consumes uses batteries.

Describe alternatives you've considered

The numbers on solar panel vehicle parts could be buffed a bit to compensate the loss of power generation.
If you think current solar panel power output is good for balance you can just double the solar panel part output.

Maybe debug items should go into a mod to keep them separated from normal stuff. IMO debug items are easier to use than debug menu for targeted things.

Testing

Rewrote the solar panel tests.
Numbers seem sensible in all weathers ingame.

Additional context

@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. [C++] Changes (can be) made in C++. Previously named `Code` [JSON] Changes (can be) made in JSON [Markdown] Markdown issues and PRs Bionics CBM (Compact Bionic Modules) Code: Tests Measurement, self-control, statistics, balancing. Mechanics: Weather Rain, snow, portal storms and non-temperature environment Vehicles Vehicles, parts, mechanics & interactions <Enhancement / Feature> New features, or enhancements on existing astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions labels Jul 11, 2022
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jul 12, 2022
@Fris0uman
Copy link
Contributor

Tracknig solar panel sounds like a very good candidate for a new appliance in a following PR.

@github-actions github-actions bot added Appliance/Power Grid Anything to do with appliances and power grid and removed json-styled JSON lint passed, label assigned by github actions labels Jul 14, 2022
@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jul 14, 2022
@github-actions github-actions bot added json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Jul 14, 2022
@github-actions github-actions bot removed the astyled astyled PR, label is assigned by github actions label Jul 15, 2022
@github-actions
Copy link
Contributor

Spell checker encountered unrecognized words in the in-game text added in this pull request. See below for details.

Click to expand
  • Incident light: %.1f\nNatural light: %.1f\nSunlight: %.1f\nSun irradiance: %.1f\nIncident irradiance %.1f

This alert is automatically generated. You can simply disregard if this is inaccurate, or (optionally) you can also add the new words to tools/spell_checker/dictionary.txt so they will not trigger an alert next time.

@github-actions github-actions bot added the Code: Tooling Tooling that is not part of the main game but is part of the repo. label Jul 15, 2022
@github-actions github-actions bot added the astyled astyled PR, label is assigned by github actions label Jul 15, 2022
@dseguin dseguin merged commit ad5086f into CleverRaven:master Aug 17, 2022
@Hirmuolio Hirmuolio deleted the sunpow branch August 22, 2022 07:58
Hirmuolio added a commit to Hirmuolio/Cataclysm-DDA that referenced this pull request Aug 27, 2022
* sun_irradiance

* weather

* debug tool

* lint

* wrong spots

* fix sun_multiplier

* solar panels

* adjusted weathers

* outside reality bubble

* astyle

* luxmeter

* unnecessary line

* cleanup

* solar panel appliances 20% buff

* test short vs long

* lint

* make clang happy

* dictionary irradiance

* astyle

* actually add the debug tools

Co-authored-by: Fris0uman <[email protected]>
@Alm999 Alm999 mentioned this pull request Aug 9, 2023
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 Bionics CBM (Compact Bionic Modules) [C++] Changes (can be) made in C++. Previously named `Code` Code: Tests Measurement, self-control, statistics, balancing. Code: Tooling Tooling that is not part of the main game but is part of the repo. <Documentation> Design documents, internal info, guides and help. <Enhancement / Feature> New features, or enhancements on existing [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions [Markdown] Markdown issues and PRs Mechanics: Weather Rain, snow, portal storms and non-temperature environment Vehicles Vehicles, parts, mechanics & interactions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants