I'm a beginning game designer and I'm trying to design a combo based Fighting game. How would I code the enemies to select which combo to perform? I want to leave it up to RNG but I don't know how to program that.
For others: I did this for a MUD I worked on back in the day. Essentially, try to figure out how useful an ability/spell/combo/whatever might be, build a weighted list, and work from there. essentially, each spell (in this case) had an int properUse() function, that would return a number based on how suitable the spell was. If it was an AOE spell, for example, it'd take the number of valid targets and square it to return the value (it was more complex than this, it can be as complex as you like, all that matters is that you pump out a number that gives an idea, relatively speaking, how likely the AI is to use the spell. in C#, I'd probably use a dictionary of type List<Ability, int> for this purpose. Once I'd populated it with each ability and it's use potential (the int in the dictionary), I then loop through and sum all those values, and pick a random number between 0 and that range. Then you loop through the dictionary again, subtracting out the weighted value of that ability from your randomly generated number. When that int is <= 0, then trigger the current ability you're processing through the dictionary. No sorting or ordering is necessary.
If this was stackoverflow 90% of threads would be marked as duplicate and closed within minutes. And Erric would have 90% of all reputation on the site.