PEMROGRAMAN
GAME
Bambang Robi’in, S.T., M.T.
GAME EGINE
What is game engine?
Software that is extensible and can be used as foundation for
many different games without major modification.
(Jason Gregory)
Game Engine is a software system designed for creating and
developing [Link] core functionality typically provided by a
game engine includes a rendering engine ("renderer") for 2D or
3D graphics, a physics or collision engine (and collision
response), sound, scripting, animation, artificial intelligence,
networking, streaming, memory management, threading,
support localization, and scene graphics.
Game Engine
• The game engine is a large and complex program
• A game engine can be used to build many types of games, not a
specific tool / technology for the development of one type of
game.
• The game engine can be added with new models (characters),
graphics, audio, etc.
ELEMEN Game Engine
• A game engine consists of the following elements:
• Graphics engine
• Engine input
• Audio Engine
• Game logic and AI Engine
• Networking Engine
• User interface and menu system (physics engine)
Structure of game engine
Implements Implements
Renderer Lib Audio Lib
Render-Interface Audio-Interface
Create object
Create object
Gives device
Gives device
Uses Physics-
AI-Interface Uses
Interface
Uses
Implements Implements
Uses
Physics Lib
Create Object Your Game Gives device
AI Lib
Gives Device Create object
Create object
Gives advice
Create object
Gives advice
Uses Uses
Input-Interface Network-Interface
Input Lib Network Lib Implements
Implements
Graphics Engine
• The graphics engine is a major part of the game
• Rendering
• Between quality and speed
• using rendering libraries such as OpenGL and Direct3D
• Making lighting and Texture mapping
• Techniques such as creating shadows, environment mapping, light mapping,
mapping, lightmaps
Input and Audio
• Input Engine
• Set input devices for controlling the game.
• Windows event loop, and DirectInput
• Sound and Music
• DirectX Sound API
• OpenAL (Open Audio Library [Link])
Networking
• Networking is required for multiplayer games
• Some of the problems are related to games that utilize the network :
• 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
• Example : DirectPlay on the DirectX communication library
AI and Game Rules
• The second most important thing after graphics
• Is the behavior / response of characters in the game (characters other than
players)
• 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?
Game loop
Game Loop
User Input
Network
Application Specific
Game Logic
Sound
Rendering
Time = 25 ms
Examples of Game Engine
• Unreal Development Kit
• Game Maker
• Unity
Game Engine -2-
CryEngine3
construct
RPG Maker
• [Link]