Appendix . Answers to Chapter Review Questions

Most of the review questions have straightforward answers. Others call for opinions, and opinions may vary. The answers given here are one set of opinions.

Chapter 1: What Is Game AI?

1.

What are the three parts to our definition of game AI? The AI has to be able to act, it has to be intelligent, and it has to deal with changing conditions.

2.

Why is game physics not game AI? All choices are forced in physics, so there is no room for intelligence.

Chapter 2: Simple Hard-Coded AI

1.

What are the common drawbacks to hard-coded AI? Hard-coded AI lacks a formal methodology for determining which behavior to employ. Without formal organization, hard-coded AI tends to grow quickly in size and complexity. It can be very difficult to change or maintain.

2.

What are the advantages to hard-coded AI? Hard-coded AI is intuitive and can be fast to write and fast to execute.

3.

Complexity can be as low as the sum of the parts and as high as the product of the parts. What is the relationship between the parts when complexity is the sum? What is it when complexity is the product? When complexity is the sum of the number of parts, the parts are independent. When it is the product, all the parts are interrelated.

4.

What is the design of the data called when the data is information the AI uses to help it think about (or even imagine about) the world? It is called knowledge representation.

5.

Critique the expediencies in the code that interrogates the world in the four-set-point thermostat. Comment on the dangers versus the additional complexity needed to mitigate the risks. In general, the wrapper code knows the internal implementation of the world. It does not ask the world for values; it goes in and finds those values. The world code and the wrapper code are two separate files that must be kept synchronized. If the wrapper asked the world via a function in the world code, the world code could change however it liked as long as it kept the function valid. The function would be in the world-code file. It is easier to keep one file consistent than it is to keep two files synchronized. Internally in the wrapper, the parallel arrays are very handy, but they must be kept synchronized. In addition, the settings are in time-sorted order, and the search for the right setting silently depends on this fact. If the settings were allowed to be changed, the code that stores the new settings would have to sort them. Expediencies should be kept localized; within a routine is fine, within a file is tolerable, and across files is questionable.

6.

Why is the side effect in the code that gets the set-point temperature in the four-set-point thermostat important? The side effect of showing the temperature used helps let us see what the AI is thinking.

Chapter 3: Finite State Machines (FSMs)

1.

Define a finite state machine and tell what each part does. A finite state machine is composed of states and transitions. The transitions are used to change from one state to another. The states are used to define the different things the machine will do.

2.

What are the advantages of a finite state machine compared to hard-coded AI? The formal organization combats complexity by making the states independent. The transitions remain, but they are organized into a regular system. The code is less fragile.

3.

What are some indicators that a finite state machine is inappropriate to use? An FSM has fundamental problems when it needs to be in more than one state at a time. It has problems if the states are not inherently discrete. If the complexity rises past a certain level, other methods may be easier to implement.

4.

What do we mean by ambiguous transitions? When more than one transition is valid, they are ambiguous.

5.

What do we call it when ambiguous transitions exist? What are three ways of dealing with them? When there are ambiguous transitions, we have a race condition. We can ignore them (which is free), we can fully specify the transitions (this is usually a very bad idea), or most likely we will prioritize the transitions.

Chapter 4: Rule-Based Systems

1.

What are the two parts of a rule in a rule-based system? The rules have a matching part and an execution part.

2.

What does the framework do in a rule-based system? The framework presents the current conditions to the rule base, selects a rule (or rules) to execute, and executes it. If more than one rule is to execute, the framework ensures that there are no conflicts between them.

3.

Why is it that a rule-based system can play like both a human and a machine at the same time? The rule-based system plays like a human when it exploits human-sourced behaviors. It plays like a machine in that it never gets tired of picking the same best way to respond to a given situation.

4.

What makes a rule-based AI appear intelligent? What makes it appear stupid? A rule-based system appears intelligent when it comes up with a good or possibly even great response for a situation. It appears stupid when the rules are too sparse and the best response it has is not appropriate for the situation. It also has issues when it lacks good defaults or the ability to recognize when to use them.

Chapter 5: Random and Probabilistic Systems

1.

What are three ways to get odds for a game? You can get odds for a game by precomputing them, by Monte Carlo methods, or by faking them and tuning to suit.

2.

What are the drawbacks to these methods? The first potential drawback to these methods is that they demand good numbers and possibly a large number of them. Furthermore, tuning those numbers is an acquired skill.

Chapter 6: Look-Ahead: The First Step of Planning

1.

What does an evaluation function do? How is it similar to or different from a goal? An evaluation function attempts to comment on how good an indeterminate situation is. The function should correspond in some way to how close the situation is to a goal, but it does not require that the goal be in sight.

2.

What is a heuristic? How do heuristics help? Heuristics are general guidelines. They can help guide the search toward fruitful paths and away from poor ones. They can help evaluate indeterminate situations.

3.

What is pruning and how does it help? Pruning is the act of discarding paths deemed to have low potential for success. It narrows the search space, allowing a deeper look down higher-potential paths.

4.

What is the most common drawback to look-ahead? There is rarely enough processor time to search every promising path.

Chapter 7: Book of Moves

1.

Describe how moves in a book of moves and heuristics are similar and how they are different. Both can guide the AI, but moves tend to be concrete actions posed in game terms, and heuristics can be more abstract and generalized. Moves are about how the game is played, and heuristics tend to be about how the game is evaluated.

2.

How is a book of moves similar to a rule-based AI? How would you decide which label to use on a particular system? The book of moves is a specialized form of a rule-based AI. A system that uses rules for basic AI is probably a rule-based system, particularly if it includes general rules and defaults. An AI that is assisted by a specialized rule base might be said to be using a book of moves.

Chapter 8: Emergent Behavior

1.

List the elements and characteristics of a system that allows and encourages emergent behaviors. Systems that feature independent agents who employ simple behaviors and interact tend to exhibit emergent behaviors.

2.

Describe the effects of feedback and the effects of feedback rates. Feedback is what enables continued interaction. If the rate is too slow, the interaction will fade. If the interaction is too fast, the system may not allow any significant variations to develop.

Chapter 9: Evoking Emotions on the Cheap

1.

Many aspects of a game have an emotional payload. What additional attribute is required to make these aspects part of the overall AI? They have to be changeable in order for the AI to have anything to do.

2.

Describe the critical difference between games and simulations with regard to what they are trying to do with emotions. Simulations attempt to model emotions accurately as a first priority. Games attempt to evoke emotional responses in the players as a first priority.

3.

Some of the techniques in this chapter are subtle. How can the game make sure the player catches on? The most straightforward way is to tell them in some more direct manner.

4.

List some general categories of places where some AI control adds to the ability of the game to deliver emotional content. The AI can help control music, ambient settings (mood), plot, and even the camera itself.

Chapter 10: Topics to Pursue From Here

1.

What are the two concepts in A* that let us perform the best-first search? A* tracks the cost so far and estimates the cost remaining to the goal. It is useful to have an admissible heuristic, but tracking and estimating cost allows the algorithm to be best-first.

2.

What conditions could cause a node to move from the closed list back onto the open list in A*? This can happen when the heuristic is inadmissible and there are branching paths that can rejoin. This never happens if the algorithm is written with the usual optimization to ignore all nodes on the closed list.

3.

When is a machine-learning system easier to implement than a directly programmed system? Machine learning is superior when it is easier to teach the machine than it is to directly program the machine.

4.

What is the major advantage of behavior trees over FSMs? They control complexity better, allowing faster iteration cycles in development.

5.

Why does the search run backward in a GOAP system and forward in an HTN system? In GOAP the number of actions that are close to the goal is typically smaller than the number of actions that are close to the agent. A* is faster when it has fewer branches to explore. HTN task libraries are designed to present goal states to the agents, making a forward search faster.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.205.99