Mismatch between planet explosion code, comments, and documentation
See original GitHub issuedocs
When a planet dies, it explodes, dealing damage to any ships or planets within 10 units of the planet surface. The damage scales linearly with distance from the surface, beginning at 255 damage when adjacent to the planet and ending at 51 damage if 5 units away.
code
Logic is here: https://github.com/HaliteChallenge/Halite-II/blob/11b7d6c1abc588d0de250b854d9d47963077b786/environment/core/Halite.cpp#L71-L84
Where distance
is center of planet to closest edge of the target (ship or other planet), distance_from_crust
is the distance from planet crust to the closest edge of the target, and max_distance
is the higher of the docking radius constant (4) or the planet’s radius.
Only ships within max_distance
are considered for this method, so any damage scaling beyond the planet radius (or docking distance) is ignored.
I think the damage is closer to this (but could be wrong, can somebody verify?)
radius | distance | damage |
---|---|---|
2 | 0 | 1275 |
2 | 2 | 1211.25 |
2 | 4 | 1147.5 |
4 | 0 | 1275 |
4 | 4 | 1147.5 |
8 | 0 | 1275 |
8 | 4 | 1211.25 |
8 | 8 | 1147.5 |
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (3 by maintainers)
I think this new logic is backwards:
At a close distance (1) to a planet with a radius of 4
At the maximum distance
I think you’d want
@Billiam good catch, my mistake.