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

🔩 Add (plastanium) diode #964

Merged
merged 24 commits into from
Nov 12, 2019
Merged

🔩 Add (plastanium) diode #964

merged 24 commits into from
Nov 12, 2019

Conversation

Quezler
Copy link
Contributor

@Quezler Quezler commented Oct 31, 2019

A possible implementation for this suggestion by @constatinus (and many others)

functionality
This pull adds an insulated diode block, that (currently) forwards power (50% of the difference) from one battery to another if the power within from is greater than the to battery, a large battery can fully fill both small and large batteries, but small batteries will only fill large batteries to 4k.

example 1
Below is an example of an impact reactor that will not shut down if the "outside network"'s power turns negative, since the battery inside the walls will only store/transmit "excess" energy, thus it will always have just enough power to stay running, but it will export all that it won't need.

Screen Shot 2019-10-31 at 12 34 50

example 2
Below is an example of high energy usage machines/parts of your base that you would only want to run if there is enough spare power for it.
Screen Shot 2019-10-31 at 13 16 54

thoughts

  • i went with the plastanium border color to signify its insulated property, which fits nice with the existing power insulation walls, to signify & prevent accidental connections through a possibly one wide gap.
  • base texture was a solar panel, which is overlayn by what most would consider a diode icon.
  • recipe is a mix between solar panels and plastanium walls, since its both electric but also insulates.
  • not sure if i used entity.sleep() correctly here, it would make some sense to not constantly check for batteries until a proximity update has been found.
  • my intention is to add a functionality to "inject" into the other power graph somehow, thoughts on that are pending.
  • it extends Block since that was the first place i found that had rotation support, though it should probably be moved to a power block type.
  • went with interacting between batteries since i wasn't sure if/how a block could support being part of two graphs, and battery blocks happen to store power, so this simple thing just facilitates moving power from one battery to another, not caring which graph any is connected to.

🥔

@AeronGreva
Copy link

This is a really good idea, and would definitely solve the downward spiral caused by relying on impact reactors.

Diode keeps one-way equalizing while the sending graph has batteries that are ¬ yet fully filled.
@Quezler
Copy link
Contributor Author

Quezler commented Oct 31, 2019

current caveats (yea working on it)

  • receiving graph needs a battery to receive in
  • if the amount sent is greater than the batteries on the receiving graph, its free

@Dexapnow
Copy link
Contributor

I thought surge is the one with electric based theme.

@Anuken
Copy link
Owner

Anuken commented Oct 31, 2019

A proposed sprite change:

image

Yes, this doesn't blend in with the walls as much, but the original plastanium base really sticks out like a sore thumb in the build menu and in contexts where no plastanium is around. I think it should have the same gray background as all the other power blocks.

Also, the original diode sprite was too detailed for the style, so I replaced it with a simple arrow design.

diode
diode-arrow

(added the diode sprite to the base block to simply things)

@Quezler
Copy link
Contributor Author

Quezler commented Nov 3, 2019

psa resuming progress on this likely sometime tomorrow 🌑

@Quezler Quezler requested a review from Anuken November 4, 2019 13:56
@Quezler Quezler requested a review from Anuken November 4, 2019 21:39
@Quezler Quezler requested a review from Anuken November 4, 2019 22:27
@Quezler
Copy link
Contributor Author

Quezler commented Nov 4, 2019

Hmm, i may or may not have messed up the (unused) left and right methods 🤔

@Quezler Quezler marked this pull request as ready for review November 5, 2019 19:11
# Conflicts:
#	core/assets/sprites/block_colors.png
#	core/assets/sprites/sprites.atlas
#	core/assets/sprites/sprites.png
#	core/assets/sprites/sprites3.png
#	core/assets/sprites/sprites5.png
@Shawak
Copy link
Contributor

Shawak commented Nov 9, 2019

How about chaning the sprite to an "active" version, so it's visible when power get's transfered into another network?

@Anuken
Copy link
Owner

Anuken commented Nov 9, 2019

It wouldn't be difficult to tint the diode sprite depending on flow rate - but I think that's outside the scope of this PR.

@Quezler Quezler requested a review from Anuken November 10, 2019 08:32
Copy link
Owner

@Anuken Anuken left a comment

Choose a reason for hiding this comment

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

Why is it upside down now?
image

core/assets/bundles/bundle.properties Outdated Show resolved Hide resolved
@Quezler
Copy link
Contributor Author

Quezler commented Nov 10, 2019

Probably because i edit textures upwards and all the assets are rotated clockwise 😅

@Quezler Quezler requested a review from Anuken November 10, 2019 15:33
@willis936
Copy link

Tech tree wise: would this be available prior to thorium? I’ve failed the salt flats scenario a few times now, mostly because of power failure. The power failure comes from over demand starving the water pumps and coal drills that feed the combustion generators. The plastanium diode looks like a solution to this. I definitely think there should be a tutorial scenario (or some well written text) describing how to use it in game. Not everyone will see this PR.

@Anuken Anuken merged commit f5c1eb7 into Anuken:master Nov 12, 2019
@KenSharp
Copy link

The naming is insanely confusing as this is not how a real diode actually works. I had to come here just to work out why it behaves the way it does.

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.

8 participants