You are previewing AI and Artificial Life in Video Games.
O'Reilly logo
AI and Artificial Life in Video Games

Book Description

Learn how to create more challenging and dynamic games with AI and Artificial Life in Video Games. AI, or artificial intelligence, builds better games by directing behaviors inside the games that make them more difficult, while artificial life, or A-Life, adds unpredictability of play and a more lifelike environment to games. This book examines easy and inexpensive methods for implementing AI and A-Life in any video game to not only model behavior in the game but also create tools, generate code, and test the game during development. After introducing the basics of AI and A-Life to use as building blocks, the book delves into more advanced methods and examines possible future uses and techniques. You'll learn how AI can be built up in a game by layering behavioral models on static data to produce behavior that is both intelligent and unpredictable. Examples of several A-Life enhancements in games are presented, and you'll investigate the potential pitfalls of using AI and how to troubleshoot, apply A-Life to your own games, test A-Life itself and test virtually using A-Life, implement AI and A-Life in a multiplayer environment, and more. Written for the current and next-generation game developer, AI and Artificial Life in Video Games is a great reference for both game programmers and game designers.

Table of Contents

  1. Copyright
    1. Dedication
  2. Acknowledgments
  3. About the Author
  4. Preface
  5. 1. Introduction
    1. Defining Artificial Intelligence
      1. Artificial Intelligence as a Reasoning System
      2. Appearance versus Actual Intelligence
    2. Knowledge Management
      1. Information Feedback
    3. AI Put Simply
    4. Defining Artificial Life
      1. Modeling Through Observation
      2. Calculated A-Life
      3. Synthesized A-Life
      4. Granularity
    5. Top-Down Versus Bottom-Up Intelligence
    6. Summary
  6. 2. Using Artificial Intelligence in Video Games
    1. AI in Video Games
      1. Movement AI
      2. Planning AI
      3. Interaction AI
      4. Environmental AI
      5. Common AI Paradigms
        1. Simple Statistical Analysis
        2. Finite State Machines
        3. Alpha-Beta Pruning
        4. A*
        5. Neural Networks
        6. Expert System
        7. Fuzzy Logic
        8. Hopfield Nets
    2. Applying the Theories
      1. Motor-Racing AI
        1. Examples
      2. Action Combat AI
        1. Examples
      3. Fighting AI
        1. Examples
      4. Puzzle AI
      5. Adventure and Exploration AI
        1. Planning and Mapping AI
        2. Behavioral AI
        3. Environmental AI
        4. Interaction AI
        5. Examples
      6. Strategy AI
        1. Information and Game Rules
        2. Examples
      7. Simulation AI
        1. Information and Game Rules
        2. Problems and Challenges
    3. Summary
      1. Balancing the AI
      2. AI and A-Life in Video Games
    4. References
  7. 3. Uses for Artificial Life in Video Games
    1. Modeling Natural Behavior
      1. Adaptability
        1. Adaptability with Genetic Algorithms and Genetic Programming
        2. Adaptability with Traditional AI Models
        3. Adaptability and Quality Assurance
        4. Notes on Performance
    2. AI Techniques in A-Life
      1. A-Life for Simulation
    3. Using A-Life in Video Game Development
    4. A-Life in the Design Phase
    5. A-Life in the Development Phase
      1. Scripting Language
      2. Modifying Scripts Using A-Life
      3. Building Scripts Using A-Life Techniques
      4. A-Life Outside of Scripting
    6. A-Life in Video Game Testing
      1. A-Life in the Testing Phase
      2. Test Coverage
      3. Implementing the Interface
    7. Post-Development A-Life
    8. Summary
      1. Examples
    9. References
  8. 4. The A-Life Programming Paradigm
    1. A-Life: The Game within the Game
      1. Scripting Interfaces
      2. Categories
      3. Behavioral Modification
        1. Avatars, Agents, and Autonomy
        2. System Behavior
        3. Feedback from the System, User, and Other Entities
    2. Evolving Behavior
      1. The Role of Genetic Algorithms
        1. Recombination
        2. Mutation
      2. Propagating Behavior
        1. Scoring and Propagating Behavior
        2. Group Dynamics
      3. Emergent Behavior
        1. Which Comes First—the Game or A-Life?
        2. Design Time
        3. Run Time
    3. Planning the A-Life Implementation
      1. Design Time Considerations
        1. Achievable Goals
      2. Development Considerations
      3. Emerging Technology
      4. Testing with A-Life
    4. Summary
  9. 5. Building Blocks
    1. AI and A-Life Building Blocks
      1. Learning Defined
        1. Weighted Historical Reasoning
      2. Finite State Machines
        1. Fuzzy Finite State Machines
      3. Building a Neural Network
        1. Neurons
        2. Feedback and Training
        3. The Network
        4. Training the MLP
        5. Recall
        6. Prediction and the Hopfield Net
      4. Expert Systems
      5. Building Blocks Review
    2. Deploying the Building Blocks
      1. In-Game Representation
      2. Templated Behavior
      3. Behavior Management and Modeling
        1. Behavior Management
        2. Behavior Modeling
    3. Ground-Up Deployment
      1. First-Order Generation
      2. Environmental Modeling
      3. A-Life Simulations
    4. Summary
  10. 6. The Power of Emergent Behavior
    1. Defining Emergent Behavior
      1. Types of Emergent Behavior
      2. Emergent Behavior Design
    2. The “Sum of Parts” Emergence Design
      1. Stimuli
      2. Movement
      3. Biochemistry
      4. Thinking
      5. Reproduction
    3. The Individual Dynamic Emergence Design
      1. The FSM Network
        1. The Neural Network
      2. The Individual as a System
    4. The Group Dynamic Emergence Design
    5. The Reproductive Mechanism in Emergence
      1. Reproductive Models
    6. Summary
      1. Controlling Emergence
    7. References
  11. 7. Testing with Artificial Life
    1. Testing A-Life
      1. Testing with A-Life
      2. Caveats
    2. Bottom-Up Testing
      1. Rule Testing
      2. Engine Testing
      3. Pseudorandom Testing
    3. Testing AI with A-Life
      1. Knowing the Boundaries
      2. Mapping the Behavior
      3. Identifying What to Test
    4. Testing A-Life with A-Life
      1. Learning by Example
      2. Adaptive A-Life
    5. Summary
    6. References
  12. 8. Several A-Life Examples
    1. Movement and Interaction
      1. Flocking
        1. Movement Calculations
        2. Separation
        3. Alignment
        4. Cohesion
        5. Combination
        6. Static versus Moving Flock Targets
        7. Using GA to Modify Basic Algorithms
      2. Follow the Leader
        1. Changing the Leader
        2. Multiple Leaders
        3. The Player as the Leader
      3. Squad Play
    2. A-Life Control Systems
      1. First Principles
        1. Difficulty Balancing and Variation
      2. Implementing A-Life Control Systems
        1. Vehicle Racing Games
          1. Player Control
          2. Observed Behavior
        2. Soccer Simulations
          1. The Soccer Player’s Control
          2. Soccer Observed Behavior
        3. First-Person-Shooters
          1. FPS Player’s Control
          2. FPS Observed Behavior
        4. Role-Playing Games
          1. RPG Player’s Control
          2. Observed Behavior in RPGs
    3. A-Life in Puzzles, Board Games, Simulations
      1. Battleships
        1. The Game Rules
        2. The AI Engine
        3. The GA Approach
          1. Using GA in the Unit-Placement Phase
          2. Using GA in the Unit Location and Destruction Phases
        4. The GP Approach
          1. Using GP in the Unit-Location and Destruction Phases
        5. Mixing GA and GP
        6. Beyond Battleships
    4. Video Game Personalities
      1. Animation and Appearance
        1. Deviations from the Average Face
      2. Examples of A-Life in the Gaming Environment
        1. Graphics and Scenery
        2. Interaction through Conversation
          1. Creating Prose
          2. Reacting to the Player
    5. Summary
    6. References
  13. 9. Multiplayer AI and A-Life
    1. Managing Emergence
      1. Emergence versus A-Life
        1. NPC Emergence
        2. Rule-Based Emergence
    2. Enhancing the Experience
      1. The Purpose of AI and A-Life in Multiplayer Games
      2. Behavioral Cloning
      3. Preventing Cheating
        1. Self-Policing
    3. Implementing A-Life in Multiplayer Environments
      1. Population Control
        1. Managing the Population
      2. Strict Rule-Based Behavior
      3. Flexible Rule-Based Behavior
      4. Scripted Behavior
    4. Summary
    5. References
  14. 10. The Application of A-Life Outside the Lab
    1. Simple Genetic Algorithms
      1. Starting Out
        1. Decision Networks
        2. Markov Chains
        3. Behavioral Markov Chains
      2. Animation and Appearance
        1. Animation
        2. Appearance
      3. Applying Genetic Algorithms
        1. Basic Application
        2. Advanced Applications
    2. Breeding Behavioral Patterns
      1. State-Based Genetic Crossover
        1. Trigger Retention
        2. The Purpose of Crossover
        3. Survival of the Fittest
        4. Genetic Rewriting
        5. Applying GA to GA
    3. Datasets Versus Functionality
      1. Datasets
      2. Functionality
    4. Summary
    5. References