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

[added] new source component: Solar Panel #2014

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mugg91
Copy link
Contributor

@mugg91 mugg91 commented Apr 15, 2024

Status

  • IN DEVELOPMENT
  • Needs to be added to png loader and loader colors.
  • Doesn't work on server when tested in "all mugg PRs merged", I will look for a fix

Description

[added] Solar Panel

This PR adds Solar Panel as a new Source component.

It will provide power based on luminance of SColor fetched via getMap().getColorLight(this.getPosition()).

Light must be above a set threshold otherwise power is 0 and tick frequency is 45. The threshold is set to 140.
If light is above the threshold, then power is (light - LIGHT_THRESHOLD) / (250.0f - LIGHT_THRESHOLD) * power_source and tick frequency is 3.
Therefore, Solar Panel provides power based on the light amount. If there is less light then it will provide less power.

Blob emitted light will work, so a Solar Panel can be powered by a Lamp.
However, there is an issue where blob emitted light will go through walls.
This is partly the reason why I introduced a threshold (see above).

I might change Lamp to give less light if it has less input power.

Screenshots

screen-24-04-15-10-56-39
screen-24-04-15-10-56-57
screen-24-04-15-11-00-08
screen-24-04-15-10-59-35

Copy link
Member

@Vam-Jam Vam-Jam left a comment

Choose a reason for hiding this comment

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

Does not function correctly on a dedicated server, seems to just output at max power all the time regardless of the brightness

@Vam-Jam Vam-Jam added feature pitch A pitch for a new feature or mechanic no functional change PRs with no gameplay change or visible bug solved; generally tagged for refactor PRs labels Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature pitch A pitch for a new feature or mechanic no functional change PRs with no gameplay change or visible bug solved; generally tagged for refactor PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants