AI As A Game Mechanic - In GameDeveloper the biggest mistake beginning AI programmers are said to make are to not consider the gameplay ramifications of AI. It is tempting to just try to make the best possible AI, but this is not necesarrily fun. Better to think of AI as like being the DM. - What ends up making a 1P game fun? - Progressing further by solving puzzles or beating the computer - A sense of getting better - Satisfaction by feeling you beat the computer fairly - AI as taught does not focus on fun, it focuses on perfection - pathfinding finds the optimal path - alpha / beta search find the best move - etc. - This can get frustrating really fast, because the computer will almost always win. - It can have perfect aim in a FPS, make the optimal move in a TBS! - The solution? Artificial Stupidity! Make the computer intentionally stupid! - In an FPS you could pick bad cover or miss when shooting - In a TBS you could attack the wrong guy or use a bad spell - In a platformer you could walk to a less optimal position - To implement Artificial Stupidity, it is important to first start with a really good AI. Then, you can do one of the following: - Mess up its sensory data - Manipulate its valuation (in Chess, this would be like making a knight worth as much as the queen) - Drunken AI -- Mess up its desired action - Choose a known bad behavior - One way to implement: each critter has an intelligence value from 0 - 1. When you would mess up data, you mess it up by the intelligence value - Dynamically Adjusting Difficulty - High level concept -- Adjust the artificial stupidity based on how well the player is doing, so the player never feels overly defeated. - Also, keep the game exciting so the player feels like he can always win. - Can also cheat and give the AI better items, more powerful weapons if the player is doing really well. - But watch out for the "Mario Kart" effect. The player shouldn't be penalized in super obvious ways for doing really well. - I like for each critter to have an intelligence range that it will execute in depending on how well the player is doing - That way there still can end up being controllable "easy" and hard sections - Sensory Perception in Games -- Should you cheat? - Very much a hotly debated topic. Purists would like for AI to be limited to nearly the same senses a player has. - "Scripters" would like for it to have a flow that is designer controlled. - The important thing here is to realize that you CAN cheat, since you are the game. Cheating can be a good way to make your AI seem smarter. - Give better items/health - Make game mechanics happen in ways that favor the AI - weights randomness slightly to favor the AI