The most complicated equations behind many games are the equations which govern the computer AI. For many types of games such as strategy games, there is an evaluation function, which takes an arbitrary game state and outputs a numerical value which is supposed to measure how advantageous that game state is for the computer player. For the AI to determine its move, the computer considers several actions allowable in the game world, and applies the evaluation function to the several new game states. Whichever state has the best value is the move the computer should take.

Things get quite complicated when the computer decides that it should look several moves ahead and determine what the best game state will be no matter what actions opponents take.

For example, in chess, a simple evaluation function for a board state might be to sum the value of all the white pieces (where say a pawn is 1, knight is 3, etc.) subtract the value of all the black pieces, add some number if the black king is in check, subtract some number if the white king is in check, add some number for how much control white has of squares near the center of the board, subtract some number for how much control black has of squares near the center of the board, add some number for how well-protected white pieces are, subtract some number for how well-protected black pieces are, add infinity if black is in checkmate, and subtract infinity if white is in checkmate. The very best chess algorithms have extremely complicated evaluation functions and algorithms to decide which move to make.

Similarly, you can make an AI for basically any strategy game by using the same kind of method. Determine an evaluation function, then find the maximum value of the evaluation function after several hypothetical turns where the opponent makes the moves which minimize the evaluation function. How good the AI is depends on how well your evaluation function mimics the "important" aspects of good strategy and how many turns can be forecast subject to available computing power. For a perfect AI, the evaluation function will return a higher value for one game state than for another if and only if the computer is more likely to win from the first game state than from the latter. In reality, games are usually far too complicated to develop such an evaluation function.

These types of functions will be vastly more complicated than any simple function which computes a statistic in some RPG game or something.

View 3 other answers to this question
About · Careers · Privacy · Terms · Contact · Languages · Your Ad Choices · Press ·
© Quora, Inc. 2025