slides with explanations - Department of Computing and Software

Transcription

slides with explanations - Department of Computing and Software
CHAPTER 10
CORE MECHANICS
ZHONGSHI XI
RACHEL MAILACH
CORE MECHANICS:
-determine how the game actually operates
-heart of the game
-defines rules and game-play
Quiz 1
What are the core mechanics of
Tetris?
A. A row is eliminated if and only if it
is completely filled with blocks.
B. The player hits the left arrow key
to rotate the current shape
counter-clockwise by 90 degrees
immediately and permanently.
C. The shape will “stick” at the
position when one of its blocks
collides with other blocks
otherwise it will continue to fall.
Tetris 1.68
D. The game is over when there is a
block outside the boundary.
ANSWER:
-B, because…
A does not specify details of the time, i.e. how long
the delay is before the row is eliminated, or how this
will affect any other rows, A is a RULE, not Core
Mechanic
C does not specify what “stick” means and what
type of collision it is (ie, collision on the sides does
not make it stick), also speed at which shape falls is
not specified
D does not explain what “outside the boundary”
means
Turning Rules into Core Mechanics
Early stages of game design: “Players will be penalized
for taking too long to get through the swamp.”
Core mechanics stage: “When the avatar
enters the swamp, the black toadstools begin
to emit a poison gas that the player can see
filling the screen, starting at the bottom and
rising at a rate of 1 game-world inch every 3
seconds; by the end of 3 minutes, the gas
reaches the height of the avatar’s face, and if
by that time the avatar is still in the swamp,
the avatar dies. If the avatar returns to the
swamp later, the gas is gone but the process
starts over again from the beginning.”
-It is your job as the designer to convert general
concepts into detailed rules.
-These rules will later be turned into algorithms. The
more specific the rules, the easier they are to
convert to algorithms.
EXAMPLE:
- “Early stages of game design”
-not well defined: What is the penalty? How
long does the player have?
- “Core mechanics stage”
-defined like algorithm
-uses words like when, and if
-views game as state machine
DESIGN RULE: Design the game, not software (let
the programmer handle the code implementation)
What the Core Mechanics Do
Age of Empires
-Operate internal economy of the game – how game
creates, distributes and uses up goods on which game
bases its economy.
-Presents active challenges to player via UI as the level
design specifies.
-Player actions – converts actions from the UI and
implements into game world.
-Detects victory or loss – controls termination conditions,
applies whatever consequences rules call for.
-Operates AI of non-player characters and opponents.
-Switches states of game – keeps track of current gameplay mode and when a mode change is needed, the core
mechanics switch the modes and signal the UI to update
accordingly.
-Transmits triggers to storytelling engine – when game
events or player actions call for plot to occur.
Real-time vs Turn-based
Warcraft II
Civilization
REAL-TIME
-core mechanics specify parameters of a world that operates on
its own whether the player acts or not
-processes operate continuously
-wait for event triggers
TURN-BASED
-core mechanics don't do anything until player takes turn, then
effects are computed
-in some games, all players enter actions simultaneously, then
core mechanics compute effect of all players' actions
-design will read like sequence of events -each possible action
has effects
-if game has artificial opponents, mechanics do not remain
entirely idle between turns, because they must compute
behaviour of the opponents, though the opponents still act in
turns
Core Mechanics and Level Design
LEVEL DESIGN
-Level design specifies: type, timing, sequence of
challenges
-Core mechanics specify how challenges work but
not which challenges the level contains
-read level design data from file
-initial state
-challenges
-actions
-NPCs (Non-Player Characters)
-victory conditions
Resources
Star Craft
RESOURCES
-objects or materials in the game that can move or be
exchanged (handled in numeric quantities)
-a resource represents a type of object
-the core mechanics define processes by which the game
creates, uses, trades and destroys resources
-may be of a type that can be handled individually, such
as marbles, or it can be of a type not individually handled
such as water
-games treat non-measurable concepts such as popularity
or resistance to poison as resources although in reality
they can not be used as quantities that can be measured
and be bought and sold.
Resources
Settlers of Catan
RESOURCES
EXAMPLE:
Wood constitutes as a resource in your game if your
player can pick it up, trade it, and put it down again. BUT
the resource doesn’t describe a specific marble in your
player’s pocket. Wood is a resource, but the 3 wood cards
in the player’s hand are an instance of the resource,
referring to a particular collection of that type, in this
case, wood. Thus the cards in the player’s hand are
entities.
Entities
Diablo 2
ENTITIES
-a particular instance of a resource or a state of an
element in the game world (eg. Light, on/off)
-a resource is a type of thing, but an entity is the thing
itself
-a building, character, animal, pile of gold, or vessel of
water can be an entity.
Simple Entities
SIMPLE ENTITIES
-single value stored data can be numeric such as a score,
or symbolic like the state of a light
eg. State of traffic light – initial state, and a list of all its
possible states is stored
eg. numeric entity – initial quantity, and range of
possible legal values is stored
Compound Entities
COMPOUND ENTITIES
-takes more than one data value to describe eg. Vectors
such as wind which has 2 attributes, speed, and direction
-each attribute acts as a simple entity, OR a compound
entity
Example: objects in OOP
-variables for storing numeric and symbolic values
-may be made up of other objects (same way entities can
be made up of entities)
-classes of objects contain functions or methods (entities
have associated mechanics) for data manipulation
-This is why entities are almost always implemented as
objects in code
Quiz 2
Which of the following are entities, and which are
resources?
A.
B.
C.
D.
E.
Money in Command and Conquer
Number of Mario’s lives in Super Mario
Guns in Counter-Strike
Crystals in Starcraft
Sky in Sonic the Hedgehog
ANSWER:
A. Entity/Resource
B. Entity
C. Entity/Resource
D. Entity/Resource
E. Neither
Unique Entities
FIFA
UNIQUE ENTITIES
-If game contains only one entity of a particular type (eg.
the avatar b/c there is only one)
-EXAMPLE: In a football game, the football is a unique
entity, because there may never be two footballs in play
at any one time
Quiz 3
Two players play Street Fighter on the same machine.
Player A picks Ryu in white and Player B picks Ryu in blue.
Is Ryu a unique entity in Street Fighter?
Street Fighter
ANSWER:
-No, if there are multiple avatars it is clearly not
unique
Mechanics
Hearthstone
MECHANICS
-documents how the game world and everything in it
behaves
-states the conditions that trigger events and processes
-describes the overall rules of the game, operates
throughout the game, global mechanic
-any game with more than one game-play mode
needs at least one global mechanic to control when to
switch modes
-describes behaviour of specific entities from basics (eg. a
light switch) to complex entities (eg. an AI)
-recall list from section Functions of the Core
Mechanics in Operation
Numeric & Symbolic Relationships
Explore the two relationships in the game Angry Birds with
respect to core mechanics.
Angry Birds 1
NUMERIC RELATIONSHIPS
-relationship between entities defined in terms of numbers and
arithmetic operations
-You must ensure that your equations are meaningful and will
not have errors (eg. divide-by-zero)
EXAMPLES:
-bird’s initial velocity
-energy stored in the stretched rubber band
SYMBOLIC RELATIONSHIPS
-values of symbolic entities (eg. red, on, off), cannot be
manipulated algebraically
-a two-state entity is called a flag
EXAMPLES:
-state of pig’s life (alive OR dead)
-state of pig being hit (hit OR not hit)
Event, Processes & Conditions
Example: World of Warcraft.
A ghoul is wandering around in an area of
500m2 at 1m/s. If the player comes within 10m of
the ghoul, it will stop wandering, and approach
the player at 3m/s.
When the ghoul reaches less than or equal
to 1m distance from player, the ghoul will start to
deal damage to the player at a rate of 5 health
points per second. Until the player leaves the
wandering area of the ghoul (500m2), the ghoul
will fight him until death.
If the player runs outside the wandering area
of the ghoul (500m2), the ghoul will stop
attacking the player and return to the position it
was at before approaching the player and
continue wandering as it was.
-Event is a specific change that happens after being triggered by a
condition, DO NOT occur continuously, it doesn’t happen again until
triggered again
-Process is a sequence of activities that once initiated, continues until
something stops it
-Conditions is what causes a process to start or stop
-If (condition) then execute (event)
-Or if (condition) then do not execute (event)
EXAMPLE:
-Events:
1. Ghoul is hostile towards player
2. Ghoul is not hostile towards player
-Processes:
1. Ghoul wanders around area
2. Ghoul stops wandering
3. Ghoul approaches player
4. Ghoul attacks player
5. Ghoul stops attacking player
6. Ghoul returns to original position
Event, Processes & Conditions
Grand Theft Auto IV
Internal Economy
Risk
-Economy - system in which resources and entities are
produced, consumed and exchanged in quantifiable
amounts
-Example: Risk - economy is quantified by armies!
-Example: Battle Games - enemies are part of the
economy, a resource, consumed by fighting with avatar
Sources
Monopoly
SOURCES
-if resource or entity can enter the game world having not
been there before, mechanic is called source
-part of the economy as it pays the player a type of
interest at regular intervals on the resource he owns
-spawn point - designated location where core mechanics
insert new resources
-when designing your source, you must define a
production rate
-production rate - either fixed or variable (eg. max
amount of ammo, stops producing when it gets full)
-sources can be limited or unlimited (eg. in Monopoly,
the “Go” square is an unlimited source)
Quiz 4
Which of the following is a source?
A. League of Legends, Crystal, minions spawn points
B. Civilization V, gold mines
C. After accepting a mission in EVE, a quest item is then
placed into the player’s ship
D. Borderlands, enemies drop items
League of Legends
ANSWER:
-A,C and D are all mechanics by which resources or
entities enter the game world when not having been
in the game world before
-B is an entity
Drains
Call of Duty: Black Ops 2
DRAINS
-drain - mechanic that determines consumption of
resources, time before it disappears
-Players don’t mind getting money for free, but when
they have to spend it, they want to know why.
Explain your drains!
EXAMPLE:
Weapon drains ammo
decay mechanics
Convertors
Minecraft
CONVERTERS
-a mechanic that turns one or more resources into another
type of resource
-specify the production rate and the input-to-output ratio
Example: Minecraft Crafting Table
Traders
Skyrim
TRADER
-mechanic that governs trades of goods, generally
between the player and the game
-traders cause no change in game world other than
reassignment of ownership
Problem of runaway profits: A player must never be
able to repeatedly buy an item from a trader at a low price
and sell it back at a higher price.
You must set the limits, by:
1. making it impossible to make a profit (all subsequent
sales to be less than purchase price)
2. make a reasonable profit (limit amount of buying and
selling they can do, eg. put time limit)
3. limit trader’s funds
4. in multi-player game, allow players to only buy and sell
from one another
Quiz 5
Which of the following are
drains, converters or traders?
A. Monopoly, when player passes “GO”, player receives
$200
B. Super Mario, star grants Mario short time of invincibility
C. Assasin’s Creed, player makes 1 smoke bomb from 2
units of smoke powder, and 1 metal shell
D. Crysis, after cloak ability is engaged, the power of
nano-armor starts to go down at a rate of 2% per
second
ANSWERS:
A. Is NOT a drain, converter or trader, it is a
source
B. Is NOT a drain, converter or trader, it is just a
simple mechanic. It is arguable that it is a
converter iff the star and invincibility time are
considered a resources. (i.e. Star -> 30s
invincibility time)
C. Converter
D. Drain
Quiz 6
Which of the following are drains,
converters or traders?
A. World of Warcraft, after player sells a
sword to a merchant for 100 gold
coins. The player can see the sword in
the merchant’s pocket.
B. World of Warcraft, after player sells a
sword to a merchant for 100 gold
coins, and then closes the trading
window. When the player reopens the
trading window again, they can no
longer see the sword in the merchant’
s pocket.
ANSWERS:
A. Trader, just a simple transfer of ownership
B. Converter (e.g. sword -> 100 gold coins
because it used up)
Production Mechanisms
Farmville
PRODUCTION MECHANISMS
-describes class of mechanics that make resources
available to player
-sources that bring the resource directly into player’s
hands, or e.g. facilities that gather resources from the
landscape and make them available to player
-EXAMPLE: harvest vehicle collects a resources and
carries it to a refinery where it is converted into money
that the player can use to buy other resources. The
vehicle is the production mechanism.
Tangible and Intangible Resources
Commander Keen: Goodbye Galaxy
Roller Coaster Tycoon 2
TANGIBLE AND INTANGIBLE RESOURCES
-if resource possesses physical properties in game world
it is tangible (eg. ammo in FPS)
-if resource occupies no physical space it is intangible
(eg. money in Roller Coaster Tycoon)
Feedback Loops, Mutual
Dependencies and Deadlocks
FEEDBACK LOOPS, MUTUAL DEPENDENCIES, AND
DEADLOCKS
-production mechanism that requires some of the resources that
the mechanism itself produces, feedback loop
-if the system runs out of the resource, the mechanism can not
produce more, deadlock unless designer allows another way to
break the deadlock
• If resource B need to produce entity A and A is the only
entity that produces B. If there is not enough of resource B
to produce A then there is no way to get B anymore.
• Provide other way to get B to avoid deadlocks (Design
rule: provide means to break deadlocks)
-two production mechanisms that require the other’s output as
their input in order to work are mutually dependent, if the
resources produced by either one are stopped, production stops
for both
Static Equilibrium
STATIC AND DYNAMIC EQUILIBRIUM
-static equilibrium state in which amounts of resources produced
and consumed remain the same
-settingling into state of equilibrium takes pressure off the player
and allows them to watch the game run for a little while
EXAMPLE:
- Suppose you have a miller grinding wheat to make flour and a
baker baking bread from the flour. If the bakery consumes the
flour at exactly the same rate at which the mill produces it, then the
amount of flour in the world at any one time will remain static.
If you close the bakery for a while, the flour will build up. When the
bakery restarts, the amount of flour available will be static at the new
level. The system
returns to static equilibrium because the key factors—the production
and consumption rates of the mill and the bakery have not changed.
Dynamic Equilibrium
STATIC AND DYNAMIC EQUILIBRIUM
-dynamic equilibrium when the system fluctuates through a
cycle, constantly changing, eventually returning to a starting
point and begins again
EXAMPLE:
-Let’s suppose that only one person does both jobs. She mills
enough to bake three loaves of bread; then she bakes the three
loaves; then she mills again; and so on.
-This is an example of dynamic equilibrium: Conditions are
changing all the time, but they always return to the same state
after a while because the process is cyclic. If we tell the woman
to stop baking and only mill for a while, and then resume baking
later, again the flour builds up. When she resumes baking, the
system settles into a new state of dynamic equilibrium
Challenges & the Core Mechanics
Super Meat Boy
Chips Challenge
CHALLENGES AND THE CORE MECHANICS
-core mechanics implement mechanisms by which most
challenges operate, and perform tests to see if challenge
has been beaten
Example:
1. Super Meat Boy - Passive challenge to get across
gap
2. Chips Challenge - Teeth, is a monster that follows
Chip wherever he goes, but only move every other turn.
Which turn they start to move on is dependent on odd and
even step. The teeth has an almost sentient programming,
which makes it the most complex monster in Chip's
Challenge.
Passive Challenges
Brendan Sim - 3GB3 Assignment 2
PASSIVE CHALLENGES
-example: static obstacle, such as a wall that avatar
must climb over
-mechanics only implement action of player, not
presenting challenge itself
-may create a special event that occurs once avatar
arrives on other side of the wall
Active Challenges
Final Fantasy XIII-2
ACTIVE CHALLENGES
-example: puzzle
-must have entities and mechanics to define puzzle,
player interaction, and display consequences
-Mechanics that allow the player to interact with it
and display consequences of his/her actions.
Actions and Core Mechanics
Battlefield 4
ACTIONS AND THE CORE MECHANICS
-actions available to player do not change from level to
level (usually)
PLAYER ACTIONS TRIGGER MECHANICS
-must specify mechanic that implements each action,
which will initiate an event or start/stop a process
1. UI detects data arriving from input device
2. UI then determines what action the player desires
by checking the assignment of actions to control devices
3. UI then triggers whatever mechanic associated.
EXAMPLE: if user presses button assigned to
crouch, UI triggers crouch mechanic
mechanic does 2 things
1. changes posture attribute from walking
upright state to crouching state
NOTE: this may affect other mechanics,
(e.g. when jump is applied in crouch state)
2. feedback, mechanic lowers value of
numeric height attribute
(detected by graphics engine and
displayed)
ACTIONS ACCOMPANIED BY DATA
-more complicated actions may involve
manipulation or storage of data from UI
- designer must create both an event mechanic that
implements the action and an entity that stores the data
-EXAMPLE: 1st person game, player uses mouse
movement to control direction and movement of avatar
-mouse contains more info than controller
button, UI sends data about how far mouse is moved
-requires mechanic to interpret data, and make
appropriate changes
Core Mechanics Design Tips
Goals of Core Mechanics
Design
• Strive for simplicity and
elegance
• Look for patterns, then
generalize
• Do not try and get
everything right on paper
• Find the right level of detail
CORE MECHANICS DESIGN
-designing core mechanics consists of identifying key
entities and mechanics in the game and documenting them
1. GOALS OF CORE MECHANICS DESIGN
-never forget ultimate goal is to create entertainment for the
player
STRIVE FOR SIMPLICITY AND ELEGANCE
-avoid making mechanics too complex, want it to be
easy to learn to play games
LOOK FOR PATTERNS, THEN GENERALIZE
-learn to recognize patterns in your ideas for your game
and convert them into generalized systems
-don’t make the same creature over and over with
similar mechanics, design one idea with mulitple
supporting mechanics
Example:Swamp leeches should lose 10 points
health for every minute out of water
Salamanders should lose 5 points of health
for every minute out of fire
Pattern: ALL creatures in game need 2 attributes:
1. symbol indicating native environment
(water, fire…)
2. numeric attribute stating rate of health loss
(should be 0 if not environment-dependent)
DON’T TRY TO GET EVERYTHING PERFECT ON
PAPER
-hard to map out everything on paper, cannot compute
effects of all mechanics in your head
-make a first draft, then build prototype (can be in
spreadsheet) to test
FIND THE RIGHT LEVEL OF DETAIL
-the more detail you put into your core mechanics
documentation, the quicker the programmers can code
BUT it is not the designers job to work that closely on
implementation, it takes too much time
-you must find a happy medium where the
programmers know what to do but still avoids
overloading yourself
Core Mechanics Design Tips
Revisit your earlier design work
• Reread your work to identify entities and mechanics,
list nouns and verbs
• Noun - entity or resource
• Verb - mechanic
2. REVISIT YOUR EARLIER DESIGN WORK
-reread your work to identify entities and mechanics, list
nouns and verbs
-noun - entity or resource
-verb - mechanic
Important phrases:
- if, when, whenever
-Your answers to the question, “What is the player
going to do?”
-Your flowboard of the game’s structure
-Your list of gameplay modes and your plans for
them.
-The general outline of the story you want to tell
-The names of any characters
-Your general plans for each level in the game
-The progression of the levels - sequence of levels,
information stored in entities between levels
-Any victory or loss conditions
-Any non-gameplay actions - virtual camera, pause
or save game
3. LIST YOUR ENTITIES AND RESOURCES
-break down your nouns into resource, or entities
-break down your entities into simple or compound
simple: symbolic or numeric?
symbolic: what states can it take?
numeric: what is the range of numbers?
what will its initial value be?
Core Mechanics Design Tips
Add the Mechanics
• Think about your resources
• Study your Entities
• Analyze challenges and Actions
• Look for global mechanics
ADD THE MECHANICS
-every relationship must be defined, remove words like
somehow
THINK ABOUT YOUR RESOURCES
-think about how they flow through the game
how do they enter? what drains them?
conversion rate?
STUDY YOUR ENTITIES
■ Does this entity store an amount of a resource, and
if so, have I already documented
how it works in the previous step?
■ What events, processes, and relationships affect
the entity? What conditions
apply to these events, processes, and relationships?
■ What events, processes, and relationships does the
entity contribute to? What
conditions apply to them?
■ What can the entity do by itself, if anything? Any
entity that can do something
by itself—whether the entity is as simple as a
detector or as complicated as an
NPC—requires mechanics to define what it does
and how.
■ What can the player do to the entity, if anything?
If the player can manipulate
the entity, he requires an action to do so, and actions
require mechanics.
■ Is this a symbolic entity? If so, it requires
mechanics to control how the entity
gets into each of its possible states..
ANALYZE CHALLENGES AND ACTIONS
-go over list of challenges and actions
-ensure all active challenges have an associated
mechanic
LOOK FOR GLOBAL MECHANICS
-global mechanics operate all the time, eg. victory or
loss condition