Jump to content

Fuzzy Logic


Recommended Posts

For you guys knowlegeable about A.I., exactly what is fuzzy logic and how does it work? I know CM implements it, but other than in computerized rice cookers, I haven't seen this term before. Is this supposed to make the computer actions a lot less predictable?

Link to comment
Share on other sites

The term "fuzzy logic" is a potential approach to program an expert system. Possibility theory (or "fuzzy logic") was developed by Zadeh (1978) due to the difficulties he had with using probability theory's representation of inexact or vague information. It is based on his theory of fuzzy sets. Possibility theory expresses vague terms such as "very likely" or "probably" with precision and accuracy. If these terms were coded with probability, their imprecision or "fuzziness" would be lost, i.e., either the event occurred or it did not.

The advantage of possibility theory then is that events may be represented with shades of gray since human knowledge of facts is rarely precise. The disadvantages include the difficulty of interpreting fuzzy qualifiers and the necessity of fuzzy theories altogether.

From what I can tell, CM does not have an AI (as defined in academia or research circles). It's just a structured algorithm. There may be elements of an "expert system" coded in CM, but until BTS shares some proprietary information, we'll not know for sure if there is any heuristic reasoning.

[ 06-05-2001: Message edited by: Dr. Brian ]

Link to comment
Share on other sites

I know little about computers but AFAIK Fuzzy Logic gives the AI the ability to "guess" to a certain extent and accept more vague info.

I'm sure someone will post a more accurate reply soon. :D

Edited bit. Seeing as you seem to be quite knowledgable about the subject, could you explain it in more everyday language? Thanks for your help.

BTW out of interest are rice cookers common in the States?

[ 06-05-2001: Message edited by: Viceroy ]

Link to comment
Share on other sites

Normal boolean logic is yes/no and defines rules for operators and/or/not/xor.

Mathematicans developed a large set of tools to work on these paradigms.

Fuzzy logic is an attempt to make the same mechanisms available for more values than "yes" and "no". You need from-to ranges for your application, but you want to reuse all the research people did on binary logic. That is fuzzy logic, from what I understand, not having used it so far.

It has nothing to do with AI, neither in the common sense of "intelligence" (rather German than English meaning), nor does it belong to the classic AI programming paradigms. As some other new mechanisms, i.e. neural nets, they has just been stuffed into "AI" for no other reason that most non-standard programming that is hard to understand ends up there :)

If you actually do what people name "AI", it looks like just another set of clever search mechanisms with complicated performance characteristics anyway. Fuzzy logic not, though.

Link to comment
Share on other sites

<BLOCKQUOTE>quote:</font><HR>Originally posted by Dr. Brian:

From what I can tell, CM does not have an AI (as defined in academia or research circles). It's just a structured algorithm.

<HR></BLOCKQUOTE>

I don't think you can draw a line between these. As I said, if you use a classic AI mechanism, it is just another algorithm. Usually more difficult to use to full effect, but if you can and the application fits, it rocks. Kindof flamethrower teams in CMBO :)

<BLOCKQUOTE>quote:</font><HR>

There may be elements of an "expert system" coded in CM, but until BTS shares some proprietary information, we'll not know for sure if there is any heuristic reasoning.

<HR></BLOCKQUOTE>

Same here, I don't think you can draw a sharp line between a data set with a set of algorithms/routines and an expert system. An expert system (my view, of course) is a data structure which is much more flexbile than classic representations (especially relational databases), uses some of the "clever" AI search algorithms on them, including that the border between active code and passive data becomes blurred.

Link to comment
Share on other sites

<BLOCKQUOTE>quote:</font><HR>Originally posted by Viceroy:

could you explain it in more everyday language? Thanks for your help. <HR></BLOCKQUOTE>

The idea is that, instead of having to categorize things as definitely having or not having some attribute, you can allow some "wriggle room." The idea is to capture concepts like "not very dangerous" or "moderately dangerous" instead of being limited to "dangerous" and "not dangerous."

Expert systems tend to be rule-driven; that is, you will have a lot of rules like

if A and B then do C

that are used to decide what action to take. A simplified example in the context of CM might be:

if [you see an enemy tank] and [it can kill you but you can't kill it] then [pop smoke and reverse out of there]

Simple enough, but what do you do when the propositions [you see an enemy tank] and [it can kill you but...] aren't cut and dried? Is an assault gun a tank? What if you see a vehicle that's only partially identified? What about a Puma, or other armoured car with a decent gun capable of killing at least some tanks? What if your vulnerability is in question, because you're not sure what the enemy is armed with? What if your front armor is proof against the enemy weapon, but you're vulnerable from the side?

Using fuzzy logic, the proposition [it can kill you but you can't kill it] is not limited to the values TRUE and FALSE, but rather can take on intermediate probability values as well. These values can be calculated by mathematical equations that take into account all the things that might affect the "truth" of the proposition. So you can capture notions like "it's unlikely that vehicle can kill me" but still leave a little room for doubt.

Even if you're not using a formal expert system, you can use this idea to capture these sorts of fuzzy categorizations. Instead of having to code many, many special cases you can have a few more general cases and use fuzzy inputs (and outputs) to get the desired range of results.

Whether CM actually uses any of these constructs is unknown (except presumably to BTS).

<BLOCKQUOTE>quote:</font><HR>BTW out of interest are rice cookers common in the States?<HR></BLOCKQUOTE>

They're not something you would be likely to trip over in a store, but you could certainly find them if you look. At least in an urban/suburban setting.

Link to comment
Share on other sites

Page 57 of the original CM manual states:

"The TacAI uses "fuzzy logic" principles while determining the likely reactions of your units. This leads to a rich and varied set of possible unit behavior in different situations, and makes the units appear human in their reactions"

Link to comment
Share on other sites

<BLOCKQUOTE>quote:</font><HR>Originally posted by Viceroy:

BTW out of interest are rice cookers common in the States?

[ 06-05-2001: Message edited by: Viceroy ]<HR></BLOCKQUOTE>

I got one for Christmas last year and love it, but I live in Canada. You can find them easily at most stores like Co-op, Canadian Tire, etc.

Link to comment
Share on other sites

BTW out of interest are rice cookers common in the States?

--------------------------------------------------------------------------------

They are pretty popular where I work in Fla. Mostly with PR's and Asians. We have a ton of ethnic groups down here and you get alot of different buying trends when it comes to cookware. I have discovered an excellent Puerto Rican Spice called Adobo. Very good.

Sorry about the intrusion on the topic.

I guess this conversation popping up in one about Fuzzy Logic would be more along the lines of chaos theory?

keep it going fellas very interesting.

Mord.

Link to comment
Share on other sites

<BLOCKQUOTE>quote:</font><HR>Originally posted by Michael Dorosh:

I got one for Christmas last year and love it, but I live in Canada. You can find them easily at most stores like Co-op, Canadian Tire, etc.<HR></BLOCKQUOTE>

I ALWAYS go to the tire store for my rice cookers...

"Yes, I'd like a set of four all terrain P235 R17 tires mounted, rotated and balanced. Oh, and throw in that nice rice cooker you've got over there." ;)

The "fuzzy logic" can have it's own fuzzy definition, as has been demonstrated in previous posts. For my own 2 cents, think of a probability distribution representing your likely responses to some question. Maybe something like the lethality question posed in the earlier post, "Can his armor kill my armor?". Do the same for the converse question, "Can mine kill his?" Fuzzy logic, at least in my experience, relates to saying: "pick a discrete answer to the first question according to its probability distribution [definitely, probably maybe, dunno, probably no, definitely not]", then "pick your answer to the second question according to what you decided in the first question".

If I thought he could definitely kill my armor, I may be less likely to think that I can kill his due to the risk involved. If there is a 60% chance he kills me but a 90% chance I kill him I am more likely to go after him than if there is an 80% chance he will kill me and 90% chance I kill him.

My educational background has its fuzzy logic all based on joint probability distributions and Bayesian statistics.

Mathematics, as a form of pure logic, relies on the notion that A + B = C, and that given A and B you always get C.

Fuzzy logic says that given A and B, you get sometimes C, sometimes C1, sometimes C2,... Cn where n is up to the complexity you want to model.

For very large fuzzy logic systems, the most interesting questions are by far: "How do you test it?" and "How do you know when the answer is 'right' or at least 'reasonable'?"

[ 06-06-2001: Message edited by: Herr Oberst ]

Link to comment
Share on other sites

Incidentally, I've just read a book by Dupuy called _Understanding Defeat_ which attempts to model how defeat happens. I know Dupuy is of the "numbers mean _everything_" school (that he ranks Great Captains by their win/loss ratio seems somehow... simplistic) but I wonder how much of the book made it into CM. Certainly they give a fairly detailed model at the end of the book on modelling operational level defeat

Link to comment
Share on other sites

There is a lot of experience here and knowledge about expert systems, probability theory, game theory, heuristic reasoning, rule-based systems, etc.

I wonder what would become of CM, if some of us could get together and create a rule-based expert system for every aspect. I'm sure it would be awe-inspiring.

[ 06-06-2001: Message edited by: Dr. Brian ]

Link to comment
Share on other sites

<BLOCKQUOTE>quote:</font><HR>Originally posted by Stefan Fredriksson:

Is not "PO" a better term than "AI".

PO meaning Programmed Opponent. Think I saw it mentioned like that first time in The Operational Art of War.

The reason being - Artificial Intelligence is not yet where we can call it "intelligent".

So far computers and stuff are still programmed by humans.<HR></BLOCKQUOTE>

You are so right on the money!!!! The term "AI" is so over used, it has lost its pure form and definition. I agree wholeheartedly. Too bad publishers don't tout their games that way. Maybe they think they'll lose sales if they say programmed opponent, as "artificial intelligence" sounds more complex!

Link to comment
Share on other sites

I was under the impression 'fuzzy logic' was when your wife comes home with a new white blouse (frighteningly similar to the three she has in the closet already), and when you point out that she already has THREE, she says... "It was on sale, you wouldn't believe what a great deal it was!! I couldn't afford NOT to buy it!"

Tailz from the Darkside...

Link to comment
Share on other sites

This has been a fascinating thread. I'm not as knowledgable about computers as several of you appear to be, but I have tested fuzzy logic out in practice by using Alt-A and replaying the same turn several times over. If you do it at some highly charged moment, like a tank vs. tank or tank vs. AT gun confrontation, you can get radically different results each time from the same set of circumstances: Axis tank kills Allied tank; Allied tank kills Axis tank; both tanks miss; one tank suffers gun damage and backs away; one tank bounces shot off other's armor, then pops smoke; a zook/shreck guy gets in a lucky shot; both tanks simultaneously kill each other. Any of these results might affect the whole balance of a game.

Infantry will also behave very differently. Sometimes a squad under pressure will break and run. Next time, the same squad hangs in there and holds its ground. You never know for sure what will happen.

So, unlike many games where the computer will do the exact same thing every time, both the perfomance of an "AI" opponent, and actual game results, can vary quite widely. I think this is part of what makes this game so much fun and so full of variety.

So, hurray for fuzzy logic, whatever it might be!

Link to comment
Share on other sites

I think CombinedArms explains very good how fuzzy logic works.

Like I saw Olle put it once: "If you are playing chess and move the pieces in a certain way, they will behave the same way every time. With fuzzy logic they do not."

And that is the beauty of it - you can never really *know* what is gonna happen! smile.gif

Link to comment
Share on other sites

<BLOCKQUOTE>quote:</font><HR>Originally posted by Stefan Fredriksson:

I think CombinedArms explains very good how fuzzy logic works.

Like I saw Olle put it once: "If you are playing chess and move the pieces in a certain way, they will behave the same way every time. With fuzzy logic they do not."

<HR></BLOCKQUOTE>

Actually I would be very surprised if that has got anything to do with fuzzy logic at all.

What you observe here is the outcome of the random numbers that are used to resolve hit probabilities and penetration probabilities on hit and knockout propabilties on penetration. It is like in chess "a tower beats a horse if it is in straight line from him *and* you throw a dice and get a 6".

The behaviour of units (TacAI) and the computer opponent is propably fed with simple random numbers as well to a certain extend, but fuzzy log makes more sense here. Not knowing details of CMBO's implementation of course, I guess that the use of fuzzy logic in unit's "decisions" will allow you to get a lot of useful behaviour details for very few programming time.

Remember that none of these "AI" programming techniques enable any computation that you can't get with "classic" data structures and algoritms. The capabilities of the microprocessor remain the same. If you understand the AI techniques, you use them while thinking in the same microprocessor terms as with any other algorithm.

However, the point about most AI techniques, especially neural networks and knowledge inference systems is that you have a mechanism where you "just throw in" data and the program gives you output that would be very hard to compute with simpler algorithms. They are just shotcuts to save programming time. Of course, the result is only "good enough" and a handcoded solution may still be better, but the programming effort is often out of proportions, and -that's worse- the hand-coded solution may be much harder to adapt to new situations later.

In the same way I think that the use of fuzzy logic in CMBO's computed opponent (and maybe TacAI) is used to get rid of a large part of the special-coding a computed opponent controlling the TacAI units would require normally. Remember that CMBO is written essentially by one programmer.

Just guessing for now, of course, but I imagine that fuzzy logic in the computed opponent can be used to make movement of the force coordinated without getting sunk in a nightmare of programming effort for checks and corrections between high-level plan and inidividual unit behaviour. You already have the TacAI, which is obviously a very detailed and tuned mechanism, you will probably reuse that for a major part of the computed opponent.

So, you use the logic mechanisms for behaviour determination as usual, but instead of feeding yes/no classic logic into the computation, but you use from-to values that are "tuned" so that the outcome is biased towards an overall plan. That way you get a computed opponent with a very basic top-level planning mechanism (just approach routes and what units first), reuse of the already working TacAI and glueing them together with a mechanism that does the coordination good enough for a minimal programming effort.

[ 06-07-2001: Message edited by: redwolf ]

Link to comment
Share on other sites

×
×
  • Create New...