hey indies, it’s a great time to build an engine
DESCRIPTION
Hey Indies, It’s a Great time to Build An Engine. Damián Isla, Moonshot Games. Unannounced. Disclaimers. Goes against history and common sense Not for everyone. You Know You Want To. Build your own game engine!. “I am more emotionally invested when it’s my own tech.”. - PowerPoint PPT PresentationTRANSCRIPT
Damián Isla, Moonshot Games
HEY INDIES,
IT’S A GREAT
TIME TO BUILD AN ENGIN
E
Unan
noun
ced
Disclaimers
1. Goes against history and common sense
2. Not for everyone
You Know You Want To
Build your own game engine!
“Reinventing the wheel”
“I get total control”
“I know exactly how everything works”
“I am more emotionally invested when it’s my own tech.”
“We can get on to more platforms faster.”
Write games, not engines
Observations
1. You can reinvent as much of the wheel as you want.
2. The Engine IS the Game
ENGINES ARE CONTENT MACHINES
Part 1:
What Makes a Great Engine?
NOT rendering physics AI
The ability of content creators to shovel content into the game as fast as possible
... and to iterate on it.
The Content Problem
“Shovel content into the game as fast possible.”
Bitmaps Audio Models Environments Animations Objects Behavior ...
???
ModelGeometry
Textures
LOD 1LOD 2LOD 3...
ColorBumpDetailSpecular...
SkeletonLOD 1LOD 2LOD 3...
Vertex weights
AIBehaviorPerceptionScript support...
AnimationsAction logic
Ragdoll
AudioFXDialogue...
Game params(~10 bajillion)
CryEngine 2
Sandbox TM / Roads and Rivers Tool
CryEngine 2
Editorfull-featured terrain editor
StorageParametric surface
RuntimeDynamically tessellated polygon-based terrain
Flexibility vs. Usability
Flexibility
Usab
ility
Universal Principles of Design – Lidwell, Holden & Butler , 2003
Generality vs. Usefulness
Generality
Usef
ulne
ss
Behavior
Your Engine
Universal Principles of Design – Lidwell, Holden & Butler , 2003
Bitmaps Licensed Engine
The Content Meta-Problem
“Shovel content into the game as fast possible.” Bitmaps Audio Models Environments Animations Objects Behavior ...
Find the Game as fast possible.(i.e. define all of the above)
MIDDLEWAREPart 2:
The Hard Bits
Reinvent as much of the wheel as necessary.
Physics Animation Scripting Pathfinding
For the rest, there’s middleware.
The Ideal
The best way to build an engine is to assemble it.
Choose your Price
Box2d, Bullet Havok Physics, PhysX
Cal3d Granny, Havok Behavior, Morpheme
GameSWF Scaleform, Iggy
Lua ... Lua?Recast, OpenSteer AI.implant, Kynapse,
Navpower
SPUTNIKPart 3:
Sputnik
Dev Time: ~ 1 year
Team size: 2
Cost: $0 (excluding labor)
ScriptClear
Maintainable
Iterable
Philosophy
Performant, Game-
agnosticExquisitely Engineered
C++
Loose
Game-specific
Sputnik
App-Layer Features
AI / A* 2d physics Embedded Flash Layer-based rendering skeletal 2d animation
Sputnik
Core Features
data-reflection component
object-model data versioning pervasive scripting C# Editor Bindings memory management performance tools XML / binary file formats in-engine Performance tools
“High-leveragetechnologies”
Sputnik
Core Features
data-reflection component
object-model data versioning pervasive scripting C# Editor Bindings memory management performance tools XML / binary file formats In-engine Performance tools
Data Reflection
Run-time information about the structure of data types Do you have a field named “foo”? What is the offset of that field from the start of the
instance? Is it read-only?
Note: Built into Java/C# Implicit in C/C++
The Big Advantage: allow type-agnostic code
Data Reflection
C++ Class(file.h)
Run-timeSchema
C# Glue
Parse(Python)
DataSerialization
VersioningLua
C# Editors
s_plane2d::x_s_plane2d_schema_handle= schema_new("s_plane2d", "");if (s_plane2d::x_s_plane2d_schema_handle.valid()){
s_schema *schema= s_plane2d::x_s_plane2d_schema_handle.get();
schema->set_initialize(s_plane2d_initialize);schema->set_erase(s_plane2d_erase);schema->add_struct_field("normal", "s_vector2d",
_read_write, 1);schema->add_struct_field("point", "s_vector2d", _read_write,
1);
schema->set_expected_size(sizeof(s_plane2d));}Note: We DON’T support
•multiple inheritence•virtual functions
Pervasive Scripting
The Goals
Everything you can do in C++, you can do in Script
To Create a Continuity between Prototyping and Production
Pervasive Scripting
We use Lua Runtime recompilation Dynamic typing
Two parts Component scripts System scripts
Hurray!2x Productivity
Kill me now
Component Scripts
A*
Perception/Ray-casting
Target selectio
n
Behavior
Physics
Animation
playback
Animation control
Squad behavi
orRando
mScript
Component Scripts
A*
Perception/Ray-casting
Target selectio
n
Behavior
Physics
Animation
playback
Animation control
Squad behavi
orRando
mScript
System Scripts
I/OBoids
Subtitles
Console
Effects
Rendering
Achievements
Missions
Random
Script
System Scripts
Missions
A Note on Script Data
Script data will need to Serialize Version Interoperate with tools
All of this suggests All script data is schematized The engine manages all script data Lua’s memory pool is transient Ancillary benefit: One lua state per source file, not
one per instance.
The Result
Systems that don’t exist in Fallen Frontier: Health / death / damage Weapons / items / equipment / powers AI Behavior HUD / UI / Menus Missions / Levels / Objectives
C# Editor Bindings
Why C#?
The best language for the job Easy, familiar, elegant Reasonably performant Massive availability of dev tools
syntax coloring, intellisense winforms
Organization Build Sputnik Core as DLL Reflection Layer in C# Reflected classes call transparently into DLL
A Word on Editors
The two most important workflow /productivity technologies ever
invented:
Copy / pasteUndo / Redo
(Hard to start with, very VERY hard to retro-fit.)
DEMO
Ideas
The Engine is the Game Game Concepts are Supported at Every
Level Flexibility vs. Usability Meta-Content: Finding the Game Tight Core vs. Loose App Layer High-Leverage Technology
Data Reflection Pervasive scripting Tools
Necessities
Time Experienced engineering Data
Serialization Versioning
Tools Don’t be afraid to go custom Optimize the critical pipelines Undo/redo Copy/paste
“Write Games Not Engines”
Yes.Don’t build in isolation
You won’t get your representations right
The Engine IS the game
Thanks!