Introduction to game rules
When thinking of a game, we typically direct our thoughts to game mechanics such as the handling of deaths and end game conditions. Based on what we've learned in the previous chapters, we can't really accomplish this due to every entity and actor not affecting a grander scheme.
Game rules do exactly what the name implies; control the rules of the game. A rule can be simple, like a rule for what happens when one actor shoots the other, or more complex, for example, start and end rounds.
The CryENGINE game rules implementation revolves around two very similar sounding types that are still quite different:
- Game rules: This implementation is done via the
IGameRules
interface in C++, and it handles callbacks such asOnClientConnect
andOnClientDisconnect
. - Game mode: This is reliant on the game rules implementation, but extends it with game conditions such as actor spawning and kill conditions. For example, we could have two game modes; SinglePlayer and DeathMatch...