Zero-K icon indicating copy to clipboard operation
Zero-K copied to clipboard

Apsis draw incorrect amount of energy when regening

Open Sortale opened this issue 3 years ago • 1 comments

temp

Replay: https://zero-k.info/Battles/Detail/1731216?

at the same time as the picture is taken, there are apsis that draw 8.6 energy, and even the correct 12 energy draw

Sortale avatar Oct 12 '23 13:10 Sortale

An Aspis could draw less than its 12 energy per second while its shield regenerated. https://github.com/ZeroK-RTS/Zero-K/commit/40f71886ee42b948344c0b00e1fd1cca75357ccf fixes the cause. When a charge step would overfill the shield, Shield Charge scales that step's energy cost down; before this commit the scaled cost could stay in use for later regeneration, and now the next charge step always goes back to the full cost. A bench test on current master overfilled an Aspis shield with a quarter-size charge step and then let it regenerate: it drew 12 energy per second in both runs (12 expected), and the same test with that line removed drew 3. This looks resolved; it can be closed if the reporter agrees.

Found with help from Claude Code.

moss-orbit-9f339e avatar Oct 24 '26 11:10 moss-orbit-9f339e