I am writing a game for gameboy advance and I am implementing basic AI in the form of a binary search tree. There is 1 human player and 1 computer player. I need to figure out a way of telling how aggressive the human player is being in attacking the computer. The human will push a button to attack (and must be in a certain radius of the computer), so my first thought was to see how big the number of attacks was compared to the number of iterations my main while loop had gone through. This seems like a poor way to do it though, because that number will depend on the frame rate, which can fluctuate. Does anyone have an idea for a better way to do this?
I am writing a game for gameboy advance and I am implementing basic AI
Share
Why not just keep a count of the number of moments the human player can attack the computer player? I mean, you obviously have to check to see if he’s in range, so why not check whether he’s in range, and if he is, increment the
could_have_attackedcounter. Then if he actually does attack, increment anattackedcounter. Then you can compare how often the human player attacks to how often he has the opportunity.Alternatively, compare how often he is in range to how often he is not in range, or more generally keep track of the average distance between the players. More aggressive players will probably stay a lot closer to their opponents than passive players.
Your best bet will probably be a combination of different methods. Keep several different measurements, and try several different ways of weighing the methods against each other, and use extensive playtesting to pick which one is better.