Gameplay Presented by: Marcin Chady

Similar documents
Introduction. What do we mean by gameplay? AI World representation Behaviour simulation Physics Camera

CS 354R: Computer Game Technology

INTRODUCTION TO GAME AI

Introduction to Game Design. Truong Tuan Anh CSE-HCMUT

Killzone Shadow Fall: Threading the Entity Update on PS4. Jorrit Rouwé Lead Game Tech, Guerrilla Games

CRYPTOSHOOTER MULTI AGENT BASED SECRET COMMUNICATION IN AUGMENTED VIRTUALITY

Chapter 1:Object Interaction with Blueprints. Creating a project and the first level

VACUUM MARAUDERS V1.0

Tutorial: Creating maze games

CISC 1600, Lab 2.2: More games in Scratch

Tac Due: Sep. 26, 2012

Making Simple Decisions CS3523 AI for Computer Games The University of Aberdeen

Game Programming Paradigms. Michael Chung

In the end, the code and tips in this document could be used to create any type of camera.

BE SURE TO COMPLETE HYPOTHESIS STATEMENTS FOR EACH STAGE. ( ) DO NOT USE THE TEST BUTTON IN THIS ACTIVITY UNTIL THE END!

Program a Game Engine from Scratch. Chapter 1 - Introduction

Adding in 3D Models and Animations

Z-Town Design Document

Game Maker Tutorial Creating Maze Games Written by Mark Overmars

Toon Dimension Formal Game Proposal

Introduction Installation Switch Skills 1 Windows Auto-run CDs My Computer Setup.exe Apple Macintosh Switch Skills 1

Video Game Engines. Chris Pollett San Jose State University Dec. 1, 2005.

Experiment 02 Interaction Objects

Introducing Scratch Game development does not have to be difficult or expensive. The Lifelong Kindergarten Lab at Massachusetts Institute

the gamedesigninitiative at cornell university Lecture 10 Game Architecture

Space Invadersesque 2D shooter

Basic AI Techniques for o N P N C P C Be B h e a h v a i v ou o r u s: s FS F T S N

CONCEPTS EXPLAINED CONCEPTS (IN ORDER)

the gamedesigninitiative at cornell university Lecture 5 Rules and Mechanics

IMGD 1001: Programming Practices; Artificial Intelligence

Abandon. 1. Everything comes to life! 1.1. Introduction Character Biography

Project: Circular Strife Paper Prototype Play-test IAT Team Members: Cody Church, Lawson Lim, Matt Louie, Sammpa Raski, Daniel Jagger

GAME DESIGN DOCUMENT HYPER GRIND. A Cyberpunk Runner. Prepared By: Nick Penner. Last Updated: 10/7/16

IMGD 1001: Programming Practices; Artificial Intelligence

Physical Gameplay in Half-Life 2. presented by Jay Stelly Valve Corporation. All Rights Reserved.

Maniacally Obese Penguins, Inc.

CS 387/680: GAME AI DECISION MAKING. 4/19/2016 Instructor: Santiago Ontañón

Exam #2 CMPS 80K Foundations of Interactive Game Design

G54GAM - Games. So.ware architecture of a game

A New Simulator for Botball Robots

Princess & Dragon Version 2

MENU. Neurofeedback Games & Activities

Suspending Disbelief: Bringing Your Characters to Life With Better AI. Steve Gargolinski Phil Carlisle Michael Mateas

Principles of Computer Game Design and Implementation. Lecture 29

Development Outcome 2

Key Abstractions in Game Maker

True bullet 1.03 manual

Module 4 Build a Game

2D Platform. Table of Contents

PING. Table of Contents. PING GameMaker Studio Assignment CIS 125G 1. Lane Community College 2015

G54GAM Lab Session 1

Intelligent Driving Agents

Individual Test Item Specifications

Maze Puzzler Beta. 7. Somewhere else in the room place locks to impede the player s movement.

Grading Delays. We don t have permission to grade you (yet) We re working with tstaff on a solution We ll get grades back to you as soon as we can

A. creating clones. Skills Training 5

G54GAM - Games. Balance So2ware architecture

MULTI AGENT SYSTEM WITH ARTIFICIAL INTELLIGENCE

Procedural Level Generation for a 2D Platformer

CREATURE INVADERS DESIGN DOCUMENT VERSION 0.2 MAY 14, 2009

Strategic and Tactical Reasoning with Waypoints Lars Lidén Valve Software

the gamedesigninitiative at cornell university Lecture 4 Game Components

Sensible Chuckle SuperTuxKart Concrete Architecture Report

Pangolin: A Look at the Conceptual Architecture of SuperTuxKart. Caleb Aikens Russell Dawes Mohammed Gasmallah Leonard Ha Vincent Hung Joseph Landy

Tutorial: A scrolling shooter

Spell Casting Motion Pack 8/23/2017

Active Item: The Active Item displays the current selected item. In the following image, the Cargo Pants are the active item.

ART 269 3D Animation The 12 Principles of Animation. 1. Squash and Stretch

TATAKAI TACTICAL BATTLE FX FOR UNITY & UNITY PRO OFFICIAL DOCUMENTATION. latest update: 4/12/2013

Our different time phases on the DADIU semester was as following:

HERO++ DESIGN DOCUMENT. By Team CreditNoCredit VERSION 6. June 6, Del Davis Evan Harris Peter Luangrath Craig Nishina

Tac 3 Feedback. Movement too sensitive/not sensitive enough Play around with it until you find something smooth

Supporting the Design of Self- Organizing Ambient Intelligent Systems Through Agent-Based Simulation

PETEY S GREAT ESCAPE TEAM PENGUIN CONSISTS OF: ALICE CAO, ARIAN GIBSON, BRYAN MCMAHON DESIGN DOCUMENT VERSION 0.5 JUNE 9, 2009

CS 480: GAME AI TACTIC AND STRATEGY. 5/15/2012 Santiago Ontañón

Step 1 - Setting Up the Scene

Thesis Project - CS297 Fall David Robert Smith

The purpose of this document is to outline the structure and tools that come with FPS Control.

Official Documentation

the gamedesigninitiative at cornell university Lecture 3 Design Elements

3D Modelling and Animation (F21MA) Flex Project Professor Mike Chantler. Drew Forster Ulysse Vaussy

Starting from LEARNER NOTES edited version. An Introduction to Computing Science by Jeremy Scott

Who am I? AI in Computer Games. Goals. AI in Computer Games. History Game A(I?)

Mr. Giansante. Alice. 3D Programming

DEVELOPMENT PROPOSAL

Virtual Environments. Ruth Aylett

Getting Started with Osmo Coding. Updated

Module 1 Introducing Kodu Basics

Who Am I? Lecturer in Computer Science Programme Leader for the BSc in Computer Games Programming

Game Architecture. Rabin is a good overview of everything to do with Games A lot of these slides come from the 1 st edition CS

TEMPLE OF LOCKS V1.0

Overview. The Game Idea

A tutorial on scripted sequences & custsenes creation

MESA Cyber Robot Challenge: Robot Controller Guide

From the ID Foreward. By Dr. James Foley

Lights, Camera, Literacy! LCL! High School Edition. Glossary of Terms

What is Nonlinear Narrative?

CS 387/680: GAME AI AI FOR FIRST-PERSON SHOOTERS

Designing AI for Competitive Games. Bruce Hayles & Derek Neal

04. Two Player Pong. 04.Two Player Pong

Transcription:

Gameplay Presented by: Marcin Chady

Introduction What do we mean by gameplay? Interaction between the player and the game Distinguishing factor from non-interactive like as film and music Sometimes used interchangeably with game mechanics Gameplay components Game rules AI World representation Behaviour simulation Physics Camera

What Do We Mean by AI? Making the AI challenging is not the hard part The game is omniscient and omnipotent, so it can always kick your ass if it chooses to The trick is in making AI that is challenging yet realistically flawed Video games use a different definition of AI A lot of what games call AI isn't really intelligence at all, just gameplay AI is the group of components that control the objects in the game The AI is the heart of the game, and has the most influence on how much fun the game is

World Representation The AI needs to keep track of all of the objects in the game An insultingly simple example: We can represent a tic-tac-toe board as a two dimensional array of characters A slightly less insulting example: A Pong game consists of the coordinates of the ball, and the positions of the paddles, as well as the locations of the walls More complicated games typically do not have a fixed set of game entities Need a dynamic data structure to manage entities

World Representation Purpose Some important first questions: How large is the world? How complex is the world? How far can you see? What operations will be performed? Visibility Audibility Path finding Proximity detection Collision detection Sending messages to groups of entities Dynamically loading sections of the world

World Representation: Single List Simplest approach: one big list All search operations are pretty expensive But all operations are about the same i.e. no slower to search by name than by position Storage space and algorithm complexity are low Good for extremely simple games (< 100 entities) Can make it a little more useful with multiple lists In more complicated structures each world node may have a list of entities in that node

Spatial World Representation Spatial data structures KD trees BSP Grid Graph Whatever Dictionary Spatial hashing Hybrid Big games use multiple techniques at the same time or different techniques for different kind of data each optimised for the particular queries on that data

Sphere of Influence Rather than simulating thousands of entities in a large world, many games maintain a small bubble of activity around the player Or around the camera Could be somewhat off-centre Keeps the activity centered around the player The world outside the sphere is downgraded in fidelity, or shut off entirely Typically multiple spheres for different types of entities Typically tied to level-of-detail (LOD) systems Entities can be recycled as they leave the sphere Strive to recycle objects that aren't visible Or fade them in/out gently in the distance

Some Scenarios Prototype ambience spawn spheres: Prototype prop system: Props weighted by whether they re on camera distance from camera physics state mission relevance size Only N highest-weighted props are spawned Culled props have their state saved to be restored later Some objects should be active well outside the normal sphere Goals, powerups, mission-critical entities

Dynamic Entities The world is populated with a variety of dynamic entities: players (human & AI controlled) props power-ups rockets miscellaneous stuff that moves, animates, thinks, changes state, or otherwise reacts to the game situation Usually modeled with: simplified spatial representation (for collision detection) state (idle, fighting, patrolling, dead, etc.) attributes (maximum speed, colour, health, etc.) Many ways to organize this data Covered in the Game Architecture lecture

Entity Behaviour We want our entities to do interesting things Two major strategies employed: Programming behaviour Simulating behaviour For example, consider the FPS cliché of the exploding barrel How do we model this behaviour?

Programming Behaviour Explicitly add individual behaviours to entities function barrel::collide(hit_by) if hit_by.type == bullet damage += 10 if damage >= 100 PlayAnimation(exploding) PlaySound(exploding_barrel) DestroySelf() end end End Comments?

Comments Simple to implement Good for one-off, unique game events Cut-scene triggers Not flexible Misses out on emergent opportunities No splash damage or chain reaction explosions Doesn't explode when hit by rockets unless explicitly modified to do so Extending this model to complex interactions makes the code unwieldy Numerous permutations have to be explicitly coded

Simulating Behaviour Define a few high-level rules that affects how objects behave Combine these rules in interesting ways when objects interact This is what computers are for, after all Properties of objects: GivesDamage(radius, amount) MaxDamageAbsorb(amount) Object will break if it absorbs enough damage BreakBehaviour(disappear explode) Disappear destroys entity Explode destroys entity, and spawns a shock wave entity in its place

Entity Properties Entities in this example, and their properties: Bullet GivesDamage = 0.01, 10 MaxDamageAbsorb = 0 BreakBehaviour = disappear Barrel MaxDamageAbsorb = 100 BreakBehaviour = explode Shockwave GivesDamage = 5.0, 50

Explosion Behaviour function entity::collide(hit_by) damage += hit_by.givesdamage if damage > MaxDamageAbsorb switch BreakBehaviour case disappear: DestroySelf() case explode: Spawn(shockwave, position) DestroySelf() end end end

Comments Observed behaviour the same as the first example when a lone barrel is shot A lot of nice behaviour can emerge Splash damage and cascading barrel explosions Non bullet objects causing damage can be added easily Easy to add new properties and rules A rocket is just a bullet with BreakBehaviour = explode Different damage classes e.g. electrical damage that only harms creatures, but doesn't affect inanimate objects CanBurn, EmitsHeat properties with rules for objects bursting into flames It doesn't take many of these rules to create a very rich environment Be careful about undesired emergent behaviour

Triggers Very common way to initiate entity behaviour Common types: Volume Time When the trigger condition is met (player occupies trigger volume, timer runs out, etc.): Send event Run script Execute callback Triggers can be One-shot Edge-triggered Continuous Games typically have a well developed trigger system available

State Machines Get Up Fall Idle Run Walk State machines are used to control moderate to complex AI behaviour Often implemented in an ad-hoc manner with a big case statement Fine for relatively simple state machines

Civilian States in Hulk: Ultimate Destruction Standing Walking Startled Running Cowering Held Animating Flying Falling HitWall HitGround Rolling LyingDown GettingUp TurningAround Sliding

FSM Scripting at Radical Fight Tree: a combination of Hierarchical state machine Motion graph Decision tree A state node is one or more action objects that are implemented in C++ or Lua E.g. play animation, play sound, start effect, run script, etc. Each action supports Init(), Update(), Exit() methods Also supported: jump to new state, spawn (layer) new state Spawned states operate like threads Makes the state machine hierarchical One action in any state can be a master, all others are slaves When master action ends, state exits

Motion Node Example Time Play Hit Animation on the attacking character Block Opportunity Exit to another node Play Hit Sound Play Hit Animation on the character being hit Apply damage to the character being hit

State Transitions in the Fight Tree Different ways transitions can be initiated: All master actions in current node complete Next state is determined by evaluating the tree from the top Or by a sequence action present in the completed node Forced by the game Explicitly, through Execute action Spawn action Opportunity action, if conditions are met Conditions: Small C++ or Lua objects that query game state and return true or false Example: trigger entered, event fired, time elapsed, animation frame reached, etc. Can be chained together with AND, OR, NOT

Sequencing Actions The default behaviour is that all actions that make up a state logically run simultaneously Often you want a queue or stack of actions, and run them sequentially Build up complex operations by queuing actions When each action is finished the queue is advanced or the stack is popped Decouples states in large state machines quite a bit States don't always need all the information to decide what state to go to next States can be much more fine grained

Control The AI needs to map input events to actual game play behaviour It s useful to think of that happening in two steps: Events map to intentions Intentions map to behaviour within constraints Intentions are gameplay-level abstractions of user input

Mapping Events to Intentions The AI interprets a button press as an intention to perform a certain action Often this is a simple mapping, but it can become complex depending on the game For example, some games have camera-relative controls Fighting games require queueing of inputs Combos

Mapping Intentions to Behaviours There are constraints on allowable behaviours These constraints can be quite complex Physical constraints Logical constraints (rules) Rules can be implemented using conditions on state machines In Prototype, there are a bunch of conditions that drive the main character's state machine based upon player's input Likewise, enemy logic generates virtual button presses that are processed in the same way.

Physics What do we mean by physics Rules by which objects move and react in the gameplay environment This doesn't necessarily imply a sophisticated rigid body dynamics system Pong modelled ideal inelastic collisions pretty well In fact, real physics is usually just a tool in the box Game physics implementors have considerably more latitude to change the rules A lot of physics can be faked without going to a dynamics engine How is physics used in a modern game?

Uses of Physics Collision detection Detect interactions of entities in the environment, e.g. triggers Animation Complex shapes and surfaces (chains, cloth, water) Realistic environment interactions (bounce, tumble, roll, slide) Reaction to forces (explosions, gravity, wind) Augment canned animation with procedural animation Hit reactions, rag doll Gameplay mechanics Physics puzzles Driving, flying Compute damage Generate sounds

AI Use of Physics Generally the AI keeps the physics system reigned in Objects only go into full simulation mode under specific circumstances and often only for a limited period of time Example from Prototype: Traffic cars generally slide around the world on rails If an object appears in the car's visibility cone, it comes to a gradual stop Traffic cars in rail mode can impart forces on other objects (peds) If the car collides with another car, the AI puts it into full simulation AI computes an impact force based upon collision information, and tunables Car is placed under control of the rigid body system, and allowed to bounce around until it comes to rest Then the car is put to sleep (removed from rigid body system) If it s damaged it never returns to AI control

Interactions Between Objects As we ve seen in the example, some objects in the world are under physics control, and other are under AI control What happens when they collide? To the physics system, AI controlled objects don't follow the rules Velocities, positions are under AI control Properties like mass, and friction, and restitution may not be defined for AI controlled entities There needs to be a mechanism to compute plausible forces to pass to the physics system to apply to the simulated object Likewise, the AI controlled object will have some sort of collision response programmed into it Play animation, move object, apply damage, trigger sounds, change entity state, etc.

Physics Hand-off When the AI places an object into full simulation, it sets up the initial conditions for the object's rigid body Position, velocity, angular velocity In the simplest form, the AI-managed position and velocities are copied into the rigid body There may be considerable massaging of the conditions to make the response more interesting, or realisticappearing Example from Hulk 2 and Prototype: When Hulk elbows a car, angular velocity is carefully chosen to make it launch up into the air, tumble end-over-end (with variation), and land close behind him Thrown objects are kept out of general physics simulation until they hit something

Tuning Physical simulations can produce a lot of emergent behaviour This can be good Adds variety to gameplay and presentation Players can discover or create situations that weren't envisioned by the designer This can be bad Players can discover or create situations that weren't envisioned by the designer Exploits, bugs, other bizarre behaviour Emergent systems are hard to tune!

Realism, Accuracy and Fun Realism is a powerful tool, but it is not the end goal for video games. There are differences between what people believe is realistic, and real-world behaviour. Real realism is usually pretty boring Games provide a small amount of feedback and control compared to their real-life counterparts Physical simulation and hacks can live comfortably sideby-side.

Cameras AI camera models are usually motivated by: Gameplay goals Need to see player Need to see important AI entities Intuitive controls Cinematic goals Look cool Camera design is primarily an AI / gameplay issue Not rendering!

Camera Models Simple camera models: Fixed: the camera never moves Tracking: the camera doesn t move, but points at an interesting object Follow: the camera follows at a distance behind the target More sophisticated camera systems handle things like: obstacle avoidance framing line of sight Instant replay camera: Scripted camera animations User controlled cameras Artists controlled cameras Shot setup and animation done in 3D modeling/animation tool

Camera Models for Driving Games First-person Glue camera to bumper Tune field-of-view to create enhanced sense of speed More effective than tuning actual vehicle speed Third-person Camera tracks behind the car at some distance Perfect tracking doesn't look good Car is locked to the centre of the screen Add anticipation and lag to the camera movement When braking, move camera closer When accelerating, move further Look into direction of turns Lower/raise camera based on velocity of car Don't spin camera right away if car is spinning

Summary Gameplay is huge Touches on every part of the system Needs every trick from the bag Many areas weren t covered Path finding Will talk about it in the driving lecture Enemy AI Too wide and game-specific to cover here AI animation control Covered superficially when talking about Radical s Fight Tree Will talk about it a bit later