Thursday 26 October 2017

4.2 Fuzzy Logic


Fuzzy Logic

Fuzzy logic algorithm is where the state membership has a float range and not made up of 0 and 1's, what I mean by this is the state is a number between the 0 and 1, so for example 0.5. You're probably thinking, what does this mean? Well to make it simpler, in a shooting game the AI as well as the player character will have a health bar, below is an example of Fuzzy logic...


From my example you can see the life of an AI character in a game, now "No Health 0%" is obviously when the AI character is dead. "Full Health 100%" is when the AI is at full health and had no damage to it, but that's not the segment we are interested in Fuzzy logic. What we are interested in is the AI's health bar at 67%, this is the in-between of 0 and 1.

Now the next part of Fuzzy logic is the actual reaction of the AI in the time of even the health bar drops below a certain point, Now the developer could then implement code so when the health bar drops below a certain point the AI character will flea the scene or attack. The AI use decision tree's (4.4 Decision Tree) to make it's next move, an example of this is shown below...


Now the decisions the AI will make is what to do at certain stages of the health bar, lets take the game Call of Duty: World at War as an example. The AI soldier enters the shooting scene with 100% health, once he gets shot his health bar will begin to decrease, now in my example above, when the AI hits 60% health then the AI soldier will retreat and take cover, find someplace to hide. Then if the attack continues on the AI and his health bar goes down to 10% or below, the reaction of the AI will be to run away from the shooting scene and out of range from the player character.

"enabling an AI opponent to assess threats and for classification, for example by ranking players and NPCs in terms of health or power using fuzzy variables"(10)

Pirovano makes the exact point that using Fuzzy logic, a game can separate a classification of AI. Ranking how good one AI is to another, in a game the boss of a level will be harder to defeat that a ground soldier in the game, this is also used to acknowledge the longer heath that the boss AI will have. It's a perfect example of Fuzzy logic and displays what the algorithm is all about.

No comments:

Post a Comment

Introduction to: NWC603COM – Using AI in Computer Games Assignment 1

Introduction to: NWC603COM – Using AI in Computer Games Assignment 1 Artificial intelligence (AI) in the gaming world today has become ...