Paradise icon indicating copy to clipboard operation
Paradise copied to clipboard

Energy field generators Refactor/Tweak

Open Migratingcocofruit opened this issue 4 months ago • 0 comments

What Does This PR Do

Changes the way Energy field generators share energy:

  • Limits the range at which they can directly draw from another generator to 3 neighbors away
  • If a field generator has a neighbor with as less energy, they will equalize by transferring half of the difference. Also reduces the maximum energy capacity by half so that the overall energy stored in the field generators is about the same as live, so time to containment breach is about the same when turning off the emitters. Fixes a bug that causes field generators to improperly shut down Fixes a bug that causes energy field destructor to runtime when the field has no generators(should only happen when admin spawned)

Why It's Good For The Game

Field generators behave in an odd way. Most of them remain empty, and only draw power from connected generators, and the method used tends to loop around a lot, which generates a lot of useless calls.

Images of changes

Testing

  • Setup a field generator array
  • Observed energy being transferred between field generators
  • Overloaded the array and made sure it properly shut down

Declaration

  • [x] I confirm that I either do not require pre-approval for this PR, or I have obtained such approval and have included a screenshot to demonstrate this below.

Changelog

:cl: tweak: Field generators now share their energy and only pull directly from up to 3 neighbors away. Maximum energy capacity reduced by half to maintain the same overall level of energy storage. fix: Field generators now properly shutdown. fix: Fields no longer runtime when qdeleted if they have no generators(mostly affects admin spawned ones). /:cl:

Migratingcocofruit avatar Sep 27 '24 17:09 Migratingcocofruit