Friday 23 January 2009

More Fuzzy Logic and FuSMs Notes

Contrary to popular belief, FuSMs are not really fuzzy logic systems. Fuzzy logic is a process by which rules expressed in partial truths can be combined and inferred from to make actual decisions. It was created because many real-world problems couldn't always be expressed (with any degree of accuracy) as finite events, and real-world solutions couldn't always be expressed as finite actions. Fuzzy logic is merely an extension of regular logic that allows us to deal with these kinds of rule sets. The simplest form of actual fuzzy logic in games (which is very common), is straighforward if. . .else statements (or their equivalents, through a data table or some kind of combination matrix) that describes changes in behaviour. For example, the statement “if my health is low, and my enemy's health is high, I should run away” is a straightforward fuzzy rule. It compares wo perceptions (my health and my enemy's health) in a fuzzy manner (low versus high) and assigns it an action (run away). This statement has probably been written as an if statement for hundreds of games over the years. This represents the barest minimum of an actual fuzzy system. A real fuzzy logic system would comprise many general fuzzy guidelines for any given combination of my health, my enemy's health, and all the other variables of concern into matrices of rules that will give me a response action through algorithmic combination of my health, my enemy's health, and all the other variables of concern into matrices of rules that will give me a response action through algorithmic combination. This tens to be a powerful way of getting results from a fuzzy system, but suffers when there are many fuzzy variables (each of which may have numerous possible value states or ranges) by creating a quickly unmanageable necessary rule set size, a problem called combinatorial explosion. This can be worked around using a statistics technique called Comb's method, which can reduce the required rule set, but also reduces accuracy.

FuSMs are rapidly becoming common in game AI usage. The predictability of FSMs is becoming undesirable, and the overall content of many games is becoming rich enough to warrant the additional design and implementation complexity of FuSMs.

FuSM definitely require more forethought than their finite brothers do. The game problem must really be broken into the most independent elements that the problem allows. An FSM could be implemented within the confines of an FuSM system, by calculating the digital activation levels and designing the system so that there is no overlap in state execution. FuSMs are not suited to the general range of problems as FSMs are. FuSMs are a kind of FSM that simply allows for the activation of multiple states as the current state, as well as being able to have a level of activation of activation to the degree that the game situation merits each state.

In fact, many people will contend that FuSMs are not even really state machines at all (because the system isn't in a solitary state) but, rather, are more like fuzzy knowledge bases where multiple assertions can be partially true at the same time. But, by coding independent states to take advantage of these multiple assertions, we can use FuSMs to accomplish our AI goals that require this kind of mechanism.

From AI GAME ENGINE PROGRAMMING 1st ED

No comments: