Game Design and Predicate Logic

Logic is perfect for describing games, because logic is the language of systems. For example, the development of mathematical proofs involves proving implications, where a mathematical element is often assumed to have a property. From such properties, one uncovers properties about that element or a related element. Predicate logic in particular is perfect for describing games, because predicate logic is built around evaluating properties of elements and explaining how the properties of elements reveal further facts about the state of the game.

The great thing about logic is that it can be tailored to suit any required need. I will propose here some basics of applied predicate logic for games. Let’s take chess. First, for predicate logic, we need some placeholders, which will essentially be our elements. The only thing we require for these elements is that they successfully distinguish themselves, which we shall soon observe. Second, we need a function that can evaluate properties of elements. Let us take P(x) to mean the question, “Is x a pawn?”. If we decide that we wanted to describe a game a chess by using x to label one of the pawns, then the answer to the question is that x is in fact a pawn, which we would indicate as P(x)=T. Of course, we could create analogous functions for the knight, bishop, rook, king, and queen; let us use N(?), B(?), R(?), K(?), and Q(?), where ? indicates that we haven’t put anything in the function yet.  Finally, our game of chess requires rules, which are logical statements. Let us suppose that we have eight white pawns that we wish to label with numbers 1 through 8, where each of the pawns has one of the eight different starting positions. We could evaluate location using the chess grid system and make a function, L(?,(?)), where the first input uses an element label, and the second ? is the location value. For example, in chess, there is a pawn on A2 at the beginning of the game. Let us make this pawn 1, so L(1,(A2))=T.

Now, at this point, you might be wondering what the point of using predicate logic is, since it merely looks like another way of expressing rules that we communicate well enough in normal speech. Predicate logic has this advantage, that it introduces a new perspective to speaking about a game that makes analyzing it or creating an extension much easier. For one, it brings the elements, the rules, and the properties to the forefront. For example, one could imagine a function that checks for whether a piece is movable on a given turn Mv(piece, turn #). In general, one would expect white pieces to move on odd turns, (W(x)->Mv(x, odd #))=T, and black pieces to move on even turns, but what if white moved two turns, then black moved two turns? We can imagine infinitely many structures given the way we’ve defined Mv; we only have to assign the rules to white and black.

It is easy to arbitrarily change logical systems, and then it’s interesting to try to imagine what sort of game would result. For example, the chess position function has two inputs for coordinates, which can be arbitrarily expanded to as many dimensions as possible. Another assumption in chess is that a piece only takes up one space at a time; what if pieces could take up multiple spaces at once? Whatever properties that we develop functions for, we can imagine an extension or a reduction, like reducing the dimension of chess to a line. For chess, the applications may not seem as impressive, but it is a basic example. For more complicated games, these principles can be applied to radically transform genres. For example, Kirby Kid has a criticism of RPGs where the strategy reduces to boring sequences of the same actions. Let us consider what dimensions there are to RPGs. There are counts of experience points, money, and ability scores and skill points and vectors of action options. The problem with RPGs is that these dimensions are discrete and many of them only evolve after combat or in response to an action taken in a turn. What if these values evolved during combat itself? Imagine gaining experience during combat itself which gives more advantage against an opponent. Imagine if the trajectory of 3 abilities was represented in real time in three-dimensional space, so that combat evolved around shifting the ability-focus of a character or a party. These ideas were more readily apparent merely by considering that things like abilities or experience are just a number in a game like many other properties, and they can be represented in space and time as a location or color or as any other sensory input. By viewing a game in terms of itself, it’s easy to overlook components of the game that are uninspiring in themselves, but when properties are equal in the sense that they are equal in having functions, new opportunities for game design unfold.

Next up is the concept of level design, where modal logic is finally incorporated.