242-515 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.

Slides:



Advertisements
Similar presentations
Introduction Games have always been a fundamental part of human life. Space storm “ عاصفة الفضاء” is a 3D SCI-FI game that consists of two stages presented.
Advertisements

Intro to Java Monkey Engine Download JME loads/ loads/
Soul Envoy Final Year Project 22nd April 2006 By Zhu Jinhao.
Supervised by Prof. LYU, Rung Tsong Michael Department of Computer Science & Engineering The Chinese University of Hong Kong Prepared by: Chan Pik Wah,
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.
SCA Introduction to Multimedia
Further Programming for 3D applications CE Introduction to Further Programming for 3D application Bob Hobbs Faculty of Computing, Engineering and.
Level 2 Mobile and Games Programming Modules Cathy French K233.
ATI GPUs and Graphics APIs Mark Segal. ATI Hardware X1K series 8 SIMD vertex engines, 16 SIMD fragment (pixel) engines 3-component vector + scalar ALUs.
Game Engines Non-game specific technology Game: – Engine – Assets (models, animations, sounds, AI, and physics) – Code (AI, Scripting, etc.)
Unity 3D game IDE 1.  Unity is a multi-platform, integrated IDE for scripting games, and working with 3D virtual worlds  Including:  Game engine ▪
CHAPTER 17 Creating an Interactive 3D Environment © 2008 Cengage Learning EMEA.
Master Project Preparation Murtaza Hussain. Unity (also called Unity3D) is a cross-platform game engine with a built-in IDE developed by Unity Technologies.
1. 2  A computer is a device capable of storing data  in a format suited to the computer,  which is then processed by mathematical manipulation and.
MULTIMEDIA TECHNOLOGY SMM 3001 MEDIA - GRAPHICS. In this chapter how the computer creates, stores, and displays graphic images how the computer creates,
PacMan by Midway, released 1980 CSE 380 – Computer Game Programming Real-Time Game Architecture.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 19 Other Graphics Considerations Review.
CSE 381 – Advanced Game Programming 3D Game Architecture.
Antigone Engine Kevin Kassing – Period
 2008 Pearson Education, Inc. All rights reserved Introduction to Computers, the Internet and World Wide Web.
Grafis 3D. What is 3D?  3D Image x, y, z Tell a story, more information  2D Image x, y Communicate something simple (ie. cheat)
Zhonghua Qu and Ovidiu Daescu December 24, 2009 University of Texas at Dallas.
3D Visualisation of Simulation Data. Informal Seminar 08/03/2004. By Chris Sweet.
Connected 3D Game Development for Mobile Devices using X-Forge Game Developers Conference 2005 March 11, San Francisco Petrus Lundqvist.
Tennis for Two, 1958, by William Higinbotham, Brookhaven National Lab CSE 380 – Computer Game Programming Graphics Device Management.
Game Engine Programming. Game Engine Game Engine Rendering Engine (OGRE) Rendering Engine (OGRE) Physics Engine (Bullet) Physics Engine (Bullet) Input/Output.
1 ETC. 2 Sounds FX Sounds FX –WAV audio files –Load into memory and play it »Load »Play »Stop »Pause –2D or 3D »3D should be integrated into scene management.
The Graphics Rendering Pipeline 3D SCENE Collection of 3D primitives IMAGE Array of pixels Primitives: Basic geometric structures (points, lines, triangles,
Course Introduction and Terminology CGDD 4113 – 3D MODELING AND ANIMATION.
Ray Bradley Karla N. Juárez David Wood Advisor: Dr. Stephen Murrell May 2 nd, 2005.
Games Games GAMES. About Me:  Ariel Nehmad.  I’m 31 years old.  Live in Buenos Aires, Argentina.  CTO and father of Flare3D, FLSL and Flare3D Phys…
Web Games Programming An Introduction to Unity 3D.
1 The Rendering Pipeline. CS788 Topic of HCI 2 Outline  Introduction  The Graphics Rendering Pipeline  Three functional stages  Example  Bottleneck.
COMPUTER GRAPHICS CSCI 375. What do I need to know?  Familiarity with  Trigonometry  Analytic geometry  Linear algebra  Data structures  OOP.
Games Development Game Architecture: Entities CO2301 Games Development 1 Week 22.
1 Contents  Audio  Sprite  Input devices  Game production milestones  Course summary.
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Reading Flash. Training target: Read the following reading materials and use the reading skills mentioned in the passages above. You may also choose some.
Super Pong Andrew S. Dunsmore CSC436 August 2004.
Games Development 1 Review / Revision CO2301 Games Development 1 Semester 2.
Havok FX Physics on NVIDIA GPUs. Copyright © NVIDIA Corporation 2004 What is Effects Physics? Physics-based effects on a massive scale 10,000s of objects.
Computer Graphics 3 Lecture 6: Other Hardware-Based Extensions Benjamin Mora 1 University of Wales Swansea Dr. Benjamin Mora.
GAM666 – Introduction To Game Programming ● Programmer's perspective of Game Industry ● Introduction to Windows Programming ● 2D animation using DirectX.
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 –
From Turing Machine to Global Illumination Chun-Fa Chang National Taiwan Normal University.
UFCFSU-30-13D Technologies for the Web An Introduction to Unity 3D.
Ori Hanegby Pixtazy Blog:
Game Engines Game: – Engine – Assets (models, animations, sounds, AI, and physics) – Code (Rules, AI, Scripting, etc.)
What is DirectX? DirectX is built by Microsoft as a collection of API’s (Application Programming Interfaces) for the purpose of multimedia processing.
Chapter 1 Introduction.
- Introduction - Graphics Pipeline
3GB3 Game Design Unity 3D Basics.
Computer Graphics.
Antigone Engine.
Ogre Overview Lecture 3.
Ogre Overview.
The Graphics Rendering Pipeline
Understanding Theory and application of 3D
TerraForm3D Plasma Works 3D Engine & USGS Terrain Modeler
IMAGE MOSAICING MALNAD COLLEGE OF ENGINEERING
Unit 20 Software Part 2.
A Prime Example of HCI Application
Unit 20 Software Part 2.
Game Engines Non-game specific technology Game: Engine
Professional Environment
Games Development Game Architecture: Entities
Games Development 1 Review / Revision
Chapter 1 Introduction.
Presentation transcript:

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 , Semester 1, Game Architecture

AGD: 5. Game Arch.2 1.Simple Game Architecture 2.More Detailed Game Architecture 3.Graphics/Rendering 4.Game Programming Overview

1. Simple Game Architecture 3

I will focus on the graphics and maths techniques used inside the "Rendering Engine" box. These include: o basic 3D graphics theory o 3D graphics programming with the JMonkeyEngine game engine o 3D rendering algorithms underlying 3D game engines o shader programming (maybe) 4

AGD: 5. Game Arch.5 2. More Detailed Game Architecture

AGD: 5. Game Arch.6 Elements used in most games: o startup and shutdown o file IO (loaders, writers, datafile parsers) o input controls (keyboard, mouse, touch) o window management minimize, maximize, full-screen, resolution o maths (e.g. vectors, matrices) o data structures (e.g. linked lists) In JMonkeyEngine, many of these come from the standard Java libraries 2.1. Core Systems

AGD: 5. Game Arch.7 These can be separated into game media (stuff visible to the player) and data resources (data used internally by the game) Resources (Assets) Data Resources: o user settings player items high score table o game settings fonts physics map o platform settings graphics and audio capabilities Media Resources: o images / textures o audio o video o shaders o 3D models

AGD: 5. Game Arch.8 The game engine will often reuse existing libraries: o GUI (in JMonkeyEngine (JME): Nifty GUI) o Physics (in JME: jBullet, a Java port of the Bullet Physics library) o skeletons (in JME: support for Blender joints) o AI o visual effects( in JME: OpenGL shaders, particle system) o terrain (in JME: the Ogre3D dotScene format) o scene graph (so important, that it's a part of the core in JME) 2.3. Third-Party Libraries

AGD: 5. Game Arch.9 A scene graph stores all the entities or objects in the scene, and the spatial relationship between them What is a Scene Graph?

AGD: 5. Game Arch.10 The scene graph data structure simplifies the creation of a scene by the user, and also: o makes it easier to transform groups of objects e.g. translate, rotate them o makes it easier to determine when objects are colliding and are visible to each other o makes it easier to display a scene with different Levels of Detail (LOD)

AGD: 5. Game Arch.11 Particles o smoke, fire, explosions, etc. Post processing / filter effects o reflective water, light scattering, fog o shadow mapping o High Dynamic Range (HDR) rendering increased contrast for greater detail o ambient occlusion (blocking) o depth of field blur o etc Visual Effects (in JME)

AGD: 5. Game Arch.12 Java binding to the Bullet physics library o a collision detection and rigid body dynamics library Features include: o collisions, gravity, forces o mesh-accurate collision shapes o rigid body dynamics for vehicles and characters o physical joints and hinges o Blender integration o Ragdoll physics o Multi-threaded physics 2.6. Physics (in JME)

3. Graphics/Rendering Almost every game engine utilizes either OpenGL or DirectX for its graphics processing and rendering. JMonkeyEngine uses OpenGL.

3.1. OpenGL A hardware-independent API, implemented on many different platforms. Several hundred functions, with many language bindings. An accepted industry standard: evolves slowly currently at version 4.2 Widely used for: games, modeling, scientific visualization, etc. 14

3.2. DirectX DirectX is a Microsoft API providing direct access to hardware. Only for Windows, currently at version 11.1 DirectX components: o Direct Graphics – 2D and 3D graphics o DirectInput – interface to input devices o DirectAudio – play sound and music o DirectPlay – communication across networks o DirectShow – multimedia support 15

3.3. OpenGL vs. DirectX OpenGL is aimed at 3D graphics only; DirectX is a more complete game development API. OpenGL is portable across platforms; DirectX is only for Windows. 16

3.4. What is Rendering? Rendering is the process of converting a 3D scene into a 2D picture (raster image) on the computer screen: o The 3D scene is composed of 3D models (geometries). o A model is composed of 3D graphics primitives o e.g. triangles, quadrilaterals 17 render

AGD: 5. Game Arch Game Programming Most games consist of an startup phase, a game loop, and a shutdown phase: A game loop consists of three stages:

4.1. A Detailed Game Flowchart Read player input Update game state, using: Collision Detection, Game AI, Physics, etc Shutdown: store scores close files game over? Initialization: Load assets Load levels … Start Display Startup GUI Render (draw) game frame End

AGD: 5. Game Arch.20 An important element missing from the basic game loop is the need to keep the rate of frame drawing constant. A frame rate is the average number of frames drawn by the game loop each second. Typical frame rates: o 30 fps (i.e. 30 frames drawn in 1 second) o 50 fps The frame rate should stay constant so that the user sees the game updating at a fixed rate Frame Rates

AGD: 5. Game Arch.21 The frame rate should be the same on fast and slow computers. The problem is that a fast machine will carry out "updating" and "rendering" faster than a slow machine, and so the frame rate will be faster. We must change the game loop so that the frame rate isn't affected by a computer's speed Frame Rate Problem

AGD: 5. Game Arch.22 One way to fix this speed problem is to add a "wait" stage in the loop: delays the loop so the frame rate is not too fast UpdateStartupInput RenderWait Shutdown stop run game loop

AGD: 5. Game Arch.23 Waiting deals with a loop that is too fast, but what about a loop that is too slow? o e.g. because the computer is slow One solution is to skip the rendering (drawing) stage, making the loop faster: UpdateStartupInput RenderWait Shutdown stop run game loop Do we have extra time? yes no

AGD: 5. Game Arch.24 The good news is that JMonkeyEngine deals with maintaining a constant frame rate. We only have to write the "update" code for the loop, not the "rendering" or timing parts, which are dealt with by the engine.