CSc 165 Lecture Notes 1 - Game Engines CSc 165 Computer Game Architecture Basic Game Structure
Start while (!gameOver)
Initialize system Player Input Initialize 1 - Game Engines game One iteration Game Main Logic Update Loop = 1 Frame
Shutdown Render
Exit “Tightly-coupled” game loop
2
CSc 165 Lecture Notes CSc 165 Lecture Notes 1 - Game Engines 1 - Game Engines
Game ENGINE Typical Game Engine Functions A reusable collection of modules ▪ Independent of any particular Game Logic • Simulation of elapsed time • View (camera) control ▪ Encapsulates platform dependencies • Scene Management • Input handling o Objects, geometry details ▪ Possible because all games have things in common • Sound generation • Rendering • Network communication • Collision Detection/Handling Game Application Logic o Physics simulation • Special effects • Lights, Shadows, Textures o Explosions, fire, …
Game Engine
Player 3 4
CSc 165 Lecture Notes CSc 165 Lecture Notes 1 - Game Engines 1 - Game Engines Game Engine Design Some Game Engines
Game Application Logic o Unity o jMonkey o Unreal o OGRE
o Godot o Quake <
For an expanded list see: http://en.wikipedia.org/wiki/List_of_game_engines 5 6 CSc 165 Lecture Notes CSc 165 Lecture Notes 1 - Game Engines 1 - Game Engines
RAGE : “Raymond’s Awesome Game Engine” Abstracting Game Structure
A collection of Java packages <
... SomeGame
7 8
CSc 165 Lecture Notes CSc 165 Lecture Notes 1 - Game Engines 1 - Game Engines
Abstracting Game Structure (cont.) Abstracting Game Structure (cont.)
<
<
ray.rage.game.VariableFrameRateGame startup() shutdown() exit() run() setState() # run() getState() getEngine() # setupWindow() # setupWindowViewport() # setupGpuShaderPrograms() # createRenderSystemFactory() # createSceneManagerFactory() keyPressed(), keyTyped(), etc... mouseClicked(), mouseMoved(), etc...
9 10
CSc 165 Lecture Notes CSc 165 Lecture Notes 1 - Game Engines 1 - Game Engines Creating A Simple Game
<
<
MyGame Not required but usually “Rockstar Advanced Game Engine” # void setupWindow(); beneficial to override # void setupCameras(); # void setupScene(); Required # void update();
11 12