Fuzzy Logic in Agent-Based Game Design Yifan Li, Petr Musilek and Loren Wyard-Scott Department of Electrical and Computer Engineering University of Alberta Edmonton, AB T6G 2V4, Canada yifan, musilek, [email protected] Abstract – The underlying artificial intelligence of computer classical rule-based systems often fail to attain subtlety, fuzzy games is constantly in need of improvement to meet the ever- rule-based systems allow the nuances among inputs to be increasing demands of game players. This paper discusses how captured and further reflected in the decisions at relatively low intelligent agents and fuzzy logic can help increase the quality computational cost. Compared to some other intelligent and amount of a computer game’s most important element: techniques, fuzzy rule-based systems are easy to design and interaction. The applications of fuzzy logic in behavior design are illustrated in detail through implementation of an arcade-style implement as well – they are very similar to the crisp rule- game. based systems, differing only in the approach used to partition the input space. As a natural extension of classical set logic, Keywords – Agent, BDI, Fuzzy Control, Combs, Game fuzzy logic is playing an increasingly important role in games. I. INTRODUCTION This paper provides an anatomy of how agent technology, incorporated with fuzzy logic, can be applied to game design. What is a computer game? In his influential book, The A brief introduction to the Belief-Desire-Intention (BDI) Art of Computer Game Design [1], Crawford identifies four agent theory and an overview of the BDI.net agent framework fundamental elements of computer games: representation, is provided in Section II. Section III closely examines interaction, conflict, and safety. A Game presents a virtual BattleCity.net, a re-implementation of an old arcade game. reality in which players enjoy interacting with the virtual Section IV outlines the extended framework and describes beings and taking challenges presented by the environment how fuzzy rule-based computing can be used to improve the without facing any physical risk. Of the four elements, perceived quality of computer games. Finally, Section V interaction is considered the most important. The advent of summarizes the conclusions and indicates the direction of computers has brought forward an unprecedented interactive future work. capability, making computer games truly different from conventional games. II. BACKGROUND Intelligent agents [2] and fuzzy logic [3] are two techniques that can help increase the quality of interaction in A. Software Agents games. Agents provide a new architecture of game design that leads to more flexible interaction, and fuzzy control affords a An agent theory defines the internals of agents. Among practical method for generating subtle behavior. the many theories surveyed in [2], the BDI model [4][5][6] is the most popular and influential. As defined in [2], an agent is an autonomous software entity that has its own goals, sensory inputs, reasoning, During the past decade, the BDI model has been well- reaction, and social ties. In the agent-oriented approach to studied and formalizations have been developed [7][8]. The game design, the game creatures are modeled as purposeful strong theoretical basis is supplemented by a number of ‘living’ entities. This approach bears multiple benefits: 1) the successful industrial applications ranging from early NASA distributed nature of the architecture facilitates the creation of projects [9] to more recent air-traffic management [10] and air complex system behaviors; 2) agents interact with each other combat simulation [11]. through high-level communication languages instead of rigid The BDI model is rooted in the philosophical work of low-level interfaces, making it simpler to manage large Bratman [12], which studies intention and its relation to other number of interactive behaviors; and, 3) when immersed in mental attitudes. As its name implies, BDI features three the virtual environment, players tend to perceive the virtual major mental attitudes as its building blocks - belief, desire, creatures as intelligent individuals; modeling them as such and intention: from the beginning helps to meet that expectation during later development stages. • Belief is the agent’s knowledge about its environment and itself. In the domain of games, fuzzy control is not just another • Desire describes the agent’s goal: a system state that the control method: it is a quality behavior generator. Creatures agent wants to achieve. with subtle behaviors enhance the perceived complexity, • Intention is the course of action that the agent has chosen enjoyableness and credibility of a virtual environment. While to achieve that goal. 0-7803-8376-1/04/$20.00 Copyright 2004 IEEE. Plan is another important element of the BDI model. A actually carried out. During execution, one plan may plan is a recipe of action for achieving a certain goal and is occasionally need to achieve a certain sub-goal that is beyond used to guide the deliberation process of the agents so they its capabilities to obtain. In such scenarios, the plan can need not search through the entire space of possible solutions stimulate a new desire which the agent will try to fulfill in a [13]. fashion similar to that described earlier. For the originating plan, the call is synchronous – it waits until the sub-goal is B. BDI.net achieved or believed unobtainable before devising further actions. BDI.net [14] is a Microsoft Visual C# [15] implementation of the AgentSpeak [16] BDI model. It is Communication is of paramount importance in any designed to be a lightweight framework for easy BDI serious agent application: without communication, it is almost implementation by casual programmers. This design impossible to exercise control over a multi-agent system, let philosophy leads to some favorable characteristics in alone collaborative problem-solving. Agent Communication comparison to the other existing BDI implementations, such Language (ACL) [21], along with content language and as UM-PRS [17], JACK [18], JAM [19], dMARS [7], and ontology specifications, is an enabling technology of agent ZEUS [20]. In particular, BDI.net offers the following communication. BDI.net implements the Foundation for advantages: Intelligent Physical Agents (FIPA) [22] agent communication language standards for message encoding, semantics and • Mainstream support and portability: BDI.net is written pragmatics. FIPA ACL is chosen over the equally popular using a popular programming language and work Knowledge Query and Manipulation Language (KQML) [23] seamlessly with all programming languages that support due to its formal semantics, support for XML (which is the .NET framework; relatively easy to parse), and other benefits such as • Better alignment with standard programming knowledge: specifications of interaction protocols. models can be described using common programming syntax rather than specialized symbolic logic; C. Fuzzy Rule-based Systems • Testability: BDI.net is designed with testability in mind, providing special facilities and considerations to aid the Fuzzy rule-based computing is the most widely used form debugging process; of fuzzy logic. A fuzzy rule-based systems is generally • Explicit communication support: facilities for agent composed of four components: 1) the fuzzifier converts the communication are built-in; and crisp inputs into fuzzy sets; 2) the rule base holds the relations • Tool library: apart from basic infrastructure, the between the inputs and the desired output, expressed as a framework implements many intelligent algorithms collection of IF-THEN rules; 3) the reasoning unit applies the (including fuzzy inference) ready for use by the inputs to the rules; 4) the defuzzifier converts the result of application programmers. reasoning back to crisp output values. A BDI.net agent operates through iterations of its In the case of multiple inputs, the antecedents of a fuzzy execution cycle as depicted in Fig. 1. rule are usually connected with the logical AND connective, Plan Instance Perceive and the rule base should cover every possible combination of A1 Intention Stack Create Intention Stack all linguistic terms defined on each input variable. This The best of the applicable Desires aroused plans is selected and Plan Instance A1 requirement of completeness leads to a combinatorial instantiated explosion of the rules: for a system of n inputs with m terms Add Intention Stack to Intention Library Applicable Plans n Desire A each, a total of m rules are needed. Combinatorial rule Plan A1 Intention explosion poses a severe problem for applying fuzzy control Plan A2 Library Select the best in game design as it complicates the design process and taxes intention for execution Find plan recipes that precious CPU resources. match the desire The matching plans are called Applicable Plans Execute the Combs has proposed the Union Rule Configuration (URC) Plan Recipe plan on Plan Instance X11 top of the [24][25] to alleviate the rule explosion problem. A typical Library Plan Instance X1 stack URC is expressed as follows: Fig. 1 BDI.net main execution cycle IF X1 IS A11 THEN Y IS B1 At the beginning of each cycle, the agent senses its OR IF X1 IS A12 THEN Y IS B2 environment and updates its belief. Consequently, desires may OR IF X IS A THEN Y IS B (1) arouse in response to the newly received stimulations. The 2 21 2 agent then matches its stock plans against the desires to find OR … out the best applicable plan for each desire (based on the OR IF Xi IS Aij THEN Y IS Bk plans’ fitness values) and initiates new intentions of execution. Where X denotes the input variables, Y denotes the Upon the end of the cycle, the intention that serves the most i output variable, and A and B denote the linguistic terms urgent desire is chosen from the intention library to be ij k defined on the fuzzy variables. Instead of presenting the relationship between the connected antecedents and the The first step is to decompose the system properly and consequent, the URC relates each input variable directly to the identify the agents.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages6 Page
-
File Size-