Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 463 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
463
Dung lượng
5,49 MB
Nội dung
AIforGameDevelopers All Online Books Table of Contents View as Frames Table of Contents Reviews Examples Reader Reviews Errata Academic http://ebooks.servegame.com/oreaiforgamdev475b (1 of 2)7/23/05 5:36:25 PM AIforGameDevelopersAIforGameDevelopers By David M. Bourg,GlennSeeman Publisher: O'Reilly Pub Date: July 2004 ISBN: 0-596-00555-5 Pages: 400 Written for the novice AI programmer, AIforGameDevelopers introduces you to techniques such as finite state machines, fuzzy logic, neural networks, and many others, in straightforward, easy-to-understand language, supported with code samples throughout the entire book (written in C/C++). From basic techniques such as chasing and evading, pattern movement, and flocking to genetic algorithms, the book presents a mix of deterministic (traditional) and non-deterministic (newer) AI techniques aimed squarely at beginners AI developers. http://ebooks.servegame.com/oreaiforgamdev475b (2 of 2)7/23/05 5:36:25 PM O'Reilly: AIforGameDevelopers All Online Books Table of Contents View as Frames ● AIforGameDevelopers ● Table of Contents ● Copyright ● Preface ❍ Assumptions This Book Makes ❍ About This Book ❍ Conventions Used in This Book ❍ Additional Resources ❍ Using Code Examples ❍ How to Contact Us ❍ Acknowledgments ● Chapter 1. Introduction to GameAI ❍ Section 1.1. Deterministic Versus Nondeterministic AI ❍ Section 1.2. Established GameAI ❍ Section 1.3. The Future of GameAI ● Chapter 2. Chasing and Evading ❍ Section 2.1. Basic Chasing and Evading ❍ Section 2.2. Line-of-Sight Chasing ❍ Section 2.3. Line-of-Sight Chasing in Tiled Environments ❍ Section 2.4. Line-of-Sight Chasing in Continuous Environments ❍ Section 2.5. Intercepting ● Chapter 3. Pattern Movement ❍ Section 3.1. Standard Algorithm ❍ Section 3.2. Pattern Movement in Tiled Environments ❍ Section 3.3. Pattern Movement in Physically Simulated Environments ● Chapter 4. Flocking ❍ Section 4.1. Classic Flocking ❍ Section 4.2. Flocking Example ❍ Section 4.3. Obstacle Avoidance JavaScript Tree Menu http://ebooks.servegame.com/oreaiforgamdev475b/content.htm (1 of 3)7/23/05 5:52:56 PM O'Reilly: AIforGameDevelopers ❍ Section 4.4. Follow the Leader ● Chapter 5. Potential Function-Based Movement ❍ Section 5.1. How Can You Use Potential Functions forGame AI? ❍ Section 5.2. Chasing/Evading ❍ Section 5.3. Obstacle Avoidance ❍ Section 5.4. Swarming ❍ Section 5.5. Optimization Suggestions ● Chapter 6. Basic Pathfinding and Waypoints ❍ Section 6.1. Basic Pathfinding ❍ Section 6.2. Breadcrumb Pathfinding ❍ Section 6.3. Path Following ❍ Section 6.4. Wall Tracing ❍ Section 6.5. Waypoint Navigation ● Chapter 7. A* Pathfinding ❍ Section 7.1. Defining the Search Area ❍ Section 7.2. Starting the Search ❍ Section 7.3. Scoring ❍ Section 7.4. Finding a Dead End ❍ Section 7.5. Terrain Cost ❍ Section 7.6. Influence Mapping ❍ Section 7.7. Further Information ● Chapter 8. Scripted AI and Scripting Engines ❍ Section 8.1. Scripting Techniques ❍ Section 8.2. Scripting Opponent Attributes ❍ Section 8.3. Basic Script Parsing ❍ Section 8.4. Scripting Opponent Behavior ❍ Section 8.5. Scripting Verbal Interaction ❍ Section 8.6. Scripting Events ❍ Section 8.7. Further Information ● Chapter 9. Finite State Machines ❍ Section 9.1. Basic State Machine Model ❍ Section 9.2. Finite State Machine Design ❍ Section 9.3. Ant Example ❍ Section 9.4. Further Information ● Chapter 10. Fuzzy Logic ❍ Section 10.1. How Can You Use Fuzzy Logic in Games? ❍ Section 10.2. Fuzzy Logic Basics ❍ Section 10.3. Control Example http://ebooks.servegame.com/oreaiforgamdev475b/content.htm (2 of 3)7/23/05 5:52:56 PM O'Reilly: AIforGameDevelopers ❍ Section 10.4. Threat Assessment Example ● Chapter 11. Rule-Based AI ❍ Section 11.1. Rule-Based System Basics ❍ Section 11.2. Fighting Game Strike Prediction ❍ Section 11.4. Further Information ● Chapter 12. Basic Probability ❍ Section 12.1. How Do You Use Probability in Games? ❍ Section 12.2. What is Probability? ❍ Section 12.3. Probability Rules ❍ Section 12.4. Conditional Probability ● Chapter 13. Decisions Under UncertaintyBayesian Techniques ❍ Section 13.1. What is a Bayesian Network? ❍ Section 13.2. Trapped? ❍ Section 13.3. Treasure? ❍ Section 13.4. By Air or Land ❍ Section 13.5. Kung Fu Fighting ❍ Section 13.6. Further Information ● Chapter 14. Neural Networks ❍ Section 14.0. ❍ Section 14.1. Dissecting Neural Networks ❍ Section 14.2. Training ❍ Section 14.3. Neural Network Source Code ❍ Section 14.4. Chasing and Evading with Brains ❍ Section 14.5. Further Information ● Chapter 15. Genetic Algorithms ❍ Section 15.1. Evolutionary Process ❍ Section 15.2. Evolving Plant Life ❍ Section 15.3. Genetics in Game Development ❍ Section 15.4. Further Information ● Vector Operations ❍ Vector Class ❍ Magnitude ❍ Vector Functions and Operators ● Colophon http://ebooks.servegame.com/oreaiforgamdev475b/content.htm (3 of 3)7/23/05 5:52:56 PM AIforGameDevelopers All Online Books Table of Contents View as Frames Preface Recent advances in 3D visualization and physics-based simulation technology, at both the software and hardware levels, have enabled gamedevelopers to create compelling, visually immersive gaming environments. The next step in creating even more immersive games is improved artificial intelligence (AI). Advances in computing power, and in hardware-accelerated graphics in particular, are helping to free up more CPU cycles that can be devoted to more sophisticated AI engines for games. Further, the large number of resourcesacademic papers, books, game industry articles, and web sitesdevoted to AI are helping to put advanced AI techniques within the grasp of every game developer, not just those professionals who devote their careers to AI. With that said, wading through volumes of technical papers, text books, and web sites can be a daunting task for upcoming gameAI developers. This book pulls together the information novices need so that they can get a jump-start in the field of gameAI development. We present relevant theory on a wide range of topics, which we support with code samples throughout the book. Many general game development books cover AI to some extent, however their treatment of the technology tends to be limited. This is probably because such books have to cover a lot of different topics and cannot go into great depth on any particular one. Although several very good books do focus on gameAI (we list many of them in the "Additional Resources" section of this Preface), most of them are geared toward experienced AIdevelopers and they focus on relatively specific and advanced topics. Therefore, novices likely would require companion resources that cover some of the more fundamental aspects of gameAI in more detail. Still other books cover some specific gameAI techniques in great detail, but are restricted to covering just those techniques. Our book covers a wide range of gameAI topics at a level appropriate for novice developers. So, if you are new to game programming or if you are an experienced game programmer who needs to get up to speed quickly on AI techniques such as finite state machines, fuzzy logic, and neural networks, among others, this book is for you. http://ebooks.servegame.com/oreaiforgamdev475b/ch00.htm (1 of 2)7/23/05 5:36:31 PM AIforGameDevelopers http://ebooks.servegame.com/oreaiforgamdev475b/ch00.htm (2 of 2)7/23/05 5:36:31 PM AIforGameDevelopers All Online Books Table of Contents View as Frames Assumptions This Book Makes Because this book is targeted for beginner gameAI developers, we don't assume you have any AI background. We do, however, assume you know how to program using C/C++. We also assume you have a working knowledge of the basic vector math used in games, but we have included a brief vector math refresher in the Appendix in case your skills are a little rusty. http://ebooks.servegame.com/oreaiforgamdev475b/fm_sect1_001.htm7/23/05 5:36:39 PM AIforGameDevelopers All Online Books Table of Contents View as Frames About This Book We didn't hope to (nor did we attempt to) cover every aspect of gameAI in this book; far too many techniques and variations of techniques are used for an even larger variety of game types, specific game architectures, and in-game scenarios. Instead, we present a mix of both deterministic (traditional) and nondeterministic (newer) AI techniques aimed squarely at beginner AI developers. Here's a summary of what we cover: Chapter 1, Introduction to GameAI Here, we define gameAI and discuss the current state of the art as well as the future of this technology. Chapter 2, Chasing and Evading We cover basic techniques for chasing and evading as well as more advanced techniques for intercepting. We also cover techniques applicable to both tile-based and continuous game environments. Chapter 3, Pattern Movement Pattern movement techniques are common to many video games and developers have been using them since the early days of gaming. You can use these techniques to preprogram certain behaviors such as the patrolling of a guard or the swooping in of a spacecraft. Chapter 4, Flocking The flocking method we examine in this chapter is an example of an A-life algorithm. In addition to creating cool-looking flocking behavior, A-life algorithms form the basis of more advanced group movement. http://ebooks.servegame.com/oreaiforgamdev475b/fm_sect1_002.htm (1 of 4)7/23/05 5:36:43 PM AIforGameDevelopers Chapter 5, Potential Function Based Movement Potential-based movement is relatively new in gameAI applications. The cool thing about this method is that it can handle chasing, evading, swarming, and collision avoidance simultaneously. Chapter 6, Basic Pathfinding and Waypoints Gamedevelopers use many techniques to find paths in and around game environments. In this chapter, we cover several of these methods, including waypoints. Chapter 7, A* Pathfinding No treatment of pathfinding is complete without addressing the workhorse algorithm of pathfinding; therefore, we devote this whole chapter to the A* algorithm. Chapter 8, Scripted AI and Scripting Engines Programmers today often write scripting engines and hand off the tools to level designers who are responsible for creating the content and defining the AI. In this chapter, we explore some of the techniques developers use to apply a scripting system in their games, and the benefits they receive. Chapter 9, Finite State Machines Finite state machines are the nuts and bolts of game AI. This chapter discusses the fundamentals of finite state machines and how to implement them. Chapter 10, Fuzzy Logic Developers use fuzzy logic in conjunction with or as a replacement for finite state machines. In this chapter, you'll learn the advantages fuzzy techniques offer over traditional logic techniques. Chapter 11, Rule-Based AI Technically, fuzzy logic and finite state machines fall under the general heading of rules-based methods. In this chapter, we cover these methods as well as other variants. Chapter 12, Basic Probability Gamedevelopers commonly use basic probability to make their games less predictable. Such cheap unpredictability enables developers to maintain substantial control over their games. Here, we cover http://ebooks.servegame.com/oreaiforgamdev475b/fm_sect1_002.htm (2 of 4)7/23/05 5:36:43 PM [...]... becoming standard for first-person shooter games This approach will give you the opportunity to try out your AI ideas without having to program all the other non -AI aspects of your game http://ebooks.servegame.com/oreaiforgamdev475b/fm_sect1_002.htm (3 of 4)7/23/05 5:36:43 PM AIforGameDevelopers http://ebooks.servegame.com/oreaiforgamdev475b/fm_sect1_002.htm (4 of 4)7/23/05 5:36:43 PM AIforGame Developers. .. level, thus making the game more immersive, challenging, and, most importantly, fun, can be considered gameAI Just like the use of real physics in games, good AI adds to the immersiveness of the game, drawing players in and suspending their reality for a time [*] [*] Steven Woodcock maintains an excellent Web site devoted to gameAI at http://www.gameai.com http://ebooks.servegame.com/oreaiforgamdev475b/ch01.htm... http://ebooks.servegame.com/oreaiforgamdev475b/ch01.htm (2 of 3)7/23/05 5:37:53 PM AIforGameDevelopers http://ebooks.servegame.com/oreaiforgamdev475b/ch01.htm (3 of 3)7/23/05 5:37:53 PM AIforGameDevelopers All Online Books Table of Contents View as Frames 1.1 Deterministic Versus Nondeterministic AIGameAI techniques generally come in two flavors: deterministic and nondeterministic Deterministic Deterministic behavior or performance is... River Media) AI Techniques forGame Programming by Mat Buckland (Premier Press) Practical Neural Network Recipes in C++ by Timothy Masters (Academic Press) http://ebooks.servegame.com/oreaiforgamdev475b/fm_sect1_004.htm (1 of 2)7/23/05 5:36:49 PM AIforGameDevelopers q q Neural Networks for Pattern Recognition by Christopher Bishop (Oxford University Press) AI Application Programming by M Tim Jones... http://www.oreilly.com http://ebooks.servegame.com/oreaiforgamdev475b/fm_sect1_006.htm (1 of 2)7/23/05 5:36:54 PM AIforGameDevelopers http://ebooks.servegame.com/oreaiforgamdev475b/fm_sect1_006.htm (2 of 2)7/23/05 5:36:54 PM AI for Game Developers All Online Books Table of Contents View as Frames Acknowledgments We'd like to thank our editors, Nathan Torkington and Tatiana Diaz, for their skill, insight,... weekend." We can't forget to thank our respective children, who always remind us that it's OK to play On that note, remember that the most important goal of good AI in games is to make games more fun Play on! http://ebooks.servegame.com/oreaiforgamdev475b/fm_sect1_007.htm7/23/05 5:36:56 PM AI for Game Developers All Online Books Table of Contents View as Frames Chapter 1 Introduction to GameAI In the broadest... to more thoroughly explore nondeterministic techniques We'll come back to this point a little later http://ebooks.servegame.com/oreaiforgamdev475b/ch01_sect1_001.htm (2 of 2)7/23/05 5:37:56 PM AI for Game Developers All Online Books Table of Contents View as Frames 1.2 Established GameAI Perhaps the most widely used AI technique in games is cheating For example, in a war simulation game the computer... compress within these pages everything there is to know about AI in game development Therefore, we've compiled a short list of useful AI web and print resources for you to explore should you decide to pursue gameAI further Here are some popular web sites related to game development and AI that we find helpful: q q q q q q q The GameAI Page at http://www.gameai.com AI Guru at http://www.aiguru.com... prey's y-coordinate The end result is that the predator will move closer and closer to the prey each cycle through the game loop Using this same methodology, we can implement evading by simply reversing the logic, as we illustrate in http://ebooks.servegame.com/oreaiforgamdev475b/ch02_sect1_001.htm (1 of 4)7/23/05 5:38:24 PM AI for Game Developers Example 2-2 Example 2-2 Basic evade algorithm if (preyX... to run from or repel a predator We cover potential functions in Chapter 5 In this chapter we explore several chase and evade methods, starting with the most basic method We also give you example code that implements these methods in the context of tile-based and continuous-movement environments http://ebooks.servegame.com/oreaiforgamdev475b/ch02.htm (2 of 2)7/23/05 5:38:19 PM AI for Game Developers . you. http://ebooks.servegame.com/oreaiforgamdev475b/ch00.htm (1 of 2)7/23/05 5:36:31 PM AI for Game Developers http://ebooks.servegame.com/oreaiforgamdev475b/ch00.htm (2 of 2)7/23/05 5:36:31 PM AI for Game Developers All. http://ebooks.servegame.com/oreaiforgamdev475b/fm_sect1_002.htm (3 of 4)7/23/05 5:36:43 PM AI for Game Developers http://ebooks.servegame.com/oreaiforgamdev475b/fm_sect1_002.htm (4 of 4)7/23/05 5:36:43 PM AI. at: http://www.oreilly.com http://ebooks.servegame.com/oreaiforgamdev475b/fm_sect1_006.htm (1 of 2)7/23/05 5:36:54 PM AI for Game Developers http://ebooks.servegame.com/oreaiforgamdev475b/fm_sect1_006.htm (2