Game Mechanics — Interaction Loop and the Game State

Stanislav Stankovic
13 min readDec 16, 2024

--

This text is a part of an ongoing series on game mechanics which have spawned as a result of a course I am giving at the Faculty of Dramatic Arts at the University of Belgrade.

I fell in love with video games back when I was about five. Before that, my days were full of sitting in front of the TV and waiting for the cartoons to come up on one of the two terrestrial channels that we had. Yes, I am that old. The first moment I laid my hands on a game controller something magical happened. Wow, this was just like a cartoon except I could make the main character move and do things. I, myself was in control of what happens on the screen. It was love at first sight. This in essence is the magic of games. Our ability to interact with this virtual world. Back in the day, this was groundbreaking. Nothing that came before could parallel this ability. Movies, TV, etc. all require us to be passive observers. Video games give the control to us.

This text examines the essential parts of this interaction. It dissects in detail the loop we have come to take for granted. We will talk on a conceptual level, about what takes place during this process and discuss some very important notions.

Interaction Loop

By definition video games are interactive. Interactivity, i.e. the ability of the human subject, the user/player, to influence the setting of the game and the flow of the narrative is what sets games apart from other media, movies, TV shows, or books for example.

This interaction happens through an interaction loop. This loop consists of several distinct parts. First of all, there is the human subject, the person engaging with the game, i.e. the player. Second, we have the game itself, and the computer system that runs it. It is a combination of hardware and dedicated software. There is a constant flow of information between these two. The player observes the current state of the game. The player makes decisions about which goals to pursue and how and issues certain commands. These commands are conveyed to the game system via input devices, such as a game controller, keyboard, mouse, etc. The state of the game is changed according to this input and the information about the new state of the game is conveyed back to the player via output devices, i.e. computer screen, speakers, VR goggles, headphones, etc.

For example, the player is playing a shooter game. The player observes the opponent approaching. The player moves the weapon, aims, and shoots. These commands are issued via the keyboard and the mouse. The opponent is hit and dies. The game state is updated and new visuals are shown to the player.

At the very core, all games are essentially this loop. This loop is typically executed several times per second, i.e. once per each frame of video generated by the game. It is evident in the execution order of a typical game engine, such as Unity.

A symplified interaction loop of a video game.

The actual situation is actually a bit more murky. Logically a game is usually several similar interaction loops of various time scales overlapped with each other.

The types of interaction and input

From the player’s perspective, this interaction can manifest itself as real-time or turn-based. The key difference between these two modes of interaction is that in real-time mode the game system expects possible explicit input from the player at any moment, i.e. at any frame. In turn-based interaction control over the game is given to the player only at specific moments, i.e. when it is the player’s turn to play.

The input that the player makes can be, explicit and implicit. The explicit inputs are the commands that the player issues consciously. For example, I press the right button and the character on the screen moves right. This is pretty obvious. The implicit input is a bit less intuitive. These are the commands that the player issues unintentionally. For example, a character stepping into a certain area might trigger the spawning of an enemy, or stepping on a specific object might trigger a trap. The game system reacts, i.e. game state changes based on the player’s actions even if they were not intentional.

Game State

Anything in the game that can be changed or modified by the player constitutes the state of the game. This includes:

  • The state of the world.
  • The state of the player.
  • The state of the other characters in the game.

The state of the game is described by attributes that are associated with these basic elements. These are in most cases numerical values associated with either the world, the player, or the other characters. For example, a numerical value indicating the health of the player’s avatar is one such attribute. The speed of the bullet of a weapon is also one such attribute. The position of an NPC in the game world is also one such attribute.

These attributes can be presented to the player in various forms. Most often this is done in visual form, via computer-generated graphics, i.e. the speed by which the blast particles move indicates the speed and the direction of the projectile. Sometimes, this is done in numerical and textual form, e.g. score number in the top left of the screen or Game Over text appearing in the middle of the screen telling us that we have died in the game.

State of The World

The state of the world includes attributes describing the environment in which the game unfolds. These attributes include anything that can be controlled by code, i.e. anything quantifiable. This includes physical and temporal parameters describing the world as well as the state of various interactive elements within the game.

This can include the topology of the world, and the state of active, i.e. dynamic elements within the game world. The nature of these attributes depends greatly on the genre of the game.

In 3D first or third-person shooters or action games, this includes the scenery, the boundaries of the areas, and the basic parameters of physics of the game such as gravity and inertia. In more realistic games this can also include the time of the day or the weather parameters, etc. The state of the world also includes the state of unlockable areas, various doors, gates, environmental traps, etc.

The attributes that control the flow of the narrative in story-driven games also fall into this category.

In most games, but not always, the player can’t change directly and explicitly these attributes. However, the players’s actions within the game can result in the change of these parameters. Whenever a player activates a trap or unlocks a new area this implicitly changes the state of the game world.

In games such as city simulation games or strategy games, the state of the world will include also the attributes that the player can influence directly, such as the placement of various buildings and other structures, such as defensive towers, walls etc. Open-world sandbox games offer a curious example of this. In Minecraft for example the player can have direct control of almost every aspect of the state of the world including the placement of each building block.

A beautiful house created in Minecraft.

Keep in mind that we are talking here about the game world in a very abstract sense. The state of the world exists even in the games which do not try to represent the physical world. In a match-3 or a merge game, the state of the world would be the current state of the gameboard on which the game unfolds, i.e. the placement of the tiles.

Active and Passive Elements

The game world consists typically of a number of various elements. These elements can be visualized, as parts of the scenery, usable items, weapons, other characters, etc. For example, a level in Angry Birds consists of a slingshot, the selection of birds that serve as projectiles, the piggy castle constructed out of wooden, ice, or stone blocks, piggies, TNT boxes, and background scenery.

All these elements can roughly be divided in two big categories, active and passive elements. Active elements are the elements which state the player can somehow influence. Player can interact with those elements. These interactions can be either direct or indirect.

For example, player can interact directly with the slingshot. Player can interact indirectly with blocks of the piggy castle by hurling birds at it. Note that the player cannot interact with the scenery of the level in any way. These elements are the passive elements of the game.

The way how the player interacts with various active elements of the game is defined by the rules of the game. In other words, the role of the game designer is to specify the method of interaction between the player and the active elements of the game.

Role of Graphics

The interesting thing is the role that computer graphics plays in this interaction loop. Above all the graphics need to make active elements clearly recognizable. It needs to make an immediate distinction between the active elements of the game and the passive or inactive elements of the game. In the Angry Birds level passive elements of the scenery are represented with less saturated colors compared to active elements. This makes the objects that players can interact with easily identifiable.

A typical Angry Birds classic level. Active elements are easily distingueshed by outlines and saturated colors.

The second role that the graphics play is to provide visual feedback about the change in the game state that is the results of the player’s actions. The blocks of the piggy castle fly off and tumble down under the influence of the impact of the projectile bird and the gravity of the world. This feedback needs to be timely and appropriate. In real-time games, the feedback needs to follow the expected timescale of the real world.

The result of player actions are clearly observable. Objects follow expected physical behavior.

Finally, the graphics need to represent the resulting change in the state of the game in an unambiguous way. For example, if the hit by the projectile had caused any damage to a block this needs to be indicated in the graphics, i.e. cracks start to show.

Cracks in the objects appear to indicate partail damage.

Typically, the games need to conform to our mental model of the real world. We expect to observe in games the behavior we tend to see in the real world. Gravity generally points downward. Bright colors and sharp edges indicate danger, etc. This mimicry of real-world behavior is known as skeuomorphic behavior.

It is surprising how often game graphics fail in one of these three purposes. Typical mistakes are the overcrowded screens in which the distinction between passive and active elements cannot be observed.

State of The Player

The state of the player includes all the quantifiable attributes that can be associated with the player's avatar in the game.

In the most simple example, this typically includes the player’s position within the game world. This can be the position of the player, i.e. geometric coordinates in games in which the player is represented as an avatar. This is the case even in games as simple as Pac-Man. The position of the hungry yellow dot is the state of the player. In other games, this can be the number of the current level that the player is playing. For example in games such as Candy Crush Saga, etc.

In addition to this, this can include other attributes such as remaining lives, stamina, energy, etc. It can also include all the other items that the player’s character possesses at a given moment in the game. In other words, this includes the player’s inventory, its contents, and its size.

Depending on the type of the game, it can include other gameplay elements, such as various weapons, associated ammo, and elements of the gear.

If the game includes a character upgrading system, the character level also represents a constituent element of the state of the player. The state of the player can be very simple, again recall PacMan, or very complex. Even in simple gam,e this can be deceptive. The state of the player in the original Super Mario Bros already includes quite many elements: the current position of Mario within the level, the current level and the current world, the furthest unlocked world, and the level (as these are not the same as the current one), is Mario, currently Super Mario or ordinary Mario, does Mario have the Fire Flower, the number of coins collected, the number of remaining lives, times elapsed from the start of the level etc. etc. etc.

The state of the player reaches almost absurd proportions in certain genres such as RPG games, in which not only the character itself but the various items of character gear and weapons can be upgraded independently.

Stats, stats, and more stats in Witcher III.

In addition, the state of the player includes attributes that transcend a single gameplay session. This is typically displayed in the player profile such as various badges and achievements.

The state of the player includes also the customizable elements of the player’s avatar. If the game supports such a system it includes various skins, interchangeable elements of clothing, such as hats, shirts pants, various other accessories, or even the parts of the anatomy of the anatomy, from proportions of the body to skin tone, shape of the facial features, hair styling etc.

State of The Other Characters

Finally, some games might include characters not controlled by the player. This can include hostile enemies and other non-hostile or supporting non-playable characters (NPCs).

The state of these characters mimics many aspects of the state of the player. It will definitely include the current position of these characters in reference to the world and to the current position of the player. The behavior of these characters is typically controlled by the state machine. This dictates their current movement pattern and the animation sequence and visual assets that are currently displayed to the player. For enemy characters, this can include their power, i.e. the attribute indicating how much damage they can cause to the player and their own health stats.

For other NPCs this can include the state of the dialogue they are currently engaging with the player and various other attributes describing their relationship with the player. For example, games such as Animal Crossing, Sims, and Stardew Valley include elaborate relationship systems.

Some creatures in Animal Crossing have a serious attitude.

Conclusion

In the end, a good game is nothing but a well-constructed interaction loop. The rules of interaction need to be intuitive. The interaction loop needs to be smooth. The rules of interaction need to be intuitive. Active elements and passive objects must be easily distinguished and visual feedback snappy, clear, and unambiguous.

These guidelines are clear but they are not easy to follow. The magic of game crafting is all about balancing and polishing these elements. Making mistakes in designing them is surprisingly easy. Yet mistakes are usually glaringly obvious.

Luckily we live at the age when making games has been going on for decades and our world is full of positive examples that should by followed. Follow the best practices and shamelessly steal from the best. Improve when and where you can. Others will copy you and our collective craft will advance.

Key Takeaways

  • Games are interactive media where the player’s actions influence the game setting and narrative.
  • Interaction occurs through an interaction loop between the player and the game system.
  • Components of the Interaction Loop:
    - Player: Observes, decides, and issues commands.
    - Game System: Processes input and updates the game state.
    - Devices: Input (e.g., keyboard, mouse) and output (e.g., screens, speakers) facilitate communication.
  • Real-Time vs. Turn-Based Interaction:
    - Real-Time: Game expects input continuously (e.g., every frame).
    - Turn-Based: Input is expected only at specific turns or moments.
  • Multi-Scale Interaction Loops: Games often have overlapping loops on different time scales (e.g., short-term actions vs. long-term strategies).
  • Explicit Input: Conscious commands issued by the player (e.g., pressing a button to jump).
  • Implicit Input: Actions resulting from unintended player behavior (e.g., triggering a trap by stepping on a tile).
  • Game State: Represents anything that can be changed or influenced by the player.
  • Representation:
    - Numerical values (e.g., scores, speeds).
    - Visual or textual feedback (e.g., animations, “Game Over” messages).
  • The state of the world:
    -
    All quantifiable attributes, including physical, temporal, and interactive elements.
    - Vary by genre.
    - Can be influenced either directly or indirectly by the player’s actions.
  • The state of the player: All quantifiable attributes tied to their avatar, ranging from position and inventory to complex systems like character upgrades, achievements, and avatar customization.
  • The state of NPCs: Includes position, behavior, and interaction states, and often includes relationship dynamics, dialogue progress, and combat capabilities depending on their role in the game.
  • Active Elements: The player can interact with them directly or indirectly (e.g., slingshot in Angry Birds).
  • Passive Elements: Inactive or decorative components (e.g., background scenery).
  • Clarity of Active vs. Passive Elements: Active elements must be easily distinguishable (e.g., using saturated colors for active objects).
  • Feedback on Game State Changes: Graphics should visually represent the result of player actions (e.g., falling blocks after an impact).
  • Skeuomorphic Behavior: Mimic real-world behavior to align with players’ mental models (e.g., gravity pulling objects downward).
  • Timeliness of Feedback: In real-time games, feedback must align with real-world timescales for immersion.
  • Unambiguous Representation: Changes in the game state should be visually intuitive (e.g., cracked textures for damaged objects).

--

--

Stanislav Stankovic
Stanislav Stankovic

Written by Stanislav Stankovic

Senior Game Design Director at EA. Ex-Supercell, Ex-PixelUnited, Ex-Rovio.

Responses (4)