Introduction to Game Engine Design - PowerPoint PPT Presentation

1 / 16
About This Presentation
Title:

Introduction to Game Engine Design

Description:

Back face culling. View frustum culling (scene graph, bounding box ...) Visibility culling ... Fast culling. Fast collision and intersection detection ... – PowerPoint PPT presentation

Number of Views:43
Avg rating:3.0/5.0
Slides: 17
Provided by: IIT89
Category:

less

Transcript and Presenter's Notes

Title: Introduction to Game Engine Design


1
Introduction to Game Engine Design
  • Dr. Xiaoyu Zhang

2
Game Engine
  • Game engine is a big program
  • A game engine contains non-game-specific
    technologies and tools. Multiple games can be
    built using the same game engine
  • New models, graphics, and audios etc. can be
    added the game engine to make a new game

3
Main Game Loop
  • Check user input
  • Prepare 3D world
  • Perform AI
  • Collision detection
  • Create or delete objects
  • Modify object states?
  • Object animation
  • Moving objects according to physics
  • Move camera
  • Render and play sound

4
Game Engine Subsystems
  • A game engine consists of following elements
  • Graphics engine
  • Rendering and scene management
  • Input system
  • Music and sound
  • Game logic and AI
  • Networking
  • User interface and menu system

5
Graphics Engine
  • Graphics engine is the central part of a game
  • Rendering
  • Want both speed and quality
  • Based on rendering libraries as OpenGL and
    Direct3D
  • Lighting and Texture mapping
  • Techniques like shadow, environment mapping,
    lightmaps, particle systems (with performance
    in consideration)
  • GPU programming, Cg shaders
  • Algorithms to improve performance
  • Back face culling
  • View frustum culling (scene graph, bounding box
    )
  • Visibility culling
  • Level of details (LOD)

6
Scene Management
  • 3D World is often constructed procedurally or
    loaded from files.
  • 3D scene is often organized in hierarchical scene
    graph
  • Easily manageable world (traversal and rendering
    from multiple viewpoints)
  • Fast culling
  • Fast collision and intersection detection
  • Use collision detection and game physics to add
    realism
  • Collision detection and reaction
  • Newtonian physics gravity, velocity, friction,
    acceleration, etc. Dont have to be physically
    accurate to have some fun

7
Object Class Hierarchy
  • Make a good design before writing code.
  • Base class
  • Render() ?
  • Collision() ?
  • Animate() ?
  • What attributes to be included?
  • What spatial data structure will you use to
    manage objects in the world?
  • Do you need a generic node class for the spatial
    DS?
  • Every 3D object should derive from this generic
    node class.

8
Input and Audio
  • Input subsystem
  • Dealing with various input devices to handle user
    input and game control
  • Windows event loop and DirectInput
  • Game control Simple and intuitive (avoid too
    many modes)
  • Sound and Music
  • Enhance game playing experience greatly
  • DirectX Sound API
  • OpenAL (Open Audio Library www.openal.org)

9
Networking
  • You need networking for multi-player gaming
  • Should incorporate it at design time
  • There are four primary concerns in building
    networks for games
  • Latency How long does it take for state to be
    transmitted
  • Reliability How often is data lost or corrupted
  • Bandwidth How much data can be transmitted in a
    given time
  • Security How is the game-play protected from
    tampering
  • DirectPlay is the DirectX communication library
  • Not covered in this class

10
AI and Game Rules
  • Second most important component, after graphics
  • Behavior of a non-player character
  • Knowledge rules, knowledge bases, search
    abilities
  • Environment awareness danger etc.
  • Decision making rules, reasoning and learning
    abilities
  • World Navigation path planning
  • In FPS How does the AI get from room to room?
  • In RTS User clicks on units, tells them to go
    somewhere. How do they get there? How do they
    avoid each other?
  • Dynamic path planning What happens when the
    environment changes after the plan has been made?

11
SimpEngine Design
12
World Object Hierarchy
  • Node and Object build a world hierarchy
  • Node an abstract data structure representing a
    tree-like structure. It implements all structural
    operations with the hierarchy, e.g. attaching,
    detaching, traversal, and searching etc.
  • Object is derived from Node. It can represent
    anything that can draw, move, collide, or even
    "think".
  • Classes can further derive from Object to build
    custom objects

13
Engine Core
  • COGLWindow Class Creating the window and handle
    events from input devices
  • CInputSystem Class An input subsystem using
    DirectInput. It has functions related to
    keyboard, mouse, and joystick
  • CEngine Derived from COGLWindow.
  • Implements the main message loop
  • GameCycle implements game logic here
  • Handle events from the input system

14
Engine Core (2)
  • Steps in a game cycle
  • Check Input
  • Prepare the world
  • Perform AI
  • Perform collision detection
  • Calculate physics
  • Move / Orient camera
  • Move objects
  • Play Sounds and Render the scene

15
SimpEngine
  • The SimpEngine class is derived from Engine.
  • Has references to the camera and the world
  • Has procedures to handle user input
  • Camera Represents Camera object
  • Controlled by mouse and keyboard
  • World defines the game world
  • Contains the object hierarchy
  • You may want to add lighting and other features
    to the game world.
  • Example

16
Tips
  • Get to know your group
  • Know your strengths and weaknesses
  • Dont be afraid to try something new
  • Talk to your group and work closely
  • Help out each other
  • May want to try out extreme programming pair
    programming
  • Integrate early and often
  • Its the glue code that usually takes the most
    time
  • Use CVS for version control (required)
  • It may be the factor that make or break your
    project
  • TortoiseCVS (www.tortoisecvs.org) - lets you work
    with files under CVS version control directly
    from Windows Explorer
  • WinCVS (www.wincvs.org) does the rest, but not
    as easy to use
  • Start now and have fun
Write a Comment
User Comments (0)
About PowerShow.com