C7-Game / Prototype

An early-stage, open-source 4X strategy game
https://c7-game.github.io/
MIT License
34 stars 9 forks source link

Perfect defender retreat behavior #274

Open maxpetul opened 2 years ago

maxpetul commented 2 years ago

As of the "Combat Part Two" set of changes in Carthage, defending units can retreat from combat. However they are limited to retreating onto the tile directly away from their attacker, whereas in the original game they can also retreat onto the tiles on the sides. Additionally the retreat movement needs to consider enemy zone of control. Issue split off from comment here: https://github.com/C7-Game/Prototype/pull/250#discussion_r893052596

maxpetul commented 2 years ago

A couple more things:

  1. The formula for retreat chance in the original game is (unit's retreat bonus) / (50 + opponent's retreat bonus)
  2. Need to investigate if units starting battle with 1 HP are actually not eligible to retreat
maxpetul commented 2 years ago

Update: Many players' experiences and my own testing confirm that 1 HP units cannot retreat, so this is fine as is. But the function to compute the retreat chance does need to be changed to match the original game.