Talk:Selecting Fire Power
Archived discussion pages
Smart Fire Power Selection
I've also coded up a 'smart fire power' chooser, based off the description in Dookious. However, what it seems is the problem with using the code is that it optimizes for survival, not score. As such, I'd like to put down a few thoughts/improvements I had.
The first is that, as long as our energy is higher than the enemy's (with a safety margin of course), we don't need to worry about survival, and can optimize purely for bullet damage instead. I did the math, crunched the numbers, and it turns out that the fastest way to inflict damage on an opponent is with a fire power of 2.4999. (For those interested, I took out all the variables that didn't depend on the fire power and ended up with ((4*x+2*Math.max(0,x-1))/((10+Math.floor(2*x))*Math.asin(8/(20-3*x))) ). This does not depend on distance, hitrate, or anything. Basically, if you want to inflict maximum damage in the minimum amount of time, and you *don't* have a 100% hitrate, 2.49999 is the power to shoot at. However, for certain cases against, for example, Rambots, where a 100% hitrate *is* guaranteed, the best power is 2.99999, because you can shoot slightly more often than the rambot shooting with a power of 3 yet the difference in damage is negligible.
Secondly is the case where we have less energy than the enemy. This actually has 2 sub-cases, one where a decision is made that it is possible to get higher energy than the enemy (ie win the round) and the other where it is decided that it is impossible to win this round (I call this one 'Kamikazi'). The decision between these two sub-cases is a simple projection of the enemy's hitrate and our hitrate at our most energy-efficient bullet power, and seeing if it is possible to have a higher energy than the enemy before we get killed. Taken into account should be the loss of score due to possibly reduced bullet damage, and this should be compared to the gain in score of winning the round. If it is desirable to equalize energy before the end of the match, the algorithm for maximizing energy gain should be used for bullet power (this is the one used in Dookious_1.60 and RougeDC_survival). If it is not desirable, a bullet power of 2.9999 should be used to inflict as much damage as possible while at the same time wasting energy so the enemy has less time to get bullet damage.
This entire procedure should be run every tick, including the decision as to whether to go survivalist or kamikaze. Tell me what you think, and if you find any problems with my ideas and/or logic =) --Skilgannon 18:31, 3 June 2009 (UTC)
Nice, I think I'm with you on most of your ideas here. (I remember Martin mentioning 2.49 optimal bullet power once, maybe that was his formula.) Indeed hit-rate does factor out if you ignore survivalism. Here's the survivalist formula I used for measuring the value of a bullet power, just in case anyone's curious.
(((bulletDamage(bulletPower) + lifeGained(bulletPower)) * probabilityToHit) - bulletPower) / gunHeat(bulletPower)
I'm not sure I agree with the "Kamikaze or not" subcases, though I like the idea. =) What I'd rather do is, for any bullet power:
- Project X total bullet damage given this round. (Would include actual damage given so far plus projected damage for this bullet power.)
- Project Y total bullet damage taken this round. (Would include actual damage taken so far plus projected damage for their average bullet power, or even tracking / projecting what bullet powers they use at what energy levels, whatever.)
- Estimate probability Z of winning this round using this bullet power.
Then you'd want to optimize something like (X + Z*oneRoundSurvivalPoints) / (Y + (1-Z)*oneRoundSurvivalPoints)
. In some cases you would certainly "go Kamikaze". Thoughts?
--Voidious 20:48, 3 June 2009 (UTC)
- [View source↑]
- [History↑]
You cannot post new threads to this discussion page because it has been protected from new threads, or you do not currently have permission to edit.