Upload
ashlee-gray
View
224
Download
2
Tags:
Embed Size (px)
Citation preview
Level Design and ScriptingLevel Design and ScriptingWeek 8Week 8
Advanced Programming for Advanced Programming for 3D Applications3D Applications
CE00383-3CE00383-3
ReferencesReferences
• Andrew Rollings and Ernest Adams. Andrew Rollings and Ernest Adams. On Game Design, New Riders Games, On Game Design, New Riders Games, 2003.2003.
• Kevin Oxland. Gameplay and design, Kevin Oxland. Gameplay and design, Addison Wesley, 2004.Addison Wesley, 2004.
The PartsThe PartsA game (or other graphics based A game (or other graphics based application) comprises four broad application) comprises four broad components:components:
• Game EngineGame Engine
• Rules and MechanicsRules and Mechanics
• User InterfaceUser Interface
• Content and ChallengesContent and Challenges
Game EnginesGame EnginesSometimes when a developer or Sometimes when a developer or player uses the term “engine” they player uses the term “engine” they really mean “graphics engine”. But a really mean “graphics engine”. But a game engine encompasses much game engine encompasses much more. Game engines:more. Game engines:– Power the graphics and soundPower the graphics and sound– Power the AIPower the AI– Power the physics and interactions in the Power the physics and interactions in the
gamegame– Describe the nature of the game spaceDescribe the nature of the game space– Define the parameters of game objectsDefine the parameters of game objects– Define the space of possibilities in the Define the space of possibilities in the
game worldgame world
Characteristics of an Characteristics of an EngineEngine• Is broad, adaptable, and extensible.Is broad, adaptable, and extensible.
• Firmly encodes all non-mutable design Firmly encodes all non-mutable design decisions.decisions.
• Allows parameters for all mutable design Allows parameters for all mutable design decisions.decisions.
• Should outline the gameplay and Should outline the gameplay and challenge possibilities.challenge possibilities.
• Determines the overall game architecture.Determines the overall game architecture.
• Is coded so that new design decisions Is coded so that new design decisions leave it unchanged.leave it unchanged.
Rules and MechanicsRules and Mechanics• Specific decisions about game Specific decisions about game
parameters, obstacles, and abilities parameters, obstacles, and abilities determine the rules and mechanics determine the rules and mechanics of the game. This includes things of the game. This includes things like: like: – Player abilitiesPlayer abilities– Enemy statsEnemy stats– Enemy behaviourEnemy behaviour– Jumping heightJumping height– Gravity strengthGravity strength– Point valuesPoint values– Interplay between game objectsInterplay between game objects
Rules and Mechanics Rules and Mechanics (cont’d)(cont’d)• Engine + mechanics = core Engine + mechanics = core
rulebooks.rulebooks.• Engine and mechanics still doesn’t Engine and mechanics still doesn’t
make a whole game.make a whole game.• AI is part of the mechanics.AI is part of the mechanics.• If you have the engine and the If you have the engine and the
mechanics, you should be able to mechanics, you should be able to make a level editor or game toolset.make a level editor or game toolset.
• Takes the space of possibilities, and Takes the space of possibilities, and makes decisions for all parametersmakes decisions for all parameters
InterfacesInterfaces
• The engine and mechanics tells us what the The engine and mechanics tells us what the player and other objects in the game can player and other objects in the game can do. do.
• The interface tells us how the player does The interface tells us how the player does things, and how she knows what’s things, and how she knows what’s happening in the game. happening in the game.
• Interfaces thus have two parts:Interfaces thus have two parts:– Player-to-ComputerPlayer-to-Computer– Computer-to-PlayerComputer-to-Player
• The interface is the center of the user The interface is the center of the user experience.experience.
Content and ChallengesContent and Challenges
• Two types of content: Two types of content: – non-gameplaynon-gameplay– gameplay. gameplay.
• Non-gameplay content includes:Non-gameplay content includes:– GraphicsGraphics– Sound Effects,Background Music,Cut ScenesSound Effects,Background Music,Cut Scenes– Story,Flavor Text,DialogueStory,Flavor Text,Dialogue
• Gameplay content includes:Gameplay content includes:– Goals and victory conditionsGoals and victory conditions– Missions and questsMissions and quests– Level designLevel design
Types of LevelsTypes of Levels
• Before designing a level for a game, it is Before designing a level for a game, it is important to know what type of level is important to know what type of level is needed for the game.needed for the game.– StandardStandard– HubHub– BossBoss– BonusBonus– TutorialTutorial
Standard LevelsStandard Levels• Standard levels are used to contain Standard levels are used to contain
the typical gameplay of a game and the typical gameplay of a game and are used to contain most of the are used to contain most of the story of the game.story of the game.– around 90% of a game’s levels are around 90% of a game’s levels are
standard levels, while the rest are standard levels, while the rest are special levels of one of the other types.special levels of one of the other types.
HubsHubs• Hubs do not have the same gameplay Hubs do not have the same gameplay
model as standard levels.model as standard levels.– Hubs are levels that tend to be used to Hubs are levels that tend to be used to
connect other levels together. connect other levels together. – Consequently hubs can have multiple Consequently hubs can have multiple
entry and exit points, although not all entry and exit points, although not all need be accessible on the first visit to need be accessible on the first visit to the hub.the hub.
– Typically, players can return to hubs Typically, players can return to hubs multiple times throughout a game for multiple times throughout a game for some purpose.some purpose.
Types of Levels: HubsTypes of Levels: Hubs
Screen shot from Overlord. In this game, your tower is a hub, allowing youto do a variety of maintenance tasks, as well as transporting you to other
parts of the game world.
Boss LevelsBoss Levels• Climax points within a game.Climax points within a game.
– Whether they be bosses, mini-bosses, orWhether they be bosses, mini-bosses, orthe final boss of the game.the final boss of the game.
• Boss levels are often designed around the boss Boss levels are often designed around the boss in question.in question.– This includes how the boss attacks, and how the boss This includes how the boss attacks, and how the boss
can ultimately be defeated.can ultimately be defeated.
• Boss levels provide a break from the standard Boss levels provide a break from the standard levels in a game.levels in a game.– Typically cover a lot less territory thanTypically cover a lot less territory than
the standard levels.the standard levels.– Can also have different gameplay mechanics.Can also have different gameplay mechanics.
• Boss levels also typically trap or otherwise Boss levels also typically trap or otherwise contain the player so that they cannot escape contain the player so that they cannot escape the area.the area.– At least not until they defeat the boss …At least not until they defeat the boss …
Types of Levels: Boss LevelsTypes of Levels: Boss Levels
Screen shot from Armed and Dangerous. After finishing an area, quiteoften there were boss battles involving using a turret to ward off waves
of enemies. A different style of gameplay from the rest of the game.
Tutorial LevelsTutorial Levels• Tutorial levels can be among the more difficult Tutorial levels can be among the more difficult
ones to design properly.ones to design properly.– They must teach the player multiple new skills in a They must teach the player multiple new skills in a
short amount of time, as you do not want the short amount of time, as you do not want the player delayed from getting into the rest of the player delayed from getting into the rest of the game.game.
– At the same time, the training scenarios must be At the same time, the training scenarios must be spaced out and paced so that the player is not spaced out and paced so that the player is not overwhelmed by too much at once.overwhelmed by too much at once.
– They must somehow fit into the rest of the levels in They must somehow fit into the rest of the levels in the game smoothly, and must not seem out of the game smoothly, and must not seem out of place in comparison, which can be hard, especially place in comparison, which can be hard, especially when you must consider the player might skip when you must consider the player might skip them.them.
Types of Levels: Tutorial Types of Levels: Tutorial LevelsLevels
Screen shot from Psi-Ops: The Mindgate Conspiracy. This game features
multiple tutorial levels, each teaching a different gameplay skill. These
are nicely integrated as memories recovered as the game progresses
to teach the relevant skills as they are needed.
Bonus LevelsBonus Levels• Unlike other levels that can be critical to the Unlike other levels that can be critical to the
completion of a game, bonus levels are optional completion of a game, bonus levels are optional and not required for game completion.and not required for game completion.
• Typically, bonus levels are given as rewards to Typically, bonus levels are given as rewards to players for some kind of extra effort in the players for some kind of extra effort in the game.game.
• Bonus levels also provide a break from standard Bonus levels also provide a break from standard levels.levels.– They can be shorter and use much different gameplay They can be shorter and use much different gameplay
than standard levels.than standard levels.– Completing a bonus level might provide a further Completing a bonus level might provide a further
reward, like a special weapon, item, and so on, reward, like a special weapon, item, and so on, depending on the game.depending on the game.
• Bonus levels should be the lowest priority on any Bonus levels should be the lowest priority on any project, and are one of the first things cut if time project, and are one of the first things cut if time runs short.runs short.
Types of Levels:Types of Levels:Bonus LevelsBonus Levels
Screen shot from Mario Bros. This is a bonus level in which the playermust grab as many coins as possible before time runs out.
Designing the LevelDesigning the Level• Three main categories of design issuesThree main categories of design issues
– The spatial or physical characteristicsThe spatial or physical characteristicsof the level.of the level.
– The temporal characteristics of the level.The temporal characteristics of the level.– The interplay between the level’s designThe interplay between the level’s design
and the gameplay that is contained and the gameplay that is contained within the level.within the level.
Spatial CharacteristicsSpatial Characteristics• Spatial characteristics include the physical Spatial characteristics include the physical
elements of the game environment.elements of the game environment.– PerspectivePerspective– Physical LayoutPhysical Layout– ConsistencyConsistency– Interior versus ExteriorInterior versus Exterior– Materials and TerrainMaterials and Terrain– Scale , BoundariesScale , Boundaries– ConsistencyConsistency– StyleStyle– LandmarksLandmarks
Spatial Characteristics: Spatial Characteristics: PerspectivePerspective• There are a wide variety of perspectives that can There are a wide variety of perspectives that can
be used to view the levels inbe used to view the levels inthe game world.the game world.
• First person perspective:First person perspective:– The game is viewed from the perspective of the player The game is viewed from the perspective of the player
character in the game world.character in the game world.• Third person perspective:Third person perspective:
– In this perspective, the player character is visible on In this perspective, the player character is visible on screen, and the game world is viewed through some screen, and the game world is viewed through some other camera observing the scene.other camera observing the scene.• Omnipresent: Provides the ability to view all over the Omnipresent: Provides the ability to view all over the
game world, usually from above, with great control over game world, usually from above, with great control over the camera’s position.the camera’s position.
• Isometric: The player can look slightly across the Isometric: The player can look slightly across the landscape at a 30 to 45 degree angle to be involved in the landscape at a 30 to 45 degree angle to be involved in the action.action.
• Top-down: The game is viewed straight from above, Top-down: The game is viewed straight from above, possibly with some form of scrolling.possibly with some form of scrolling.
• Side-view: The game is viewed from the side, possibly Side-view: The game is viewed from the side, possibly with some form of scrolling.with some form of scrolling.
Spatial Characteristics: Physical Spatial Characteristics: Physical LayoutLayout• The physical layout of a level will be The physical layout of a level will be
heavily influenced by its gameplay heavily influenced by its gameplay type.type.– Single player levels should create a flow Single player levels should create a flow
that leads the player from goal to goal. that leads the player from goal to goal. There should be a linear flow of nonlinear There should be a linear flow of nonlinear areas, perhaps with branches to the flow.areas, perhaps with branches to the flow.
– Multiplayer levels should be more open, Multiplayer levels should be more open, but simpler so the player does not get but simpler so the player does not get lost. There should be no safe places, but lost. There should be no safe places, but perhaps some hard to reach ones.perhaps some hard to reach ones.
Spatial Characteristics: Interior versus Spatial Characteristics: Interior versus ExteriorExterior• Interior spaces often work differently in Interior spaces often work differently in
games than exterior spaces.games than exterior spaces.– In essence, an interior space is a space with a In essence, an interior space is a space with a
ceiling constrained by walls.ceiling constrained by walls.– Interior spaces also tend to be smaller, more Interior spaces also tend to be smaller, more
confined, and easier to control.confined, and easier to control.– Exterior spaces tend to be more open, with Exterior spaces tend to be more open, with
the player able to see much farther.the player able to see much farther.– Consequently, interiors tend to have more Consequently, interiors tend to have more
details than exteriors, in which detail must be details than exteriors, in which detail must be used with great care and a lot of used with great care and a lot of consideration.consideration.
Spatial Characteristics: Materials and Spatial Characteristics: Materials and TerrainTerrain• In game levels, there are two types of In game levels, there are two types of
structures: man-made and organic.structures: man-made and organic.– Man-made structures are not naturally Man-made structures are not naturally
occurring, constructed from a variety of occurring, constructed from a variety of materials like concrete, materials like concrete, brick, metal, glass, wood, and so on.brick, metal, glass, wood, and so on.
– Organic structures are the terrain of the game Organic structures are the terrain of the game
world, composed of water, earth, rock, sand, world, composed of water, earth, rock, sand, plant-life (like grass and trees), and so on. plant-life (like grass and trees), and so on. This This also includes what is visible in the sky in also includes what is visible in the sky in exterior levels, like clouds, and so on.exterior levels, like clouds, and so on.
Spatial Characteristics: Scale and Spatial Characteristics: Scale and BoundariesBoundaries• The scale of the game includes the total size of The scale of the game includes the total size of
physical space and relative sizes of objects in physical space and relative sizes of objects in the game.the game.– For realism, it is best to scale most objects to For realism, it is best to scale most objects to
accurately reflect their size in the game.accurately reflect their size in the game.– Scale exaggeration might be necessary to make sure Scale exaggeration might be necessary to make sure
elements of the game are harder to miss, or easier to elements of the game are harder to miss, or easier to manage or manipulate.manage or manipulate.
– Scale distortion might also be necessary to make Scale distortion might also be necessary to make traversal of the world quicker and easier to the player.traversal of the world quicker and easier to the player.
• Finite world so developers have to provide some Finite world so developers have to provide some boundaries boundaries – At the same time, these boundaries must make sense At the same time, these boundaries must make sense
when they are visible in the context of a game, or else when they are visible in the context of a game, or else player immersion might be lost.player immersion might be lost.
– Boundaries can include locked doors, walls, impassable Boundaries can include locked doors, walls, impassable mountains, thick vegetation, and so on, depending on mountains, thick vegetation, and so on, depending on the game, of course.the game, of course.
– Some games do not contain boundaries, but have a Some games do not contain boundaries, but have a game world that is wrapped around itself.game world that is wrapped around itself.
Spatial Characteristics: StyleSpatial Characteristics: Style
• The style of a level influences its The style of a level influences its structure and also its appearance.structure and also its appearance.
• This includes:This includes:– The architecture of man-made The architecture of man-made
structures.structures.– The layout of terrain elements.The layout of terrain elements.– The placement and types of objects toThe placement and types of objects to
be found in the levels.be found in the levels.– The colouring, texturing, and shading of The colouring, texturing, and shading of
everything in the level.everything in the level.
Spatial Characteristics: Spatial Characteristics: LandmarksLandmarks• Visually distinctive landmarks should Visually distinctive landmarks should
be provided to help orient the player be provided to help orient the player as they navigate the level.as they navigate the level.
• Landmarks can be anything in the Landmarks can be anything in the level as long as it is unique.level as long as it is unique.– Usually, landmarks are memorable either Usually, landmarks are memorable either
by size, position, or appearance.by size, position, or appearance.– Landmarks can also be the focal points for Landmarks can also be the focal points for
levels as well, so make them interesting levels as well, so make them interesting and evoke emotion from the player.and evoke emotion from the player.
Spatial Characteristics: Spatial Characteristics: ConsistencyConsistency• The look of a level should be The look of a level should be
consistent.consistent.– Although larger levels can contain a Although larger levels can contain a
series series of smaller locations that look different, of smaller locations that look different, each location should be consistent within each location should be consistent within its boundaries.its boundaries.
• Levels should also be consistent with Levels should also be consistent with other elements of the game.other elements of the game.– With the game’s story, with its With the game’s story, with its
characters, and so on.characters, and so on.
Temporal Characteristics: Temporal Characteristics:
• We can think of time in the context We can think of time in the context of “real world” or “wall clock” time.of “real world” or “wall clock” time.– In the end, time in levels of the game In the end, time in levels of the game
world can pass slower, faster, or not any world can pass slower, faster, or not any different than time in the real world.different than time in the real world.
– In some games, time does not pass at In some games, time does not pass at all, at least until the player does all, at least until the player does something.something.
Authentic TimeAuthentic Time• Some games try to portray time Some games try to portray time
authentically and use the passage of authentically and use the passage of time as a gameplay mechanic in the time as a gameplay mechanic in the game world.game world.– In some cases, time is synchronized with In some cases, time is synchronized with
time in the real world or something else time in the real world or something else like the presence of light to track time like the presence of light to track time passage.passage.
– In other cases, time is not synchronized In other cases, time is not synchronized but still plays an important and authentic but still plays an important and authentic role in various elements of the game.role in various elements of the game.
Gameplay: GoalsGameplay: Goals• Make sure the player knows the goals and Make sure the player knows the goals and
objectives to complete in each level.objectives to complete in each level.– Give them a cut scene or scripted action.Give them a cut scene or scripted action.– Provide an easily accessible mission screen.Provide an easily accessible mission screen.
• The players should be given some way of The players should be given some way of measuring their progress and success measuring their progress and success within a level as well.within a level as well.
• The design of a level should also reflect The design of a level should also reflect the goals the player is to complete.the goals the player is to complete.
Gameplay: ObstaclesGameplay: Obstacles• Obstacles prevent the player from easily Obstacles prevent the player from easily
achieving those goals.achieving those goals.– Simple roadblocks:Simple roadblocks:
• These obstacles slow the player downThese obstacles slow the player down– EnemiesEnemies
• Games that involve combat will have enemies that Games that involve combat will have enemies that either need to be defeated or avoided to reach the either need to be defeated or avoided to reach the game’s goals.game’s goals.
• Enemies can vary in size, movement (speed, method Enemies can vary in size, movement (speed, method of movement), and attack style. of movement), and attack style.
– TrapsTraps• Traps are obstacles that can ensnare or do damage to Traps are obstacles that can ensnare or do damage to
the player that are part of the environment in the the player that are part of the environment in the game world.game world.
• Traps can include hidden pits, closing walls, falling Traps can include hidden pits, closing walls, falling objects, and so on. objects, and so on.
– PuzzlesPuzzles• Puzzles are obstacles that require some brainpower Puzzles are obstacles that require some brainpower
to solve and remove.to solve and remove.
Structure and ProgressionStructure and Progression• Ease the player into each level and build Ease the player into each level and build
up the difficulty as they go along.up the difficulty as they go along.– Build conflict in a series of ascending arcs.Build conflict in a series of ascending arcs.– Give hints and teases of what is to come.Give hints and teases of what is to come.
• Vary the pace of action in the level.Vary the pace of action in the level.– Some frantic periods of action.Some frantic periods of action.– Some exploration time.Some exploration time.– Some safe time when the player can take a Some safe time when the player can take a
breather, think, and absorb the situation.breather, think, and absorb the situation.
• Make sure there is enough to do!Make sure there is enough to do!– Do not let the player get bored. Ensure there Do not let the player get bored. Ensure there
are enough challenges to keep the player are enough challenges to keep the player occupied.occupied.
Gameplay: Structure and Gameplay: Structure and ProgressionProgression
Gameplay: Flow ControlGameplay: Flow Control• Closing off areas can be necessary for Closing off areas can be necessary for
many reasons:many reasons:– Better management of resources.Better management of resources.– Reducing player paranoia.Reducing player paranoia.
• There are many ways to accomplish this.There are many ways to accomplish this.– The simplest is the creation of a one way The simplest is the creation of a one way
barrier that prevents the player from going barrier that prevents the player from going back once it has been crossed.back once it has been crossed.
• Remember that your player can try to do Remember that your player can try to do the unexpected.the unexpected.– Play testing is needed to ensure that game Play testing is needed to ensure that game
flow is being controlled properly.flow is being controlled properly.
Gameplay: BalanceGameplay: Balance• Stocking a level requires very careful Stocking a level requires very careful
thought and planning.thought and planning.– Too many or too few supplies for the Too many or too few supplies for the
player.player.– Too many or too few enemies.Too many or too few enemies.– Locations of supplies and enemies.Locations of supplies and enemies.
• Levels need to be carefully balanced Levels need to be carefully balanced to push the player to their limits, to push the player to their limits, without actually pushing them over without actually pushing them over the edge.the edge.
Gameplay: Rewarding the Gameplay: Rewarding the PlayerPlayer• Balance risk and reward for the player.Balance risk and reward for the player.
– Something might be difficult to do in a game, Something might be difficult to do in a game, so accomplishing it should provide some kind so accomplishing it should provide some kind of bonus to the player for their efforts.of bonus to the player for their efforts.
• Players should also be rewarded for skill, Players should also be rewarded for skill, imagination, intelligence, and dedication.imagination, intelligence, and dedication.– These qualities distinguish a good player, and These qualities distinguish a good player, and
good players should be rewarded.good players should be rewarded.
• It is important to reward in a big way, and It is important to reward in a big way, and punish in a small way.punish in a small way.– Ultimately, the hope of success motivates Ultimately, the hope of success motivates
players more (and in better ways) than the players more (and in better ways) than the fear of failure does.fear of failure does.
The Eight Steps Game Design The Eight Steps Game Design for a Puzzle Gamefor a Puzzle Game
1. Inspiration1. Inspiration2. Simplification2. Simplification3. Construction Set3. Construction Set4. Design 4. Design
SpecificationSpecification
5. Levels5. Levels6. Testing6. Testing7. Sequence7. Sequence8. Presentation8. Presentation
SSPECIFYPECIFYRRULESULES
BBUILDUILDPPUZZLESUZZLES
Here are the eight steps in designing a puzzle game. The process splits into two halves: specifying the rules, and building the puzzles.
1. Inspiration: Previous 1. Inspiration: Previous GameGame
1. Inspiration: Technology1. Inspiration: Technology
1. Nonphysical moves (Tetris)1. Nonphysical moves (Tetris)
2. Algorithmic levels (Pit Droids)2. Algorithmic levels (Pit Droids)
3. Enforce the rules (Sokoban)3. Enforce the rules (Sokoban)
4. Allow undo (Solitaire)4. Allow undo (Solitaire)
If you are going to design a computer puzzle, don’t just copy a puzzle from another medium. Instead, think about how the computer can enhance gameplay. Eight ways are listed above. Thinking about the technology first can inspire ideas for new types of puzzles.
1. Inspiration: Play Mechanic1. Inspiration: Play Mechanic
Every computer game, at its core, has a play mechanic — a basic way that the player interacts with an object — that gets used over and over. Endorfun, for instance, was inspired by the play mechanic of a cube rolling on a square grid, controlled by the four cursor keys..
1. Inspiration: Subject 1. Inspiration: Subject mattermatter
•This puzzle was This puzzle was inspired by inspired by thinking about thinking about astronomyastronomy
Like songs, puzzles can be inspired by real life. Stephen Sondheim: A good clue can give you all the pleasures of being duped that a mystery story can. It has surface innocence, surprise, the revelation of a concealed meaning, and the catharsis of solution.
1. Inspiration: Story1. Inspiration: Story
Adventure games like Myst are built around the elements of story: plot, character, setting, and mood. When you design puzzles for story-based games, look for puzzles that arise naturally out of the environments and situations, and help advance plot or reveal character.
1. Inspiration: Art1. Inspiration: Art
The story game Obsidian started as a series of concept sketches for characters and environments. Story and puzzles came later. Similarly, the puzzle game Spin Doctor (later renamed ClockWerx) started as a graphic concept by an artist on the project.
2. Simplification2. Simplification
The second step is to whittle the concept down to manageable size. Say we wanted to make a puzzle based on the tricky core skill of parking a car in a crowded lot. We eliminate irrelevant details and make pieces uniform by conforming them to a square grid.
3. Construction Set3. Construction Set
•Programmer: reusable codeProgrammer: reusable code
•Rule designer: tweak rulesRule designer: tweak rules
•Level designer: build levelsLevel designer: build levels
•Player: build levelsPlayer: build levels
The only way to test a puzzle concept works is to play it. So the next step is to build a construction set that makes it easy to build puzzles of a certain type. Sometimes a paper prototype is adequate. Once the rules are set, other people can use the construction set to build levels.
4. Design Specification4. Design Specification
• Board — grid, network, irregular, noneBoard — grid, network, irregular, none
• Pieces — shape, image, attribute, Pieces — shape, image, attribute, supplysupply
• Moves — sequential, side effect, Moves — sequential, side effect, primaryprimary
• Goal — exact match, partial, conditionGoal — exact match, partial, condition
Now it is time to write a detailed design specification. Most puzzle game specs will describe puzzles in terms of board, pieces, moves and goals. In addition a design spec may also cover the user interface, scoring, story, art, sound and other aspects of production.
5. Levels5. Levels
Schematically, a puzzle challenges the player to get from a problem to a solution.
5. Levels5. Levels
But of course the path is never simple. Every puzzle requires that the player make choices, some of which lead to dead ends.
5. Levels5. Levels
Puzzles in a game have a larger situation that gives the puzzle meaning. Applying the solution lets you move forward in the game.
5. Levels5. Levels
Good puzzles have require insight. The insight above is to walk around the outside of the maze. Obscure insights, however, feel unfair.
5. Levels5. Levels
Different puzzles emphasize different parts of the journey. Persistence puzzles are a slow steady climb. Aha! Puzzles skip the climb and go straight to the insight. Story puzzles work the setup into the story. Crossword puzzles are full of little insights: each word unlocks more.
6. Testing6. Testing
• Is it fun?Is it fun?
•How hard is it?How hard is it?
•Are there simpler solutions?Are there simpler solutions?
•Can it be improved?Can it be improved?
The only way to find out whether a puzzle is fun is to watch someone play it. Often a puzzle you think is easy will turn out to be hard, or vice versa. Sometimes players will find simpler solutions. Or you will realize that the puzzle needs some other improvement.
7. Sequence 7. Sequence
AcceleratingAccelerating
LinearLinear
SawtoothSawtooth
SemilinearSemilinear
Ordered collectionOrdered collection
MetapuzzleMetapuzzle
Next you must put the levels into sequence. Linear is simplest, but can get tiring. A better organization is the sawtooth, which keeps going back to easy puzzles, or to give players freedom to play puzzles out of order. Metapuzzles motivate players to complete the whole game.
7. Sequence: Transitions7. Sequence: Transitions
•Learning the rulesLearning the rules
•Recovering from failureRecovering from failure
•One puzzle to the nextOne puzzle to the next
•One section to the nextOne section to the next
You also need to think about the transitions between puzzles. Whenever the player moves from one place to another in your game, there is an opportunity to lose the player’s interest. How can you bridge these gaps?
8. Presentation8. Presentation
Finally there are all the matters of presentation that turn an abstract puzzle into something people can see, hear and touch. I won’t go into detail on production for puzzle games.
Scripting Engine• Scripting languages in game engines:• • Advantages:
– Easy control of many (or all) features in the game engine
– Scripting language often provides full OO control (like Lua)
– Promotes data-driven design
• Disadvantages:– Performance– Development support tools– Learning curve
Scripting Engine
Common languages used for scripting:• Python
– http://www.python.org
• Lua– http://www.lua.org
• GameMonkey– http://www.somedude.net/gamemonkey
• AngelScript– http://www.angelcode.com/angelscript
Scripting Engine
• ENGINE– Graphics
• Rendering• Shadows/Lighting• Occlusion Culling
– Physics• Dynamics• Collision detection• Raycasts
– AI• Pathfinding• Fuzzy controllers• Planning/A* search
• SCRIPT– Graphics
• Time-of-Day• Add/Remove lights• Loading/moving
objects– Physics
• Object mass/friction• Collision events• Raycasts events
– AI• Path selection• Decision making• Goals/objectives
•What belongs in a script and what belongs in the engine?
Interfacing Between Game Engine Interfacing Between Game Engine and Scripting Languagesand Scripting Languages
• There is an increasing demand for There is an increasing demand for customizable applications and make customizable applications and make configuration decisions at execution time. configuration decisions at execution time. Users also want to write macros and scripts Users also want to write macros and scripts to increase productivity. to increase productivity.
• Split complex system into two parts: kernel Split complex system into two parts: kernel and configuration. and configuration. – The kernel implements the basic classes and The kernel implements the basic classes and
objects of the system. objects of the system. – The configurations part, connects these classes The configurations part, connects these classes
and objects to give the final shape to the and objects to give the final shape to the application1. application1.
– Requires interfacing between the main engine and Requires interfacing between the main engine and the scripting layerthe scripting layer
What interface should the What interface should the game engine provide?game engine provide?
• There are several tasks the main engine There are several tasks the main engine of a game should provide to the of a game should provide to the underlying scripting engineunderlying scripting engine
1.1. Store local and global variablesStore local and global variables
2.2. Getting a reference to an object or a set of Getting a reference to an object or a set of objects in the worldobjects in the world
3.3. Access properties of objects, and ask them to Access properties of objects, and ask them to perform actionsperform actions
4.4. Provide a timing mechanismProvide a timing mechanism
5.5. Writing custom event handlersWriting custom event handlers
6.6. Building the static world at run timeBuilding the static world at run time
7.7. Goal setting and modificationGoal setting and modification
8.8. Debugging scriptsDebugging scripts
Store local and global Store local and global variablesvariables::• The game engine should allow the script to The game engine should allow the script to
store local and global variables. store local and global variables. – The engine should be responsible for allocating The engine should be responsible for allocating
memory for those variables, deallocating them, memory for those variables, deallocating them, and keeping track of variable values. and keeping track of variable values.
– local variables are local to a certain object. For local variables are local to a certain object. For example, the script can decide to add an example, the script can decide to add an “anger” factor for each character in the game. “anger” factor for each character in the game. This would be stored as a local variable for the This would be stored as a local variable for the character. character.
– A global variable has just one instance overall A global variable has just one instance overall the system. This would include time of day, the system. This would include time of day, gravity, and so on.gravity, and so on.
Getting a reference to an Getting a reference to an object or a set of objects in object or a set of objects in the worldthe world::• The script should be able to query the game The script should be able to query the game
engine to return a reference to one object, or a engine to return a reference to one object, or a set of objects obeying certain criteria. For set of objects obeying certain criteria. For example, the script should be able to ask the example, the script should be able to ask the engine to get a reference to the main player, to engine to get a reference to the main player, to the nearest monster to the main player, or to the nearest monster to the main player, or to the set of monsters of a certain kind. This is one the set of monsters of a certain kind. This is one of the cases where the interface will strongly of the cases where the interface will strongly depend on the game engine. For example, if not depend on the game engine. For example, if not all objects are stored in memory at the same all objects are stored in memory at the same time, the script may not be able to get a time, the script may not be able to get a reference to all objects in the level (only the reference to all objects in the level (only the active ones). The engine should be designed to active ones). The engine should be designed to hide these internal details as much as possible.hide these internal details as much as possible.
Access properties of objects, Access properties of objects, and ask them to perform and ask them to perform actionsactions::• This follows naturally from point 2 This follows naturally from point 2
above. Once the script has obtained above. Once the script has obtained a reference to an object, it should a reference to an object, it should be able to read properties (health, be able to read properties (health, location, …), change properties, or location, …), change properties, or ask objects to perform certain ask objects to perform certain actions (get angry, walk to point X,actions (get angry, walk to point X,… etc)… etc)
Provide a timing Provide a timing mechanismmechanism::
• The game engine should provide the The game engine should provide the scripting engine with a timing scripting engine with a timing mechanism. The script should be able mechanism. The script should be able to ask the engine to call a certain to ask the engine to call a certain function each X seconds. Again, the function each X seconds. Again, the engine should support both local and engine should support both local and global timers. Local timers are called global timers. Local timers are called per object. Global timers are called per object. Global timers are called once for the entire game.once for the entire game.
Writing custom event Writing custom event handlershandlers::
• Writing custom event handlersWriting custom event handlers: The : The scripting engine should be able to write scripting engine should be able to write custom event handlers for characters. custom event handlers for characters. This should include writing custom event This should include writing custom event handlers for what a character should do handlers for what a character should do when it gets angry, when it needs to move when it gets angry, when it needs to move between 2 points, and so on. The list of between 2 points, and so on. The list of events the script can override clearly events the script can override clearly depends very much on the game, and the depends very much on the game, and the nature of character under control.nature of character under control.
Building the static world at run Building the static world at run timetime::
• This is one of the features that are very hard to This is one of the features that are very hard to support for technological reasons. Static levels support for technological reasons. Static levels are usually compiled offline. Changing the world are usually compiled offline. Changing the world at run time may not be feasible for some at run time may not be feasible for some games, but adding it adds more power to the games, but adding it adds more power to the scripting language. For example, building a scripting language. For example, building a random level can become feasible in this case random level can become feasible in this case (for example, turning Doom 3 into randomly (for example, turning Doom 3 into randomly generated pacman game!). At least, changing generated pacman game!). At least, changing some properties of the static world should be some properties of the static world should be allowed. Examples include changing allowed. Examples include changing translucency of certain walls.translucency of certain walls.
Goal setting and Goal setting and modificationmodification::
• Goal setting and modificationGoal setting and modification: This is : This is really a special case of object referencing, really a special case of object referencing, but it deserves separate mention. The but it deserves separate mention. The game engine should allow the script to game engine should allow the script to specify the criteria for achieving certain specify the criteria for achieving certain goals, and ending the level. Internally, the goals, and ending the level. Internally, the goals may be represented as just special goals may be represented as just special objects, therefore, this could be a special objects, therefore, this could be a special case of object referencing and case of object referencing and modification. However, script writers need modification. However, script writers need not know about that.not know about that.
Debugging scriptsDebugging scripts::
• The game engine should make The game engine should make script debugging as easy as script debugging as easy as possible. This includes at least possible. This includes at least allowing the scripts to print allowing the scripts to print debugging messages. More debugging messages. More advanced cases could allow logging advanced cases could allow logging variables, call stacks and so on.variables, call stacks and so on.
What interfaces should the What interfaces should the game engine NOT providegame engine NOT provide
• This is the list of taboos. In other This is the list of taboos. In other words, what interfaces should the words, what interfaces should the game engine not provide to the game engine not provide to the scripting engine. Providing those scripting engine. Providing those interfaces only causes confusion to interfaces only causes confusion to script writers, makes the engine script writers, makes the engine unstable, or will be very hard to unstable, or will be very hard to implement correctly without adding implement correctly without adding sufficient value to compensate for all sufficient value to compensate for all the efforts.the efforts.
Reveal rendering Reveal rendering algorithmalgorithm::
• Allowing the scripts to control the Allowing the scripts to control the rendering engine is not a good idea. rendering engine is not a good idea. Usually, script writers will not be able Usually, script writers will not be able to understand or write efficient code. to understand or write efficient code. This is one of the areas best left This is one of the areas best left untouched.untouched.
Reveal memory allocation Reveal memory allocation algorithmalgorithm::
• Allowing the scripts to allocate Allowing the scripts to allocate memory explicitly is a bad idea. memory explicitly is a bad idea. Untalented script writers will end up Untalented script writers will end up creating really inefficient mods.creating really inefficient mods.
Allow scripts to escape from the Allow scripts to escape from the sandboxsandbox::
• This is the most dangerous of all. Gamers usually This is the most dangerous of all. Gamers usually assume game mods are safe. Allowing script assume game mods are safe. Allowing script writers to escape from the sandbox is a writers to escape from the sandbox is a nightmarish scenario. Gamers innocently install nightmarish scenario. Gamers innocently install game mods. This becomes worse when game game mods. This becomes worse when game servers install new maps (potentially including servers install new maps (potentially including scripts), which could compromise security of the scripts), which could compromise security of the client computer. In this case, you can innocently client computer. In this case, you can innocently join a deathmatch game, and end up with a join a deathmatch game, and end up with a spyware or virus on your computerspyware or virus on your computer