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

[changed] Lamp light is based on input power #2016

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

Conversation

mugg91
Copy link
Contributor

@mugg91 mugg91 commented Apr 15, 2024

Status

  • READY: this PR is (to the best of your knowledge) ready to be incorporated into the game.

Description

[changed] Lamp light is based on input power

This PR changes Lamp to make it emit light based on its input power.
Less power means it emits less light.
Lamp isn't a "load component" anymore, but it doesn't make sense for it to be in the "passive components" directory so I kept it in the "load components" directory.

A power factor (float(power_new + 1) / power_source) is calculated which is set to not exceed 1.
Light radius will be directly affected by this power factor whereas SColor luminance, Red, Blue and Green are affected by it as well but with the factor having at least a minimum of 0.3f to make light not drop too low.

screen-24-04-16-00-30-55

@NoahTheLegend
Copy link
Contributor

NoahTheLegend commented Apr 16, 2024

You're adding more mechanisms and thats cool, but we should add arithmetic gates with a complex custom logic.

In short you may need one parent device for storing a value once it is different from its contents (previously saved value). That is implementation for average memory cell, then using that as a layout add divide/multiply and sum/subtraction gates which interact with nearby memory cells instead of taking signal power as input, (so you do not have go out max signal range) processing value from side A into input on side B.
Making those more versatile to work with environment is preferable. Activating coin slot or sensor would add 1 / subtract 1 or multiply by 2 / divide by 2 etc corresponding to functionality of certain device

this is quite raw idea and i was thinking of doing it by myself, although i will appreciate your feedback and more thoughts relative to this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants