Latest Posts

Topic: Define if strong or werk soldiers should attack first

ypopezios
Avatar
Joined: 2018-04-20, 00:22
Posts: 220
Ranking
Widelands-Forum-Junkie
Posted at: 2018-05-04, 10:40

GunChleoc wrote:

If I understand your math correctly, heroes stay inside and rookies will attack.

Of course not. Heroes stay inside only if they need healing, which is part of the requirements. If heroes are healthy, they come out before rookies. That's the point of negation through factor 0,9999. And when both heroes and rookies need healing, the formula uses both health and ability to calculate the most efficient choice of soldiers, which is a mix of heroes and rookies. You need to calculate some examples to see that in practice. Or give me some examples and I'll make the calculations for you.

GunChleoc wrote:

  • 1a. When the building is set to "Prefer Heroes", make sure that 1 hero stays inside, or the most injured soldier
  • 1b. When the building is set to "Prefer Rookies", make sure that 1 rookie stays inside, or the most injured soldier
  • 2. Of the remaining soldiers, send out the strongest/least injured soldiers first

All those should use need_to_stay_inside instead of injury.

GunChleoc wrote:

This could be achieved by sorting from strongest to weakest and skipping the first on the list for case 1a, or remembering the particular soldier in a variable.

That makes sense, but again using need_to_stay_inside for the sorting.


Top Quote