Latest Posts

Topic: A bug or a feature?

wl-zocker

Joined: 2011-12-30, 16:37
Posts: 495
Ranking
Tribe Member
Location: Germany
Posted at: 2014-09-15, 11:30

I decide based on the efficiency, which takes the costs into account, as well. Let's take a real world example:

I will work with the Empire. I set the cost of all renewable resources = 60 (to avoid fractions). This means:

  • log = 60, therefore wood = 120
  • water = wheat = grapes = 60
  • beer = wheat + water = 120
  • wine = 2*grape = 120
  • meat = wheat + water = 120 (because in longer games, there will be no fish or game)
  • flour = wheat = 60
  • bread = flour + water = 120
  • ration = min(bread, meat) = 120
  • meal = bread + meat = 240
  • (coal = (beer + ration)/3 = 240/3 = 80 in a normal coalmine)
  • coal = (beer + meal)/5 = 360/5 = 72 in a deep coalmine
  • This means that a deep coalmine is more efficient, therefore I only take this value (the strategy is to enhance the mine directly after it is built).
  • (ironore = (ration + beer)/3 = 240/3 = 80 in a normal oremine)
  • (ironore = (meal + beer)/4 = 360/4 = 90 in a deep oremine)
  • This means that a normal oremine is more efficient. But in long games, enhancing is a must, and the normal mine only mines 50%. Therefore I take the avarage:
  • ironore = 85
  • iron = ironore + coal = 157
  • goldore = (ration + wine)/2 = 240/2 = 120 in a normal goldmine
  • goldore = (meal + wine)/3 = 360/3 = 120 in a deep goldmine, so there is no difference
  • gold = goldore + coal = 192

  • wood lance = wood = 120

  • lance = coal + iron + wood = 349
  • advanced lance = coal + 2*iron + wood = 506
  • heavy lance = 2*coal + iron + gold + wood = 613
  • war lance = 2coal + 2iron + gold + wood = 770
  • helm = iron + coal = 229

  • soldier = wood lance + helm = 349

  • soldier evade1 = soldier + 2*bread + meat = 589
  • soldier evade2 = soldier evade1 + 2bread + 2meat = 1069
  • soldier attack1 = soldier + lance + bread + meat = 938
  • soldier attack2 = soldier attack1 + advanced lance + bread + meat = 1684

Now let's take a soldier with attack2, evade0 and HP = 100/130, so a power of 3470.214 according to your modified formula.
Another soldier has attack0, evade2 and HP = 107/130, so a power of 3415.427 according to your modified formula.
So you would send out the soldier trained it attack, although it is more wounded.

I define efficiency = (MaxAttack+MinAttack)/((100-Defense)(100-Evade))*CurHP/costs.
The first soldier would then have 5.3578E-4, the second one 7.7635E-4. So I would send out the cheaper soldier.

What I try to say: You only take the relative health into account. While this yields to good results in the case you demonstate (injured hero vs. healed rookie), there are cases where your calculation leads to suboptimal results (example see above). Why should I waste so many resources?


"Only few people know how much one has to know in order to know how little one knows." - Werner Heisenberg

Top Quote
DragonAtma
Avatar
Joined: 2014-09-14, 00:54
Posts: 351
Ranking
Tribe Member
Posted at: 2014-09-15, 12:20

Well, if you'd like we could work on making upgrades match their costs better. Barbarian attack, for example, doubles when going from level 0 (12~16 damage, avg. 14) to level 2 (26~30 damage, avg. 28), while going from level 2 to level 5 (47~51 damage, average 49) costs a lot more (three expensive axes, more meat, plus the one-time cost for a War Mill upgrade), yet doesn't even double their attack.

For comparison:
0 -> 2 attack is two meat/fish, two bread, three coal, and three iron.
2 -> 5 attack is five meat/fish, three bread, five coal, six iron, and three gold (and, the first time, the cost of a war mill).


Top Quote
wl-zocker

Joined: 2011-12-30, 16:37
Posts: 495
Ranking
Tribe Member
Location: Germany
Posted at: 2014-09-15, 12:41

I know that the better upgrades cost a lot more. Therefore, I wrote about cost_weight, which makes the cost function grow slower when set to a value between 0 and 1.

It would really be interesting to see if better soldiers are worth there cost, but therefore, other factors have to be considered as well (time of production, time the soldiers need to replace the fallen ones, building costs and space of additional military buildings). When making a large amount of trained soldiers, the costs for buildings that are only built a few times (i.e. all production buildings) per soldier become minimal, therefore I neglected them.


"Only few people know how much one has to know in order to know how little one knows." - Werner Heisenberg

Top Quote
DragonAtma
Avatar
Joined: 2014-09-14, 00:54
Posts: 351
Ranking
Tribe Member
Posted at: 2014-09-15, 13:45

Sometimes later soldiers are worth their cost. Other times, not so much. face-wink.png

Having later powerups (Heavy Double Trident, etc.) be less cost-efficient than earlier ones (Long Trident, etc.) is understandable, but at the same time it'd make sense for same-tier powerups (Long Trident and Steel Shield both being 0 -> 1) to be equally cost-efficient.


Top Quote
Ex-Member
Avatar
Topic Opener
Joined: 2014-09-12, 09:53
Posts: 184
Ranking
Widelands-Forum-Junkie
Posted at: 2014-09-17, 14:22

There is another bug that might have some relevance to this discussion https://bugs.launchpad.net/widelands/+bug/849896. I had assumed that all soldiers healed when in a military building but it seems there is a system where the first one in get healed fully first. Perhaps a similar calculation could be used to determine the healing order, this would tend to promote the healing of heros so they are the first to fight.


Top Quote