CS 382.001 F EBRUARY 9, 2016 P ARTS 3.4-3.5 G AME A RCHITECTURE, M EMORY, AND I/O S YSTEMS G AME T IMING G AME T IMING G AME P ARALLELISM G AME P ARALLELISM.

Slides:



Advertisements
Similar presentations
Computer Organization. The Nature of Data Spreadsheets give us a way to create processes that manipulate data We can think of a piece of data as a quantity.
Advertisements

DATA PROCESSING SYSTEMS
MANIFEST DESTINY 560group3 Abe Kim David Straily Jarrod Freeman Abdul Mod-Rokbi “The future of RTS games...”
THQ/Gas Powered Games Supreme Commander and Supreme Commander: Forged Alliance Thread for Performance.
Survey of Graphics and Games. Outline Overview of computer graphics – Coursework – Research Programming using game engines Computer game and animation.
How do games work? Game Workshop July 4, Parts Sprites/pictures Map/background Music/sounds Player character Enemies Objects.
Game Design and Programming. Objectives Classify the games How games are design How games are implemented What are the main components of a game engine.
Chapter 3.5 Memory and I/O Systems. Memory Management 2 Only applies to languages with explicit memory management (C, C++) Memory problems are one of.
Chapter 1 and 2 Computer System and Operating System Overview
Chapter 3.7 Memory and I/O Systems. 2 Memory Management Only applies to languages with explicit memory management (C or C++) Memory problems are one of.
CIS Game Design I Chapter 6 and 7 Blake Farrugia 10/24/2011.
Pencilvania: Architecture Review Presenters: Christopher Buska (Art Director) Michael Gourlay (Developer) Alfred Sterphone, III (Project Manager) Special.
Chapter 3.6 Game Architecture. 2 Overall Architecture The code for modern games is highly complex With code bases exceeding a million lines of code, a.
Operating Systems.
AGD: 5. Game Arch.1 Objective o to discuss some of the main game architecture elements, rendering, and the game loop Animation and Games Development.
CHAPTER 17 Creating an Interactive 3D Environment © 2008 Cengage Learning EMEA.
Computer Basics Flashcards #2
FPGA-Based Arcade Emulation Danny Funk, Cory Mohling, Tony Milosch, David Gartner, John Alexander Advisor: Philip Jones Client: Joseph Zambreno.
Standard 1 - Objective 2: Understand, evaluate, and use computer software.
Games Development 2 Entity / Architecture Review CO3301 Week
11 Games and Content Session 4.1. Session Overview  Show how games are made up of program code and content  Find out about the content management system.
CSE 381 – Advanced Game Programming 3D Game Architecture.
Input and Output Computer Organization and Assembly Language: Module 9.
Object Oriented Analysis & Design SDL Threads. Contents 2  Processes  Thread Concepts  Creating threads  Critical sections  Synchronizing threads.
10/9/20151 Unreal Basics CIS 488/588 Bruce R. Maxim UM-Dearborn.
Developing the Game User Interface (UI) Lesson 5.
Chapter 3.5 Memory and I/O Systems. 2 Memory Management Memory problems are one of the leading causes of bugs in programs (60-80%) MUCH worse in languages.
Multimedia ITGS. Multimedia Multimedia: Documents that contain information in more than one form: Text Sound Images Video Hypertext: A document or set.
XNA An Introduction. What XNA is… Microsoft® XNA™ is composed of industry- leading software, services, resources, and communities focused on enabling.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Memory: Relocation.
Kevin Clow: Artificial Intelligence Programmer Level Designer 3D modeler Matthew Vaughan: Project Manager Graphical User Interface Programmer Audio Programmer.
2.1. T HE G AME L OOP Central game update and render processes.
Game Programming Patterns Event Queue From the book by Robert Nystrom
“The perfect project plan is possible if one first documents a list of all the unknowns.” Bill Langley.
Reference: The Game Loop Animation / Game loop 1. Update variables 2. [Get input from the user] (GameLoop only) 3. Draw (using variables)
Games Development Game Architecture: Entities CO2301 Games Development 1 Week 22.
Chapter 3.6 Game Architecture. 2 Overall Architecture The code for modern games is highly complex (can easily exceed 1M LOC) The larger your program,
11 General Game Programming Approach. The program is event-driven The program is event-driven –Messages = events –So as all windows system (for example.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
Super Pong Andrew S. Dunsmore CSC436 August 2004.
Trojan Rabbits. (10/31) Functional minimum: Tile/Grid-based Game "Engine" (Shaun & Michael) Game Objects Created (Timothy) User Interaction Movement (Yan)
Games Development 1 Review / Revision CO2301 Games Development 1 Semester 2.
Click once to reveal the definition. Think of the answer. Then click to see if you were correct. HARDWARE Physical parts of the computer.
Introduction to Game Programming Pertemuan 11 Matakuliah: T0944-Game Design and Programming Tahun: 2010.
T HE G AME L OOP. A simple model How simply could we model a computer game? By separating the game in two parts: – the data inside the computer, and –
CMPF124 Personal Productivity with Information Technology Chapter 2 – Part 3 Introduction To Windows Operating Systems Windows Accessories CMPF 112 : COMPUTING.
Chapter 4 Software. Introduction Program: is a set of sequence instructions that tell the computer what to do. Software: is a collection of programs,
Antigone Engine. Introduction Antigone = “Counter Generation” Library of functions for simplifying 3D application development Written in C for speed (compatible.
COMP091 – Operating Systems 1 Memory Management. Memory Management Terms Physical address –Actual address as seen by memory unit Logical address –Address.
Interrupts and Exception Handling. Execution We are quite aware of the Fetch, Execute process of the control unit of the CPU –Fetch and instruction as.
Pirates & Ninjas. P&N: Plan Project summary Architecture User Interface World Creation (town) World Content Creation Game Play Artificial Intelligence.
1 AQA ICT AS Level © Nelson Thornes 2008 Operating Systems What are they and why do we need them?
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
(More) Event handling. Input and Windowed-OS’s Windowed OS’s (Windows, OSX, GUI-linux’s) send messages (events) when the user does something “on” the.
Memory management The main purpose of a computer system is to execute programs. These programs, together with the data they access, must be in main memory.
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
Reference: What is it? A multimedia python library – Window Management – Graphics geometric shapes bitmaps (sprites) – Input Mouse Keyboard.
GAME TESTING REQUIREMENTS AND METHODS GAME DESIGN.
Processes and threads.
Game Architecture Rabin is a good overview of everything to do with Games A lot of these slides come from the 1st edition CS 4455.
The Purpose of game Engines
Game Loops + Part II Reference:
TerraForm3D Plasma Works 3D Engine & USGS Terrain Modeler
Game Loop Update & Draw.
Chapter 2: Operating-System Structures
Games Development Game Architecture: Entities
Chapter 2: Operating-System Structures
Games Development 2 Tools Programming
Unity Game Development
Games Development 2 Entity / Architecture Review
Presentation transcript:

CS F EBRUARY 9, 2016 P ARTS G AME A RCHITECTURE, M EMORY, AND I/O S YSTEMS G AME T IMING G AME T IMING G AME P ARALLELISM G AME P ARALLELISM G AME E NGINES G AME E NGINES P LUG -I N T OOLS P LUG -I N T OOLS M EMORY M EMORY S ERIALIZATION S ERIALIZATION

G AME A RCHITECTURE P AGE 98 G AME A RCHITECTURE C ERTAIN ASPECTS OF CODE ARE UNIQUE TO GAME PROGRAMS. I NITIALIZATION CODE TO SET UP THE WINDOWS AND INTERFACES, AND TO LOAD DATA FROM EXTERNAL FILES U PDATE INPUT FROM DEVICES LIKE THE KEYBOARD OR JOYSTICK, AND UPDATE THE MUSIC STATE TABLE I NTERPRET CURRENT USER INPUT, UPDATE ONSCREEN CHARACTERS, DRAW MAP, PERFORM CURRENTLY LOADED EFFECTS L OAD GAMES, GENERATE CHARACTERS, PURCHASE ITEMS, SET EQUIPMENT, PLOT TEXTBOXES ( HEALTH, WEAPONS, ETC.) H ANDLE TURNS, ACTIVATING THE AI FOR ENEMIES AND ACTIVATING THE MENU SYSTEM FOR CHARACTERS R UN CURRENTLY LOADED SCRIPTS R ELEASE ALL CREATED OBJECTS, DEALLOCATE MEMORY, SHUT DOWN THE PROGRAM

G AME A RCHITECTURE P AGE 99 G AME T IMING W HILE COMPUTERS RUN AT DIFFERENT SPEEDS, WE WANT GAMES TO RUN AT THE SAME SPEED ON ANY COMPUTER. G AME CODE MAY BE SPLIT INTO DRAWING CODE, WHICH RENDERS THE ACTUAL GRAPHICS, AND LOGIC CODE, WHICH ENSURES THAT EVENTS OCCUR AT THE APPROPRIATE TIME. // If the computer’s too fast, don’t move // anything (like the right-moving pixel // in this code) until its time comes up. typedef struct { int x, y, dx; DWORD speed; DWORD next_time; } pixel_t; pixel_t pix; pix.x = 0; pix.y = 20; pix.dx = 1; pix.speed = 20; pix.next_time = 0; while ( !done ) { if ( timeGetTime() > pix.next_time ) { pix.x += pix.dx; // move pixel right pix.next_time = timeGetTime() + pix.speed; } ClearScreen(); Pixel(pix.x, pix.y, RGB(0,255,0)); // draw pixel } // If the computer’s too slow to draw everything as fast // as the logic dictates, then the logic must be run in // a non-drawing loop, to catch up prior to redrawing. DWORD master_time, now, catch_up; master_time = timeGetTime(); while ( !done ) { now = timeGetTime(); catch_up = now - master_time; while ( catch_up-- ) // run logic once for each // 'tick' missed while drawing { if ( now > pix.next_time ) { pix.x += pix.dx; // move pixel right pix.next_time = now + pix.speed; } master_time = timeGetTime(); ClearScreen(); Pixel(pix.x, pix.y, RGB(0,255,0)); // draw pixel // in a real game, all drawing could take a // while; master_time would allow it to be // noticed that more than one 'tick' has passed }

G AME A RCHITECTURE P AGE 100 G AME P ARALLELISM R EDESIGNING GAME ENGINES TO TAKE ADVANTAGE OF MULTIPLE PROCESSORS CAN IMPROVE GAME PLAY WITHOUT SACRIFICING FRAME RATES. M ULTITHREADING INEFFICIENCIES MIGHT RESULT, HOWEVER. F OR EXAMPLE, THE SECOND C OLLISION D ETECTION COMPUTATION AT RIGHT CANNOT TAKE ADVANTAGE OF THE FIRST C HARACTER A NIMATION COMPUTATION ( WHICH IS INCOMPLETE ), SO IT YIELDS THE SAME RESULT AS THE FIRST CD COMPUTATION. S IMILARLY, THE THIRD R ENDER COMPUTATION LACKS UPDATED CA DATA, SO RENDERING A NEW FRAME AT THIS POINT HAS DUBIOUS VALUE.

G AME A RCHITECTURE P AGE 101 G AME E NGINES P ROGRAMMING PLATFORM - SPECIFIC, BUT NOT GAME - SPECIFIC, CODE TO SUPPORT MULTIPLE GAMES WITH COMMON FUNCTIONALITY, INCLUDING GRAPHICS RENDERING, AUDIO CONTROL, CONTROLLER INTERACTION, MULTIPLAYER NETWORK SUPPORT, PHYSICAL COLLISION DETECTION, AND AI PATHFINDING.

P ART 3.4: G AME A RCHITECTURE P AGE 102 P LUG -I N T OOLS E XTENDING EXISTING COMMERCIAL OFF - THE - SHELF MODELING TOOLS BY ADDING PLUG - INS TO ENABLE EDITORS FOR GAME LEVELS, SPECIAL EFFECTS, SOUND, PHYSICS, AI, ETC., IS A CRITICAL MEANS FOR IMPROVING THE RAPID DEVELOPMENT OF GAME PROGRAMS.

P ART 3.5: M EMORY AND I/O S YSTEMS P AGE 103 M EMORY AND I/O S YSTEMS W ITH TENS OF THOUSANDS OF ASSETS IN SOME GAMES ( E. G., TEXTURES, BITMAPS, SOUNDS, MUSIC, SOURCE CODE FILES ), THE MISPLACEMENT, CORRUPTION, OR ACCIDENTAL LOSS OF ASSETS IS NOT UNCOMMON. T HE HUGE INCREASES IN MEMORY REQUIREMENTS IN MODERN GAME SYSTEMS DICTATE THAT EFFICIENT ALLOCATION STRATEGIES AND EFFECTIVE ELIMINATION OF FRAGMENTATION BE IMPLEMENTED.

M EMORY AND I/O S YSTEMS P AGE 104 C ONSOLE M EMORY H ISTORY A S WITH PERSONAL COMPUTERS, GAME CONSOLES HAVE EXPERIENCED AN EXPLOSION OF MEMORY CAPACITY, FREEING GAME DEVELOPERS TO ENHANCE THE VIDEO AND AUDIO OF GAMES, AS WELL AS THEIR PHYSICS AND AI.

M EMORY AND I/O S YSTEMS P AGE 105 S ERIALIZATION G AME STATE INFORMATION OFTEN MUST BE STORED IN ORDER TO … … SAVE A GAME FOR CONTINUED PLAY LATER. … SEND AN ON - LINE PLAYER ’ S STATUS ACROSS A NETWORK. … REVISIT GAME LOCALES PREVIOUSLY ALTERED DURING PLAY. S ERIALIZATION PROBLEMS INCLUDE : D EALING WITH POINTERS, SINCE SAVING MEMORY LOCATIONS WILL RESULT IN CRASHES WHEN THE GAME IS RESTORED. D EALING WITH POINTERS, SINCE SAVING MEMORY LOCATIONS WILL RESULT IN CRASHES WHEN THE GAME IS RESTORED. O BJECTS IN THE GAME MUST BE SEPARATED INTO STATIC RESOURCES ( SPRITES, TEXTURES, SOUNDS, ETC.) AND DYNAMIC ENTITIES ( OWNED WEAPONS, CHARACTER LOCATION, CAMERA ORIENTATION, INDIVIDUAL HEALTH, ETC.), WITH ONLY THE ENTITIES BEING SAVED. O BJECTS IN THE GAME MUST BE SEPARATED INTO STATIC RESOURCES ( SPRITES, TEXTURES, SOUNDS, ETC.) AND DYNAMIC ENTITIES ( OWNED WEAPONS, CHARACTER LOCATION, CAMERA ORIENTATION, INDIVIDUAL HEALTH, ETC.), WITH ONLY THE ENTITIES BEING SAVED. D ECISIONS REGARDING THE PRESERVATION OF SMALL DETAILS MUST BE MADE, E. G., IS EACH PARTICLE IN AN EXPLOSION ’ S PARTICLE SYSTEM STORED ? D ECISIONS REGARDING THE PRESERVATION OF SMALL DETAILS MUST BE MADE, E. G., IS EACH PARTICLE IN AN EXPLOSION ’ S PARTICLE SYSTEM STORED ?