CHAPTER 17 Creating an Interactive 3D Environment © 2008 Cengage Learning EMEA.

Slides:



Advertisements
Similar presentations
DATA PROCESSING SYSTEMS
Advertisements

Executional Architecture
Chapter 13 Review Questions
10 Software Engineering Foundations of Computer Science ã Cengage Learning.
Ch 3 System Development Environment
Network Management Overview IACT 918 July 2004 Gene Awyzio SITACS University of Wollongong.
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.
Fall 2007CS 225 Introduction to Software Design Chapter 1.
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.
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
CHAPTER 1 Introduction to Game Development © 2008 Cengage Learning EMEA.
Copyright 2006 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Third Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Chapter.
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.
Software Issues Derived from Dr. Fawcett’s Slides Phil Pratt-Szeliga Fall 2009.
A Technical Game Project 4 Due dates: Game Idea Friday, March 16 th Game Plan Friday, March 23 rd Web Page Sunday, April 9 th First Playable Wednesday,
Chapter 6 - Implementing Processes, Threads and Resources Kris Hansen Shelby Davis Jeffery Brass 3/7/05 & 3/9/05 Kris Hansen Shelby Davis Jeffery Brass.
Cambodia-India Entrepreneurship Development Centre - : :.... :-:-
By Steven Taylor.  Basically a video game engine is a software system designed for the creation and development of video games.  There are many game.
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.
Gearbox Software PRODUCTION PIPELINE – JOBS TITLES – JOB DESCRIPTIONS.
1 Review PowerPoint for Unit Test covering Chapter #1 & #2.
Chapter Languages, Programming and Architecture.
Games Development 2 Entity / Architecture Review CO3301 Week
CSE 381 – Advanced Game Programming 3D Game Architecture.
CS101: Introduction to Computing Instructors: Badre Munir, Usman Adeel, Zahid Irfan & Maria Riaz Faculty of Computer Science and Engineering GIK Institute.
Tools for Game Developmet Erik Harpstead Carnegie Mellon University 1.
Chapter 7: The 30 elements of systems engineering
CHAPTER 4 Window Creation and Control © 2008 Cengage Learning EMEA.
Zhonghua Qu and Ovidiu Daescu December 24, 2009 University of Texas at Dallas.
Instrumentation System Design – part 2 Chapter6:.
Chapter 2: Operating-System Structures. 2.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 14, 2005 Operating System.
Game Engine Programming. Game Engine Game Engine Rendering Engine (OGRE) Rendering Engine (OGRE) Physics Engine (Bullet) Physics Engine (Bullet) Input/Output.
Programming in Java Unit 2. Class and variable declaration A class is best thought of as a template from which objects are created. You can create many.
Introduction to Software Design Chapter 1. Chapter Objectives  To become familiar with the software challenge and the software life cycle  To understand.
10/9/20151 Unreal Basics CIS 488/588 Bruce R. Maxim UM-Dearborn.
Developing the Game User Interface (UI) Lesson 5.
CHAPTER TEN AUTHORING.
Middleware for FIs Apeego House 4B, Tardeo Rd. Mumbai Tel: Fax:
Windows, Linux, Mac, Android, iOS

2.1. T HE G AME L OOP Central game update and render processes.
ECE450 - Software Engineering II1 ECE450 – Software Engineering II Today: Introduction to Software Architecture.
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,
Processor Architecture
Games Development 1 Review / Revision CO2301 Games Development 1 Semester 2.
Lesson 3-Multimedia Skills. Overview Members of a multimedia team. Roles and responsibilities in a multimedia team.
CSCE 552 Fall 2012 Language and Programming By Jijun Tang.
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 –
310414IMPLEMENTATION1 IMPLEMENTATIONIMPLEMENTATION SOFTWARE ENGINEERING SOFTWARE ENGINEERING.
BMTS 242: Computer and Systems Lecture 1: Introduction to Computer System Yousef Alharbi Website
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.
Internet Computing Module II. Syllabus Creating & Using classes in Java – Methods and Classes – Inheritance – Super Class – Method Overriding – Packages.
Week 1 Reference (chapter 1 in text book (1)) Dr. Fadi Fayez Jaber Updated By: Ola A.Younis Decision Support System.
1 Multimedia Development Team. 2 To discuss phases of MM production team members Multimedia I.
Game Engine Architecture
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.
Better Interactive Programs
Game Engine Architecture
Unit 20 Software Part 2.
Unit 20 Software Part 2.
3D Game Development Time and game loop Jernej Vičič.
Introduction to Systems Analysis and Design Stefano Moshi Memorial University College System Analysis & Design BIT
Lecture 2 The Art of Concurrency
Games Development Game Architecture: Entities
Games Development 2 Tools Programming
Games Development 1 Review / Revision
Games Development 2 Entity / Architecture Review
Presentation transcript:

CHAPTER 17 Creating an Interactive 3D Environment © 2008 Cengage Learning EMEA

LEARNING OBJECTIVES In this chapter you will learn about: – –Game engine architecture – –Game initialization and shutdown – –The game loop – –Creating an interactive DirectX 10 3D environment – –Creating an interactive OpenGL 3D environment

GAME ENGINE ARCHITECTURE A game engine is the central unit of any computer game and it can be described as a collection of technologies such as a sound engine, AI subsystem, physics engine, networking subsystem, 3D renderer, and input control system. The number of subsystems provided is highly dependent on the developer’s requirements and the implementation platform of choice.

GAME ENGINE ARCHITECTURE Game engines, built upon various APIs such as DirectX and OpenGL, are normally designed with software componentry in mind. – –This allows for decomposition of the engine, resulting in numerous functional units. By designing component-based engines, we are able to replace provided technologies with other third-party or in-house developed units as needed. – –For example, a game engine’s renderer, physics engine or sound system can easily be replaced by an improved or alternate version in a plug-and-play fashion.

GAME ENGINE ARCHITECTURE The term ‘game engine’ existed for some time, but only became truly common in the mid-1990s when developers started licensing the core code of other games for their own titles. This reuse led to the development of high-end commercial game engines and middleware providing game developers with a number of game creation tools and technical components – i.e. accelerating the game development process.

GAME ENGINE ARCHITECTURE We can divide the source code of a game into two units, namely, the game-engine code and the game-specific code. – –The game-specific code deals exclusively with in-game play elements, for instance, the behaviour of non- player characters, mission-based events and logic, and the main menu. – –Game-specific code is not intended for future reuse and thus excluded from the game engine code. – –Game-engine code forms the core of the entire game implementation with the game-specific code being executed on top of it. – –The game engine is separate from the game being developed in the sense that it provides all the technological components without any hard coded information about the actual gameplay.

GAME ENGINE ARCHITECTURE Game-engine code and game-specific code can be designed and integrated using one of the following architectures: ad-hoc, modular, or the directed acyclic graph architecture (DAG).

GAME ENGINE ARCHITECTURE Once we have chosen the preferred overall architecture, we have to summarize all possible states our game will go through from initialization to shutdown. Possible states (with associated events) are listed here: – –Initialization. – –Enter the main game loop:   Additional initialization and memory allocation.   Load intro video.   Initialize and display in-game menu: – –Event monitoring. – –Process user input.   Start game.   In-game loop: – –Input monitoring. – –Execution of artificial intelligence (AI) – –Execution of physics routines. – –Sound and music output. – –Execution of game logic. – –Rendering of the scene based on the input from the user and other subsystems. – –Display synchronization. – –Update game state.   Exit the game and return to the in-game menu. – –Shutdown of the game if the user wishes to terminate the program.

Initialization and Shutdown The first step invoked whenever a game is executed, is initialization. This step deals with resource and device acquisition, memory allocation, initialization of the game’s GUI, and loading of art assets such as an intro video from file. The first initialization phase is commonly referred to as the ‘front-end initialization step’ to distinguish it from the level and actual game play initialization phases. – –Front-end initialization occurs prior to the game loop and is required for setting up the environment by assigning resources and loading game data and assets

Initialization and Shutdown void FrontEndInit() {AcquireResources();AllocMem();LoadAssets();InitGUI();LoadPlayerPreferences();} All devices and resources are released and final program cleanup is done during the exit state. The exit state has to release all resources and devices acquired, memory allocated and data loaded in the reverse order of the initial front-end acquisition.

Initialization and Shutdown void Cleanup() {SavePlayerPreferences();ShutdownGUI();ShutdownAssetAccess();FreeMem();ReleaseResources();}

The Game Loop The game loop allows uninterrupted execution of the game. It enables us to execute a series of tasks such as input monitoring, execution of artificial intelligence and physics routines, sound and music processing, execution of game logic, display synchronization and so forth for every frame rendered. All these tasks are processed on a per-frame basis, thus resulting in a living world where everything happens in a seemingly concurrent manner, especially so where the computer game runs at 40 frames per second or more.

The Game Loop Timing allows a game to execute at a speed independent of the frame rate or processor’s clock speed. Most games released today make use of variable frame timing. Another key element of any game is the processing of player input. Other tasks performed during the game loop include the execution of AI code so that NPCs can decide where to go next or what action to take, object updates, the execution of game code and scripts, the execution of physics code to ensure correct inter-object and object- entity interaction, updating the camera according to player input, animating objects and updating particle effects, etc.

The Game Loop while(!ExitGame()){UpdateTiming();InputHandling();UpdateNetworking();ExecuteScripts();UpdateAI();UpdatePhysics();UpdateSound();UpdateEntities();UpdateCamera();CollisionDetection();CollisionResponse();RenderFrame();UpdateGameState();}

The following code sample illustrates the possible structure of a decoupled game loop: while(!ExitGame()) { UpdateTiming(); InputHandling(); if(UpdateWorld()) { UpdateNetworking(); ExecuteScripts(); UpdateAI(); UpdatePhysics(); UpdateSound(); UpdateEntities(); UpdateCamera(); CollisionDetection(); CollisionResponse();] } InterpolateObjectStates(); RenderFrame(); UpdateGameState(); }

CREATING AN INTERACTIVE DIRECTX 10 3D ENVIRONMENT [see the textbook and book website for the source code example and detailed discussion].

CREATING AN INTERACTIVE OPENGL 3D ENVIRONMENT [see the textbook and book website for the source code example and detailed discussion].