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

Swaps HV/MV/LV scaling to supply power scaling #20880

Merged
merged 4 commits into from
Oct 18, 2023

Conversation

TemporalOroboros
Copy link
Contributor

@TemporalOroboros TemporalOroboros commented Oct 10, 2023

About the PR

Changes the damage and stun time calculations for getting electrocuted through a powernet to be independent of the type of cable (LV|MV|HV).
The old base damage was either 20 for LV, 40 for MV, and 60 for HV if you had partially effective insuls or powernet satisfaction * 75 averaged over 1 second.
The new base damage is an initial burst of powernet supply wattage / 50000 plus powernet satisfaction * 20 averaged over the following second if you aren't wearing somewhat effective insuls.

Why / Balance

I'm making a PR to ECS node groups and the hardcoded voltage system was unwieldy. This is a simpler system with less reliance on hardcoded enums. Damage will still scale with powernet type simply through larger powernets having more power running through them.

Technical details

Electrocution damage now comes in two waves.

  1. An initial burst proportional to the amount of power being supplied to the powernet.
    2.A trailing burst a second later proportional to the average powernet satisfaction over the preceding second. The trailing burst is only applied if the victim is wearing insuls of under half effectiveness.

Media

  • I have added screenshots/videos to this PR showcasing its changes ingame, or this PR does not require an ingame showcase

Breaking changes

Changelog

🆑

  • tweak: Electric shocks now scale with the amount of power in the cables instead of the type of cable.
  • balance: Electric shocks should be weaker at common (kW) power levels, but now scale indefinitely with network power.

@github-actions github-actions bot added the Status: Needs Review This PR requires new reviews before it can be merged. label Oct 10, 2023
@Anzarot121
Copy link
Contributor

There is a problem that SMES that are closed to themselves can accelerate production/consumption in the network to several MW. Approximately how much damage would be caused to a person if he flew into a grill with such voltage?

@TemporalOroboros
Copy link
Contributor Author

TemporalOroboros commented Oct 10, 2023

There is a problem that SMES that are closed to themselves can accelerate production/consumption in the network to several MW. Approximately how much damage would be caused to a person if he flew into a grill with such voltage?

I redid my math and apparently it maxes out at 800 burn. Not sure when went wrong, I was trying to match the existing damage.
I'll fix it when I figure out where the problem is.

Math for old system is min(x, 50000) * 1.5E-3 if you don't have gloves and a hardcoded 20 (lv), 40 (mv), 60 (hv) if you have partially effective gloves.
I'm trying to unhardcode the second bit. The existence of the two separate systems is annoying.

Apparently that E-4 should be an E-5. I'll fix it in the morning.

As an aside, since the new system is just supply * constant * base damage technically having bad gloves can be worse than having no gloves since the case for ~75% effective gloves is uncapped.

@TemporalOroboros
Copy link
Contributor Author

TemporalOroboros commented Oct 10, 2023

There is a problem that SMES that are closed to themselves can accelerate production/consumption in the network to several MW. Approximately how much damage would be caused to a person if he flew into a grill with such voltage?

Redid the everything, new max damages are in the table.
The approximate formula for the damage is supply power / 50000 + 20 * averaged supply power / load.

Power: Min1 Damage: Max2 Damage:
0 0 0
50kW 1 21
1MW 20 40
4MW 80 100
9MW 180 200
10MW 200 220

Checking the code for power supplies it looks like achieving the critical threshold of 4 MW will require one of the following.

  • An AME injecting 200 units per core.
  • 40 default radiation collectors.
  • 5334 default solar panels.
  • 133 Pacman pr 80 Superpacman generators
  • 27 default SMES or Substations.
  • 400 APCs
    operating at maximum output.

Footnotes

  1. Assuming they aren't wearing insuls.

  2. Assuming a stable powernet. (<= 100% power satisfaction)

@mirrorcult
Copy link
Contributor

needs changelog to reflect that electrocutions will generally do less damage

@Jezithyr Jezithyr merged commit 414701d into space-wizards:master Oct 18, 2023
10 checks passed
@liltenhead liltenhead mentioned this pull request Oct 29, 2023
31 tasks
BasedUser pushed a commit to cube-station-14/cube-station-14 that referenced this pull request Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Review This PR requires new reviews before it can be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants