I modified my formula (as in diff 5 at rb) to fulfill the time limit 30 s
constraint. It also fulfills all the other constraints I mentioned (obviously
except the "1 s per point", which is conflicting to the other one).
I made a new diff (attached) for it and playtested it with 123, 139, 296, 302,
493, 598, 711, 742 and 999 at minor and major damages. I also ran -b dialog.
The costs seem very appropriate. I also tested the new check that the repair can
not be performed if Tux would overheat.
Again, the main characteristics of the formula:
cost = constant * bot_modifier * ability_modifier * healing_modifier * damage
-- the bot_modifier ranges from 0.8 (small bots) to 1 (big bots) [realized by
(1200 + npc_max_health())/1500]¹
-- the ability_modifier reduces the costs by ~2% per ability_level [realized by
math.exp(-0.02 * ability_value)]
-- the healing_modifier takes the (self-)healing of the bot in account, i.e. it
reduces the damage to be repaired in exactly that amount that the bot could heal
within the repair_time [realized by 1/(1 + bot_repair_time *
get_bot_healing_rate())]
-- damage is the npc_damage_amount()
-- constant limits the repair_time to a maximum of 30s and modifies the
cost-types (circ_costs are ~7 times and heat_costs ~3 times the time_cost)
The upper limit is hardcoded under the assumption that a 300 HP-bot with healing
rate 2 (i.e 0.2 with difficulty-modifier 0.1) is the most expensive bot to be
repaired. It could be dehardcoded or be computed by given most expensive bot
specs or whatever, if somebody wants that, but by now I don't see a benefit from
that ;)
¹ I skipped the logarithm, since it is not strictly necessary. |