G54GAM - Games. So.ware architecture of a game

Similar documents
G54GAM - Games. Balance So2ware architecture

Introduction to Game Design. Truong Tuan Anh CSE-HCMUT

G54GAM Lab Session 1

CS 354R: Computer Game Technology

The Game Development Process

In this project you ll learn how to create a times table quiz, in which you have to get as many answers correct as you can in 30 seconds.

INTRODUCTION TO GAME AI

G54GAM Coursework 2 & 3

Analyzing Games.

Z-Town Design Document

Tutorial: Creating maze games

Game Maker Tutorial Creating Maze Games Written by Mark Overmars

Game Programming Paradigms. Michael Chung

Program a Game Engine from Scratch. Chapter 1 - Introduction

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

Once this function is called, it repeatedly does several things over and over, several times per second:

Outline. Introduction to Game Programming Autumn Game architecture. The (classic) game loop. Fundamental concepts

A RESEARCH PAPER ON ENDLESS FUN

MULTI AGENT SYSTEM WITH ARTIFICIAL INTELLIGENCE

VACUUM MARAUDERS V1.0

SPACEYARD SCRAPPERS 2-D GAME DESIGN DOCUMENT

Create Your Own World

Ac#on vs. Interac#on CS CS 4730 Computer Game Design. Credit: Several slides from Walker White (Cornell)

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

Sensible Chuckle SuperTuxKart Concrete Architecture Report

Surfing on a Sine Wave

3D Top Down Shooter By Jonay Rosales González AKA Don Barks Gheist

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

CISC 1600, Lab 2.2: More games in Scratch

BooH pre-production. 4. Technical Design documentation a. Main assumptions b. Class diagram(s) & dependencies... 13

GAME:IT Junior Bouncing Ball

the gamedesigninitiative at cornell university Lecture 3 Design Elements

Flappy Parrot Level 2

Pangolin: A look at the conceptual Architecture of Super Tux Kart. A CISC 326 Project by:

the gamedesigninitiative at cornell university Lecture 3 Design Elements

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

ADVANCED TOOLS AND TECHNIQUES: PAC-MAN GAME

Brain Game. Introduction. Scratch

the gamedesigninitiative at cornell university Lecture 10 Game Architecture

Towards a Reference Architecture for 3D First Person Shooter Games

GALAXIAN: CSEE 4840 EMBEDDED SYSTEM DESIGN. Galaxian. CSEE 4840 Embedded System Design

12 Final Projects. Steve Marschner CS5625 Spring 2016

2D Platform. Table of Contents

A retro space combat game by Chad Fillion. Chad Fillion Scripting for Interactivity ITGM 719: 5/13/13 Space Attack - Retro space shooter game

Instructions for using Object Collection and Trigger mechanics in Unity

Term 1 Assignment. Dates etc. project brief set: 20/11/2006 project tutorials: Assignment Weighting: 30% of coursework mark (15% of overall ES mark)

Arcade Game Maker Product Line Requirements Model

Tac Due: Sep. 26, 2012

Design Document for: Name of Game. One Liner, i.e. The Ultimate Racing Game. Something funny here! All work Copyright 1999 by Your Company Name

Experiment 02 Interaction Objects

Scratch for Beginners Workbook

the gamedesigninitiative at cornell university Lecture 3 Design Elements

Capture the Flag Design Document Authors: Luke Colburn, Tyler Johnson, Chris LaBauve

Top-Down Shooters DESMA 167B. TaeSung (Abraham) Roh

CS 354R: Computer Game Technology

GAME PROGRAMMING & DESIGN LAB 1 Egg Catcher - a simple SCRATCH game

Concrete Architecture of SuperTuxKart

Online Games what are they? First person shooter ( first person view) (Some) Types of games

Assessment. Self Assessment. Teacher Assessment. Date Learning Objective(s) Achievement or. NC Level: Game Control Student Booklet P a g e 1

the gamedesigninitiative at cornell university Lecture 23 Strategic AI

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

The Guerrilla Guide to Game Code

Overview. The Game Idea

Key Abstractions in Game Maker

Mobile and web games Development

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

A. creating clones. Skills Training 5

In this project we ll make our own version of the highly popular mobile game Flappy Bird. This project requires Scratch 2.0.

English as a Second Language Podcast ESL Podcast 295 Playing Video Games

Using Player Profiling to Enhance Dynamic Difficulty Adjustment in Video Games

GameMaker. Adrienne Decker School of Interactive Games and Media. RIT Center for Media, Arts, Games, Interaction & Creativity (MAGIC)

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

Game Design Document (GDD)

Turtlebot Laser Tag. Jason Grant, Joe Thompson {jgrant3, University of Notre Dame Notre Dame, IN 46556

Space Cadet Grades K-2 Scope and Sequence

Artificial Intelligence (AI) Artificial Intelligence Part I. Intelligence (wikipedia) AI (wikipedia) ! What is intelligence?

Evolving Parameters for Xpilot Combat Agents

Tutorial: A scrolling shooter

Music as a Game Obstacle

1 Shooting Gallery Guide 2 SETUP. Unzip the ShootingGalleryFiles.zip file to a convenient location.

Design of Embedded Systems - Advanced Course Project

Fpglappy Bird: A side-scrolling game. Overview

Quake III Fortress Game Review CIS 487

Create a Simple Game in Scratch

Toon Dimension Formal Game Proposal

Star Defender. Section 1

GAME:IT Junior Bouncing Ball

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

Create Your Own World

Kodu Game Programming

Key Abstractions in Game Maker

Interactive Media and Game Development Master s

USING A FUZZY LOGIC CONTROL SYSTEM FOR AN XPILOT COMBAT AGENT ANDREW HUBLEY AND GARY PARKER

the gamedesigninitiative at cornell university Lecture 5 Rules and Mechanics

Team: Couch Potato Gaming. Ohio State Computer Science/Engineering 5912 Capstone. Game Design Document

CRYPTOSHOOTER MULTI AGENT BASED SECRET COMMUNICATION IN AUGMENTED VIRTUALITY

Type to enter text. GoSphero.com

Gameplay Presented by: Marcin Chady

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

The Beauty and Joy of Computing Lab Exercise 10: Shall we play a game? Objectives. Background (Pre-Lab Reading)

Transcription:

G54GAM - Games So.ware architecture of a game

Coursework Coursework 2 and 3 due 18 th May Design and implement prototype game Write a game design document Make a working prototype of a game Make use of the lab sessions to discuss your ideas Coursework document on the website hfp://www.cs.nof.ac.uk/~mdf/ teaching_g54gam.html

Now what? Now that we have our game design, how do we go about building it? Complex interacqve system We need to plan it otherwise it becomes a mess Difficult to understand Difficult to maintain Difficult to extend Games must be designed, but computers must be programmed SQll mainly naqve C, C++ However we can write a game in any language we wish

InteracQve System Game makes internal decision Internal Processes Input Output Player takes action Game creates outputs

How do we put it all together? Inputs Mouse, keyboard, controller Internal Processes Evolving Game State Objects, Rules, Procedures Outputs Graphics Sound User Interface

What are common game system components?

How do we put it all together? User interface ConfiguraQon and selecqon Help Input / HUD Game Logic Loading Script Physics Engine ArQficial Intelligence Events Collisions Network communicaqon Outputs Graphics renderer Sound and music

How do we put it all together? Game State PosiQon, orientaqon, velocity of all dynamic enqqes Behaviour and intenqons of AI controlled characters Dynamic, and staqc afributes of all gameplay enqqes Scores, health, powerups, damage levels All sub- systems in the game are interested in some aspect of the game state. Renderer, Physics, Networking, and Sound systems need to know posiqons of objects Many systems need to know when a new enqty comes into or goes out of existence AI system knows when player is about to be afacked sound system should play ominous music when this happens

Time and The Game Loop The heart beat of a game Performs a series of tasks every frame Game state changes over Qme Each frame is a snapshot of the evolving game state A series of frames are perceived as movement E.g. 60 frames per second Run as fast as we can? A smooth game- play experience

The Game Loop start game while( user doesn't exit ) { } exit get user input get network messages simulate game world resolve collisions move objects draw graphics play sounds

The Game Loop start game while( user doesn't exit ) { } exit how much /me has elapsed? get user input get network messages simulate game world(elapsed /me) resolve collisions move objects draw graphics play sounds wait (a fixed amount of /me)

CPU Graphics

CPU Graphics CPU Graphics

Decoupling Check input As fast as possible As fast as possible Draw Frame when possible Update State 1/frequency

Decoupling How it plays Check input Interpolate MoQon fixed frequency As fast as possible Update SimulaQon 1/frequency Draw Frame when possible How it looks

Model- View- Controller An architectural design pafern Used to isolate logic from user- interface Model The informaqon of the applicaqon View The user interface and display of informaqon Controller Manages the communicaqon of informaqon and manipulaqon of the model

Controller View Model

Game MVC Architecture Model The state of every game object and enqty The rules of the game world The physics simulaqon Knows nothing about user input or display View Renders the model to the screen Uses the model to know where to draw everything Controller Handles user input and manipulates the model

Controller - What did the player do? - Time elapsed? View - Renderer and Sprites Model - Rules - Objects

Quake MVC Architecture Model An abstract 3d environment PosiQons and orientaqons change over Qme View Render the 3d environment Display complex avatars and animaqons Fancy effects Controller Tell the model that I want to move, shoot, jump Tell the model that 1/50 th of a second has elapsed

Player -(x,y,z) - velocity - Klesk avatar - Railgun - No ammo - Bounding box

Why MVC is popular / good Nice modular design Decouple game design from renderer Game world logic is bundled in the model Changes to the renderer / graphics do not affect the rest of the game Easily supports different input controllers and/ or bots and AI Helpful when we think about networked games

Structuring the Model Model Objects Rules Together create game world and state Objects need to communicate with one another Objects need to obey rules and procedures Objects need to be able to do things by themselves How do we structure this sensibly?

Direct CommunicaQon Object A afempts to pick up object B Who checks if B can be picked up Which funcqons A must call in B to reflect pick- up Many condiqonal statements Bullet hits player Who decides what happens? The player is damaged The bullet is destroyed Where do we put the logic? Why is this a poor design choice? ExponenQal complexity Every object needs to know how to interact with every other object Very Qme consuming to add new objects

EncapsulaQon and Inheritance Generalise the kinds of funcqons that objects must respond to, and encapsulate this funcqonality within the object Build an object hierarchy Objects look a.er themselves adding new objects is trivial FuncQons Update() - Calculate where I am now Render() - How I am drawn on screen Subsystems iterate object collecqons, but are dumb! for(object o : all the objects) { } o.update(); o.render();

Events Games are inherently event driven Anything of interest that happens Explosion goes off, coin being picked up Need a mechanism to Inform relevant objects that something has happened Respond (handle) the event in some way Event subsystem O.en provided by a game engine to make our lives easier

Events Physics simulaqon A bullet has collided with the player Could tell all interested objects directly? Bullet, player, scoreboard, health, walls, floor, sky Broadcast an event Objects listen for parqcular events to handle Ignore events we don t care about Scenery doesn t care about the score Makes it easy to add new events Objects can prioriqse events in different ways Dynamically register and unregister interest in events Changing context

Game Subsystem publish subscribe Player Enemy Event Queue Bullet Score Controller

Finite State Machines Events allow objects and subsystems to talk to one another FSMs allow objects to be autonomous Evolve from exploding to destroyed ArQficial Intelligence / bots Literally A finite number of states Ac/ons allow the object to transi/on between states

Hunter - chases Pac Man Timer expires Pac Man eats power pill Ghost returns to base Hunted - evades Pac Man Pac Man eats ghost Eaten - return to base

FSM code update() { switch(state) { case hunqng: chasepacman(); case hunted: evadepacman(); case eaten: returntobase(); } } doevents() { event = getnextmessage(); } switch(event) { case eatenpill: setstate(hunted); case reachedbase: setstate(hunqng); }

References Game Engine Architecture (Jason Gregory, 2009) Quake source code hfps://github.com/id- So.ware/Quake- III- Arena C code, but can you spot the structure?

MulQplayer Games Single Player Pre- defined challenges ArQficial Intelligence controlled opponents using Finite State Machines Simple MVC design MulQ- Player More than one player can play in the same environment at the same Qme InteracQon with other players forms a key challenge of the game play How can we build such a system? What are some of the issues that arise?

Where is the view? Local Players are co- located Share the same console / screen / pc Share or split screen into two or four secqons Arcade games, racing, fighqng, co- operaqve shooters Networked / Online Players are physically separated Game play is shared over the network / Internet Many combinaqons of players 2 - >?? FPSs, MMORPGs

StaQc Shared View Bomber Man

AdapQve Shared View Street Fighter

AdapQve Shared View Street Fighter

Controller A Controller B Static or Adaptive View Same Model

Split- Screen View Mario Kart

Controller A Controller B View A View B Same Model

Networked / Online Game Play Players are physically separate Where is the game? Master and slave Usually two players, local network Dedicated server and Clients MulQple players, local network, internet (Peer- to- peer) Largely theoreqcal