Iβm watching some time now about how a programmer can imitate an AI solution based on the percentage of actions for the final tactically-like games (strategy game).
Say, for example, that the AI ββsymbol has the following actions:
Attack 1: 10%
Attack 2: 9%
Magic: 4%
Move: 1%
All this is far from 100%
Now, first, having an array with 100 empty slots, the attack will have 10 slots, attack 2 9 slots in the array. By combining the random, I could perform an action. My problem here is that it is not very effective or seems not so. It is also important what should I do if I get into an empty slot. Should I calculate for each character all actions based on 100% or determine, possibly, the "default" action for all?
Or maybe there is a more efficient way to see all this? I think this percentage is the easiest way to implement AI.
source share