Putting the "fuzzy" into a Fuzzy State Machine?

Started by
0 comments, last by forxl 22 years, 11 months ago
I''m trying to write a small AI demo to simulate two types of unit (attacker and defender) in an overhead viewed 2D landscape and I have started out with a basic state machine structure for each unit but I was looking to make it less deterministic by implementing it as a Fuzzy State Machine. My only problem is that I only have a very basic knowledge of what Fuzzy Logic is and I don''t have a clue where to start implementing a Fuzzy state machine. I was wondering if anyone can point me to a good tutorial on Fuzzy Logic and perhaps some sample code for Fuzzy state machines? Thanks, -F
--:D, F
Advertisement
quote:Original post by forxl

I''m trying to write a small AI demo to simulate two types of unit (attacker and defender) in an overhead viewed 2D landscape and I have started out with a basic state machine structure for each unit but I was looking to make it less deterministic by implementing it as a Fuzzy State Machine.

My only problem is that I only have a very basic knowledge of what Fuzzy Logic is and I don''t have a clue where to start implementing a Fuzzy state machine. I was wondering if anyone can point me to a good tutorial on Fuzzy Logic and perhaps some sample code for Fuzzy state machines?

Thanks,

-F


I can point you to a couple of sources.

First, you may want to start your research on Fuzzy Logic at
http://www.pcai.com/pcai/New_Home_Page/ai_info/fuzzy_logic.html which has a number of excellent links about Fuzzy Logic.

As for sample code [shameless plug alert], I just finished writing an article A Generic Fuzzy State Machine in C++ that will appear in the Game Programming Gems 2 book published by Charles River Media and due to be available for SIGGRAPH. This article is a follow-on to the A Generic Finite State Machine in C++ article that I wrote for the Game Programming Gems 1 book last year. It comes complete with source code too. [end shameless plug alert].

However, I suspect you don''t want to wait till the book is available to get an answer, and even then, you may not want to buy the book? So, here are some suggestions that may help you understand fuzzy vs finite.

Fuzzy Logic is basically the degree to which something belongs to a set. So, instead of an NPC being MAD or HAPPY as in finite logic, the NPC can be Almost MAD or only Kind of HAPPY by using Fuzzy Logic. So, think of the fuzzy condition of Almost as a certain range of conditions of MAD.

The other issue to consider in a Fuzzy State Machine (FuSM) is that the system could actually be in more than one state at a time, if the ranges happened to overlap.

Well, I hope this helps you some. If not, use the links in the URL I provided above, to study up on Fuzzy Logic, and be sure to buy the GPG2 book and read my article.

Good Luck,

Eric

This topic is closed to new replies.

Advertisement