The main idea behind a FSM is that, at any moment, it can be found in a single state from a finite number of possible states. If you find yourself needing more than this, try to see if those multiple states can't actually be merged in one single state. If you feel like taking the dirt road is not that much of a bad idea, you can build a FSM base and some extra behavior on top of it, to allow for a lot more flexibility. As I said in my comment, this whole object-in-multiple-states makes sense in quantum physics and is a really funky subject to think of, if you ask me.
Similar situation of mine:
I've recently tried to design a simple lamp with a smooth turn on/off effect as a FSM. When turned on, its intensity would gradually increase. The opposite when turned off. Keeping just the states: On, Off, Turning On, Turning Off was insufficient. When saving the game, for example, I also had to store the current light intensity when turning on or off, so that the process may be resumed. While, obviously, the number of possible states here was not equal to infinity (intensity goes between [min, max]), there were just too many to enumerate and merge. I had to (partially) break the FSM idea by storing the intensity step alongside the state. Perhaps you could apply something like this?
Regarding your latest edit, take a look at the gambits system in Final Fantasy XII:
The player is able to program the AI-controlled companions in a very nice way. Conditions are checked on each turn, one after the other. If a particular condition is met, the character performs the action and stops checking the rest, since he only has the ability to perform one action per turn. But in your case, you can make it not stop the checking process, and achieve the feeling of simultaneous actions.
Noticed how I made the word "actions" stand out? If I were you, I'd use a list-like structure, or perhaps a stack-like structure, to keep track of multiple actions that the robot has to take at any given time. If the robot has to flee and shoot at the same time, the actions would be: [Flee, Shoot]
. Every time you think it is necessary, you can go through the main table of {condition, action}
pairs and build the list or stack of actions that the robot has to perform.
You can build this behavior on top of a FSM base, like I did with my lamp. If the robot is in state COMBAT
, it does the table of {condition, action}
pairs check. Perhaps its health is below 50%? Add action "Flee" to the stack! But don't stop there. If there are some enemies still in range, also add "Shoot" to the stack.