FSM with fuzzy controller?
Has this been done before? If so, what is it called? I looked into fuzzy state machines, but they seem to be something slightly different - what im talking about is using a fuzzy controller to traverse a finite state machine.
Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]
Fuzzy logic could be used to calculate/decide if the requirements for a transition is met (or which is the best) but the transition is still discrete.
The decision is based on the locality of the current state (testing a set of transitions for that context).
What you describe might just be competing transitions within the parent state and yes fuzzy logic might be useful for more flexible decision calculation.
It also used a HUGE chunk of our CPU budget (this was back in PS2 and PSP days), so we had to limit the state-switch frequency down to where it was ALSO very unresponsive. Most of the CPU time was spent doing massive amounts of line-of-sight checks. Some was spent doing pathfinding. Quite a bit was spent evaluating the ridiculous amounts of tuning variables to see if a state should be continued/entered.
For the boss AI I worked on, I avoided using the fuzzy controller, tossed out as many tuning variables as I could, hardcoded a lot of behavior directly in C++, and got a much more satisfying boss fight out of it.
We didn't use a special name for the fuzzy system. It was just called the Enemy State Machine.
Of course, there are plenty of other games in a wide variety of genres that do this. The key thing that I want to point out in your request, however, is that you need to conceptually separate "state" from "reasoner". A state is analogous to a behavior. A reasoner is a thought processes that selects a behavior. In a FSM, the reasoners are in each state. In other methods (a behavior tree for example), the reasoner is its own entity that selects a state based on its decisions.
Start with that line of thinking.
Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play
"Reducing the world to mathematical equations!"
What I want to do is implement a few different AI agents, for different types of enemy, in a vehicle combat game. I wanted to try something different to an FSM, because in the past I've had a lot of hassle programming and debugging FSM's. I want each agent to use a subsumption architecture; tasks which have a series of logical steps will have a traditional FSM, and the top layer would be a fuzzy controller which selects, based on what is happening, what the priorities are, from a list which is different for each entity.
Scanner bots need to spread out over an area, doing a more concentrated scan (i.e. more bots in that area) if a particularly suspicious event occurs; events are things like the appearance of tire tracks,"enemy" bullets appearing, and things blowing up. They also need to return to base occasionally to recharge.
Enemy tanks work in patrols; each patrol has a "boss" vehicle, and that vehicle can work from a traditional FSM because its main job is to follow a predetermined patrol path and occasionally order an en-masse attack if the player gets spotted.
Other vehicles in the patrol need to be a bit more subtle. They need to keep close to a formation relative to the boss vehicle, dodge projectiles, and attack the player.
Finally, if I get time, I want to add helicopters. These things work in bombing runs, responding to any alarmed scanners, and providing support to any patrol which is under attack.
I wanted the overall effect of all this to be that the world feels "alive" and the player must learn how each enemy behaves in order to defeat the level. FSM's feel clunky, and do stupid things like getting stuck in particular states, or having to go through several redundant states before they reach their desired state.
Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]
Sounds like a utility-based architecture would indeed suit you well, as Dave already mentioned.
Yep. It's all about defining the behavior through mathematics. I bet if you look around... look down really, you can find a book on the subject.
Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play
"Reducing the world to mathematical equations!"
[quote name='ApochPiQ' timestamp='1316149130' post='4862317']
Sounds like a utility-based architecture would indeed suit you well, as Dave already mentioned.
Yep. It's all about defining the behavior through mathematics. I bet if you look around... look down really, you can find a book on the subject.
[/quote]
Yeah... thanks, but I'm not going to do that. I don't need to define all the behavior through mathematics. I encountered formalism in university and I found it incredibly time consuming and unproductive to boil everything down to equations, especially for non deterministic systems or systems with emergent behavior.
What I want is an architecture, not a notation, which should have been made clear by my original post.
Nobody's suggesting that you have to write your system down as a bunch of greek letters and weird symbols...
Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]