FIT CTU

Adam Vesecký

vesecky.adam@gmail.com

Lecture 1

Games

Architecture of Computer Games

Adam Vesecký

What are games

What is a game?

A game is something you play. Something that is fun to play. A fun is a pleasure with surprises. (Jesse Schell)

A game is an interactive structure of endogeneous meaning that requires player to struggle toward a goal. (Greg Costikyan)

Games are exercise of control systems, in which there is a contest between powers, confined by rules, producing a disequlibrial outcome. (Elliot Avendon)

What is a game?

A game is a system in which players engage in an artificial conflict, defined by rules, that results in a quantifiable outcome. (Sales &Zimmerman, 2004)

A game is an activity defined by rules in which players try to reach some sort of goal.
(Alexander Galloway, 2006)

Games are series of meaningful choices.

(Sid Meyer, 2012)

What is a game?

curiosity
system
outcome
conflict
activity
endogeneous
goal
surprise
rules
choices

What is a computer game?

Computer Application

  • a computer program that helps a user to perform a task

Computer game

  • a computer-controller game where players interact with objects displayed on a screen for the sake of entertainment.

Habitica

Computer games are not applications! Yet the line between them is blurry.

Computer games VS applications

Entertainment

Gameplay

Dynamics

Tool

Use-cases

Feedback

Generic definition

Computer games are real-time interactive agent-based simulators.

And they take place in a world where you can heal yourself by eating raw potatoes...

Why do we play games?

4 core players types by Richard Bartle

Achievers

  • interested in goals in a game to show off
  • speed runners, Minecraft builders

Explorers

  • like to understand the full extend of a game space
  • single-player and solo gamers

Socializers

  • more interested in other players than the gameplay
  • co-op players, Mario Kart racers

Destroyers

  • players who want to win but also dominate game
  • they love competition

How do we play games?

  • competitive play - someone wins, someone loses
  • cooperative play - experience through cooperation
  • skill-based play - game emphasizes player's skill development
  • experience-based play - experience through exploration, story unfolding,...
  • whimsical play - emphasizes silly actions
  • expressive play - subverts player's choice to express something
  • simulation-based play - models a real-world system

Game genres

Casual
Sandbox
Fighting
Racing
Shooter
Platformer
Puzzle
Arcade
RPG
Sports
Strategy
Adventure

History of games and consoles

Game Mechanics

Terms

Emergence

  • refers to the fact that the behavior is the result of a complex and dynamic system of rules

Progression

  • refers to the structures in games where a designer outlined the possible game states beforehand, usually through level design.

Gameplay

  • an emergent property of the game as defined by its rules

Mechanics

  • a set of rules governing the behavior of a single game element.

System

  • interacting group of game elements forming a unified whole

Level

  • structure in a game that dictates what challenges players encounter

Terms

Simulation

  • a representation of a source system via a less complex system that correlates with the user's understanding of the source system

Bot

  • an intelligent artificial player emulating a human player

Agent

  • an intelligent autonomous entity, having the ability to manipulate its environment

Mob

  • a generic monster/enemy or a group of monsters

NPC

  • non-playable character - doesn't play the game but rather interacts with the player

Game Basic Elements

Mechanics

  • a set of rules governing the behavior of a single game element

Story

  • a sequence of events that unfolds in the game

Aesthetics

  • how the game looks, sounds, tastes, feels,...

Technology

  • any materials and interactions that make the game possible

Goals

  • define what players try to achieve

Mechanics

Factorio

Story

Naughty Dog Games

Bethesda Games

Valve Games

Aesthetics

INSIDE

Technology

Spore

Goals

World of Warcraft

Example: Space Invaders

Mechanics - introduced concept of highscore

Story - didn't need to have a story

Aesthetics - three different alien designs

Technology - first videogame of it's kind

Goals - survive as long as you can

Example: Doom

Mechanics - levels, ambushes, locations, keys, doors, elevators,...

Story - unnamed hero (Doomguy) fighting against invading demons

Aesthetics - advanced sounds and music (for that period)

Technology - pseudo 3D FPS perspective

Goals - beat all levels

Example: No man's sky

Mechanics - exploration, crafting, gathering, building

Story - space-exploration game with heavy resource-gathering elements

Aesthetics - visually stunning lush world

Technology - (pseudo) random generated world

Goals - get to the centre of the galaxy

Example: League of Legends

Mechanics - crowd, elo, gank, items, juking, kiting, last hit, pushing, recall, points, warding, zoning

Story - a plethora of stories in the LoL blog

Aesthetics - cartoonish style

Technology - MOBA (Multiplayer Online Battle Arena), Riot Servers

Goals - defeat the opposite team

Example: Tormentum Dark Sorrow

Mechanics - point-and-click adventure (go, move, examine, walk)

Story - the main element of the game

Aesthetics - biomechanic surrealism

Technology - simple sprite fragments

Goals - finish the game and unravel the story

Game Mechanic Entities

Space

  • various spaces that can exist in a game and how they are related
  • physical and conceptual relationships

Objects

  • entities that can be seen or manipulated

Actions

  • an object's turn to act

Rules

  • statements that describe constraints, consequences and goals

Example: Pong

Space - 2D board

Objects - two players (paddles) and colliding ball, score

Actions - move up/down (1 degree of freedom), release the ball

Rules - the ball has a constant linear velocity. Angle of incidence is angle of reflection. Player earns one point when the other player fails to return the ball. The winner is the one who reaches eleven points before the opponent

Example: Block Breaker

Rise of game engines

Pre-engine era

Pinball Construction Kit
1983
Thunder Force Construction
1984
Adventure Construction Kit
1984
Garry Kitchen's GameMaker
1988
Arcade Construction Kit
1988
RPG Maker
1990

1984: Breakout

1 move_paddle
2 ;read input from joystick
3 lda joystick2;joy port 2
4 and #8 ;right
5 beq move_paddle_right
6 lda joystick2
7 and #4 ;#left
8 beq move_paddle_left
9 rts
10 check_ball_paddle_collision
11 lda sprite_collision
12 and #2
13 cmp #2
14 beq ball_paddle_collision
15 rts
16 ball_paddle_collision
17 ...

1989: Prince of Persia

Guard controller

1 :underctrl
2 lda CharSword
3 cmp #2 ;in fighting mode?
4 beq FightCtrl ;yes
5
6 lda CharID
7 cmp #2 ;kid or shadowman?
8 bcc :cont
9 jmp GuardCtrl ;no
10
11 * What is he doing now?
12 :cont ldx CharPosn ;previous frame #

Source code for Apple II: link

ID Tech

  • Family of game engines developed by ID Software
  • Id Tech 0 - the very first game engine
  • Every next game had more advanced technology
  • Still, memory constraints sabotaged attempts to create data-heavy design
Hovertank 3-D
1991
Catacomb 3-D
1991
Wolfenstein 3-D
1992
Shadowcaster
1993

1993: Doom

1 boolean P_CheckMissileRange (mobj_t* actor){
2 if (!P_CheckSight(actor, actor->target))
3 return false; // can’t see the target
4
5 if ( actor->flags & MF_JUSTHIT ) {
6 // just hit -> fight back!
7 actor->flags &= ~MF_JUSTHIT;
8 return true;
9 }
10
11 if (actor->reactiontime)
12 return false; // do not attack yet
13
14 dist = P_AproxDistance (actor, target)
15 - 64*FRACUNIT;
16
17 // no melee attack, so fire more
18 if (!actor->info->meleestate)
19 dist -= 128*FRACUNIT;
20
21 // check for ARCH-VILE
22 if (actor->type == MT_VILE){
23 if (dist > 14*64)
24 return false; // too far away
25 }
26 }

Source code: link

1996: Quake

1 void() DeathSound = {
2 local float rs;
3
4 // water death sounds
5 if (self.waterlevel == 3) {
6 DeathBubbles(5);
7 sound (self, CHAN_VOICE,
8 "player/h2odeath.wav", 1, ATTN_NONE);
9 return;
10 }
11
12 rs = rint ((random() * 4) + 1);
13 if (rs == 1)
14 self.noise = "player/death1.wav";
15 if (rs == 2)
16 self.noise = "player/death2.wav";
17 if (rs == 3)
18 self.noise = "player/death3.wav";
19 if (rs == 4)
20 self.noise = "player/death4.wav";
21 if (rs == 5)
22 self.noise = "player/death5.wav";
23
24 sound (self, CHAN_VOICE, self.noise, 1, ATTN_NONE);
25 return;
26 };

Source code: link

1998: Half-Life

1 // This is a bad way to implement HL1 style sprite fonts,
2 // but it will work for now
3 CHL1HudNumbers::CHL1HudNumbers( vgui::Panel *parent,
4 const char *name ) : BaseClass( parent, name )
5 {
6 vgui::Panel *pParent = g_pClientMode->GetViewport();
7 SetParent( pParent );
8 }
9
10 // I don't know why, I don't want to know why, I shouldn't
11 // have to wonder why, but for whatever reason this stupid
12 // panel isn't laying out correctly unless we do this
13 InvalidateLayout( true );
14 m_pContents->InvalidateLayout( true, true );
15
16
17 // My hope is that this code is so awful I'm never allowed
18 // to write UI code again.
19 float fXScale = 1.0f / (float)iSubtileCount,
20 fXOffsetL = (float)iSubtileIndex * fXScale,
21 fXOffsetR = (float)(iSubtileIndex + 1) * fXScale,
22 fXUpperLowerOffset = fXScale * 0.65f;

Source code: link

Quake Engine

  • ~id Tech 1
  • Released by ID Software in 1996
  • True 3D real-time rendering
  • Binary space partitioning
  • 3D light sources, Gouraud shading
  • Games released: Quake, Hexen 2, Silver Wings
  • Source code released in 1999
  • Successors:
    • id Tech 2: 1997
    • id Tech 3: 1999
    • id Tech 4: 2004
    • id Tech 5: 2011
    • id Tech 6: 2016
    • id Tech 7: 2018

Quake engine family

Influence of Game Engines

Game Engines Today

Lecture Summary

  • I'm able to define somehow what a game is
  • I know the difference between games and applications
  • I know the difference between emergence and progression
  • I know terms like gameplay, mechanics, system, level, simulation, bot, agent, mob, NPC
  • I know game basic elements
  • I know elements/entities of game mechanics
  • I know a thing or two about IDTech

Goodbye Quote

So you walk eternally through the shadow realms, standing against evil where all others falter. May your thirst for retribution never quench, may the blood on your sword never dry, and may we never need you again.Doom 4