FIT CTU
Adam Vesecký
vesecky.adam@gmail.com
Lecture 1
Games
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)
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)
Computer Application
Computer game
Habitica
Entertainment
Gameplay
Dynamics
Tool
Use-cases
Feedback
Computer games are real-time interactive agent-based simulators.
Achievers
Explorers
Socializers
Destroyers
Emergence
Progression
Gameplay
Mechanics
System
Level
Simulation
Bot
Agent
Mob
NPC
Mechanics
Story
Aesthetics
Technology
Goals
Factorio
Naughty Dog Games
Bethesda Games
Valve Games
INSIDE
Spore
World of Warcraft
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
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
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
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
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
Space
Objects
Actions
Rules
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
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 | ... |
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
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
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
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
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