0
$\begingroup$

Not sure if this is the right forum, please comment on the correct one. OK: I am creating a game where the user inputs stats and attack values, and I want the ai to match its ability (so they are about equal) for example,

  "Health":  1000,
  "Shield blockage percent":  90%
MOVE#1
      "Damage":   100,
      "Accuracy": 100%
MOVE#2
      "Damage":   1000,
      "Accuracy": 10%

So if you use the shield, it will block 50 percent of the foe's damage Accuracy for MOVE#2, only 1/10 will hit. How do I calculate an equal foe, just replicate the stats? Any way to do it without replicating the stats?

MORE NOTES

The optimal game would last 7 moves and would be very close
Shielding counts as a move, and is a constant 90% for all people.
An optimal game is one that would be won or lost by 1-2 turns.

$\endgroup$
2
  • $\begingroup$ What tags as well? sorry!!! $\endgroup$ – XXX Mar 27 '16 at 1:00
  • $\begingroup$ Could you describe in more detail how the game works? Is using the shield a move? And you have to be clear about what you mean by equal foe. Do they play randomly? Do they play well as if the know their opponent's moves from the start? Do they play well but have to observe the opponent's moves? Do you have a metric in mind for "playing well"? Etc. $\endgroup$ – Mark S. Mar 27 '16 at 13:48
0
$\begingroup$

The first thing you need to do is figure out a constant dpt, or damage per turn. calculated by doing damage/(accuracy as a decimal). Each person would have 3 moves that have the same dpt:

high risk | EG 1000 dmg, 10% acc. 
med risk | EG 200 dmg, 50% acc.
low risk | EG 100 dmg, 100% acc.

dpt = 100 (must be constant)
computer stats are dpt * 7 = health and health/7 = dpt

health = 700
dpt = 143 [1000/7(rounded up)]

calculate moves,

high risk | EG 1430 dmg, 10% acc. 
med risk | EG 286 dmg, 50% acc.
low risk | EG 143 dmg, 100% acc.

complete

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.