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

feat: grid water wheels #4571

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

chaosvolt
Copy link
Member

@chaosvolt chaosvolt commented May 1, 2024

Purpose of change

This follows up on #4448 by starting work on a basic implementation of grid water wheels. As with plutonium generators and wind turbines, right now they use the hacky method of "steady consumer that uses negative power drain" and construction restrictions like turbines, but in the future I want to follow up on both these items by implementing some proper checks for terrain conditions to make them work more like solar panels.

Describe the solution

  1. Defined furniture for grid water wheels, both regular and large varieties. Deconstruct and bash yields overall fairly similar to wind turbines for the moment. More notable is their power production is properly consistent with the epower rates, close as I can get them. Consumer grid furniture deals in kJ while vehicle power and grid solar panels deal in watts, so they're set to generate 1 kJ in however many seconds would be a reasonable fit for their vehicle version's wattage (rounded up). Bigger version also is now a bit harder to smack down than normal ones, and both get ballistic data and coverage values.
  2. Added construction entries for water wheels and large water wheels. Based mostly off the shallow pit construction entries for wind turbines, though taking a bit longer like vehicle wheels do. Terrain requires the CURRENT flag.
  3. Added construction group entries for above.
  4. Updated power production of wind turbines to be consistent with their vehicle versions, likewise matching how grid water wheels and plutonium generators behave. Large version is now a bit harder to bash than the normal one. Large version also gets coverage of 30 and ballistic data (with intercept chance comparable to small water wheels, on the assumption that a wind turbine will be more elevated and thus offer less cover).
  5. Also fixed wind turbines being in construction category instead of workshop where all the grid stuff belongs.
  6. Misc: Updated the main menu tip since solars aren't the only grid furniture we can generate power with, and fixed a typo in it.

I could've sworn you were able to fill in water channels as if it was a pit, but evidently you can't so the exploit in the code I was gonna close is no longer a problem it seems.

Describe alternatives you've considered

Screaming at C++ and fixing the hackery now instead of later.

Testing

Checked affected files for syntax and lint errors. Testing to continue once I tackle the C++ stuff.

Additional context

Checklist

@github-actions github-actions bot added the data PRs related to datas. Won't crash game (probably) label May 1, 2024
@chaosvolt
Copy link
Member Author

Okay so I'm testing this now and I...can't just fill flowing shallow water in anyway?
image

I dunno what loophole I managed to miss here if it wasn't that, I could've sworn it let me fill in shallow water previously.

@chaosvolt chaosvolt marked this pull request as ready for review May 2, 2024 16:06
@chaosvolt
Copy link
Member Author

Bonus:
image

@Lamandus
Copy link
Contributor

Lamandus commented May 14, 2024

About the steady consumption of the wind turbine. I choose those high time numbers because the game would start to lag on weaker machines. Not sure if the discussion was on GitHub or discord, but I think either olanti or chulu pointed it out.

It was kheir

Co-authored-by: Viss Valdyr <33199510+Lamandus@users.noreply.github.com>
@chaosvolt
Copy link
Member Author

chaosvolt commented May 14, 2024

About the steady consumption of the wind turbine. I choose those high time numbers because the game would start to lag on weaker machines. Not sure if the discussion was on GitHub or discord, but I think either olanti or chulu pointed it out.

It was kheir

Ah, weird. I should note that those power numbers were still inaccurate relative to the output of vehicle wind turbines, but I could put them back to a slow-but-corrected value if desired I guess?

@Lamandus
Copy link
Contributor

About the steady consumption of the wind turbine. I choose those high time numbers because the game would start to lag on weaker machines. Not sure if the discussion was on GitHub or discord, but I think either olanti or chulu pointed it out.
It was kheir

Ah, weird. I should note that those power numbers were still inaccurate relative to the output of vehicle wind turbines, but I could put them back to a slow-but-corrected value if desired I guess?

that would be nice, yes. I think we should check all grid appliances if they follow that rule. They should.

chaosvolt and others added 2 commits May 14, 2024 05:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data PRs related to datas. Won't crash game (probably)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants