Applications of fuzzy logic in game creation have proven useful, especially when it comes to modelling the behavior of non-player characters (NPCs) in video games. NPC behavior in video games has historically been governed by strict rule-based systems or scripted sequences, which frequently led to restricted and predictable interactions. On the other hand, fuzzy logic adds a degree of flexibility and ambiguity to the decision-making processes of NPCs. By improving the naturalness, adaptability, and emotional resonance of NPC behavior, fuzzy logic may greatly enhance player experiences in games. It provides players with progressively more engaging and dynamic gaming experiences as it continues to be incorporated into game production, opening up new possibilities for interactive narrative, gaming, and immersive virtual worlds.
Based on Utku Kose\'s article, \"Developing a Fuzzy Logic Based Game System,\" I have investigated the use of fuzzy logic in gaming contexts for NPC decision-making in this study.
Introduction
I. INTRODUCTION
In computer science, artificial intelligence is essential because it allows robots to mimic human thought processes and behavior. It is employed in a number of industries, including the military, machine industry, biology, physics, and electronics. Unique game characters are produced in the computer game business by utilizing pre-existing technology to construct artificial intelligence systems. Artificial intelligence applications in computer games have increased dramatically with the rise in processing capacity, utilizing sophisticated techniques such as neural networks, fuzzy logic, and evolutionary algorithms.
The use of fuzzy logic in game creation encompasses several aspects of NPC behavior rather than being restricted to just one. This covers pathfinding and character movement, decision-making and emotional states, risk assessment, and adaptation in multiplayer games. Fuzzy logic is used in these areas to enable NPCs to respond to player actions, show a variety of emotions, and fluidly adjust their movement patterns—all of which were previously impossible with more conventional approaches.
Video game NPCs are one specific and effective area where fuzzy logic, a mathematical foundation for handling imprecise and uncertain information, has found a unique and useful use. Fuzzy logic adds a degree of ambiguity and adaptability to NPC decision-making processes, allowing players and NPCs to interact in a way that is more contextually aware and human-like. The inventive application of fuzzy logic in gaming settings is explored in this abstract, which also highlights how it improves NPC behavior to produce a more realistic and emotionally compelling gaming experience.
Here in this paper, I have experimented with the fuzzy logic-based computer game to improve the NPCs decision making how will he react based on the situation he is on.
II. LITERATURE SURVEY
Fuzzy Set: The seminal work "Fuzzy Sets" by Lotfi A. Zadeh established the notions of linguistic variables, membership functions, and fuzzy sets. It created new avenues for managing vague and imprecise data, which paved the way for the creation of fuzzy logic, which has found extensive use in domains spanning from artificial intelligence to control systems and beyond.
Fuzzy Logic and Crisp Logic: A development of crisp logic that treats variables as true or false is fuzzy logic. Fuzzy logic, on the other hand, defines membership degrees using a membership function and permits items to be in multiple sets. For instance,
µA(a):U → [1, 0]
can be used to define the connection between a set and an element. Fig. 1 displays characteristic function drawings for both crisp and fuzzy sets.
The way fuzzy and crisp logic handle uncertainty and imprecision is the main way they differ from one another. When information is ambiguous or unclear, fuzzy logic works effectively and enables a more nuanced, human-like depiction of the facts. Crisp logic, on the other hand, is appropriate for applications requiring rigid, deterministic reasoning as it is based on exact, binary differences. The type of data being used and the particular requirements of the situation at hand will determine whether fuzzy or crisp logic is best.
3. Defining Membership Functions: A membership function gives every element in a discourse universe a degree of membership, from 0 to 1. The membership of the element in a fuzzy set is represented by this degree. Full membership is indicated by a value of 1, whereas zero denotes no membership. Different kinds of membership functions exist. Triangular Membership Function Triangle-shaped, peaking at a certain location in the discourse universe. The membership function of a trapezium is characterized by its two flat bases and two sloping sides. Gaussian Participation Function: Bell-shaped, having a symmetric spread and a peak. Membership function that resembles a "S" and is frequently utilized in logistic or sigmoidal functions is called a sigmoidal (S-shaped) function.
4. Fuzzy Linguistic Rule: Fuzzy logic systems rely on fuzzy language principles to make decisions and reason in a manner similar to that of humans. Linguistic variables are natural language expressions that reflect values such as "high," "low," "hot," or "cold." They are frequently linked to them. Every language variable has a relationship with one or more fuzzy sets, each of which has a membership function. Each element within the universe of the linguistic variable is assigned a degree of membership by a membership function, signifying its inclusion in the fuzzy set. The links between linguistic variables and their fuzzy sets are stated by fuzzy linguistic rules, which are frequently written as "if-then" statements. For example,
IF (ammo IS VERY low) AND (health IS high) AND (stamina IS HIGH) THEN (result IS Run)
An antecedent is the "if" portion of a fuzzy linguistic rule. It is made up of one or more language variables together with the fuzzy sets and membership functions that go along with it. The requirements or input values that must be met for the rule to be triggered are specified in the antecedent. The consequent is the "then" component of a fuzzy linguistic rule. It indicates what should happen or be produced in the event that the antecedent's requirements are satisfied. Fuzzy sets and linguistic variables are usually involved in the consequent, which represents the intended result.
5. Defuzzification: A critical stage in translating judgements based on fuzzy logic into practical results is defuzzification. To represent the ultimate output or control action of the system, it extracts a single value from fuzzy sets. Sometimes, it is possible to apply several fuzzy rules at once. In these situations, the outputs of the rules are combined based on the degrees of membership of the rules using aggregation techniques like max-min, max-product, or weighted sum.
a. Centroid Method: This technique determines the combined fuzzy output's centroid, or centre of gravity. The values in the output space are averaged and weighted, with the weights based on the degrees of membership.
b. Bisector Method: This technique determines the point at which the area on one side of the aggregated fuzzy output equals the area on the other. This is interpreted as the clear result.
c. Mean of Maxima (MOM) Method: The crisp output is determined by taking the mean of the maxima values found in the combined fuzzy output.
d. The First of Maximum (FOM) Method: FOM chooses the crisp value by finding the first maximum value in the combined fuzzy output.
III. MULTIPULE EXPERIMENTS
In this paper I have taken different approaches and logic to identify which will be the best for an NPCs to make decision based on the situation for based game.
1) Apply the Base Paper : Here, the NPC's actions are determined by two variables: health and ammunition. Values computed by the fuzzy logic system set the states of actions. The NPC's next course of action is determined by the fuzzy logic system, which also considers health and ammunition levels. This instance employs the triangle membership function and the Mandain approach for the fuzzy logic system. Ammo and health input has five membership sets very low, low, medium, high and very high. For Output action states define membership are hide, run away, stop, walk away, attack. Higher the ammo and higher the health means more on attack and lower the ammo and lower the health more on defend (hide, run away)
Conclusion
After running all the four experiments we are getting better result of decision making for an NPC when the membership function is trapezoidal and defuzzification is Mean of Max if you provide two input variables ammo and health. IF you provide three input variables ammo, health and stamina then the decision making of NPC is improved when the membership function is trapezoidal and defuzzification is Centroid
References
[1] C. Weddle, Artificial intelligence and computer games, Dissertation, Computer Science, Florida State University.
[2] J. Wexler, Artificial intelligence in games: A look at the smarts behind Lionhead Studio’s “Black and White” and where it can and will go in the future, Dissertation, Computer Science, University of Rochester, May 7, 2002.
[3] L.A. Zadeh, Fuzzy sets, Information and Control 8 (1965) 338-353.
[4] H.J. Zimmerman, Fuzzy Set Theory and Its Applications, Allied Publishers Limited, New Delhi, 1996.
[5] R.C. Berkan, S.L. Trubatch, Fuzzy Systems Design Principles, Standart Publishers Distributors, New Delhi,2000.
[6] S.V. Kartalopoulos, Understanding Neural Networks and Fuzzy Logic: Basic Concepts and Applications, Prentice-Hall of India Pvt. Ltd., New Delhi, 2000.
[7] G.J. Klir, B. Yuan, Fuzzy Sets and Fuzzy Logic: Theory and Applications, Prentice-Hall of India Pvt. Ltd., New Delhi, 2000.
[8] C.R. Bector, S. Chandra, Fuzzy Mathematical Programming and Fuzzy Matrix Games, Springer, Berlin, 2004.
[9] P. Mahonen, T. Frantti, Fuzzy classifier for star-galaxy separation, The Astrophysical Journal 541 (2000) 261-263.
[10] N.K. Kasabov, Foundations of Neural Networks, Fuzzy Systems, and Knowledge, The MIT Press, U.S.A., 1998.
[11] A. Majumdar, A. Ghosh, Yarn strength modelling using fuzzy expert system, Journal of Engineered Fibers and Fabrics 3 (2008) 61-68.
[12] S. Kutuva, N.P. Reddy, Y. Xiao, X. Gao, S.I. Hariharan, S. Kulkarni, A novel and fast virtual surgical system using fuzzy logic, in: Proceedings of the IADIS International Conference Computer Graphics and Visualization 2006 May 15-19, 2006, pp. 277-281.
[13] P. Dadone, Design optimization of fuzzy logic systems, Dissertation, Electrical Engineering, Virginia Polytechnic Institute and State University, May 18, 2001.
[14] E.H. Mamdani, Applications of fuzzy algorithms for control of simple dynamic plant, in: Proceedings of the Institution of Electrical Engineers, 1974, pp. 1585-1588.
[15] M. Sugeno, G.T. Kang, Structure identification of fuzzy models, Fuzzy Sets and Systems 28 (1988) 15-33.
[16] Y. Tsukamoto, An approach to fuzzy reasoning method, in: M.M. Gupta, R.K. Ragade, R.R. Yager (Eds.), Advance in Fuzzy Set Theory and Applications, North-Holland Pub. Co., Amsterdam, 1979.
[17] Kose, Utku. \"Developing a fuzzy logic based game system.\" Computer Technology and Application 3.7 (2012).
Make sure to remove all placeholder and explanatory text from the template when you add your own text. This text should not be here in the final version!