hey indies, it’s a great time to build an engine

46
Damián Isla, Moonshot Games HEY INDIES, IT’S A GREAT TIME TO BUILD AN ENGINE

Upload: reya

Post on 23-Feb-2016

48 views

Category:

Documents


0 download

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 Presentation

TRANSCRIPT

Page 1: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

Damián Isla, Moonshot Games

HEY INDIES,

IT’S A GREAT

TIME TO BUILD AN ENGIN

E

Page 2: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

Unan

noun

ced

Page 3: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

Disclaimers

1. Goes against history and common sense

2. Not for everyone

Page 4: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

You Know You Want To

Build your own game engine!

Page 5: Hey Indies, It’s  a  Great  time  to  Build  An  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

Page 6: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

Observations

1. You can reinvent as much of the wheel as you want.

2. The Engine IS the Game

Page 7: Hey Indies, It’s  a  Great  time  to  Build  An  Engine
Page 8: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

ENGINES ARE CONTENT MACHINES

Part 1:

Page 9: Hey Indies, It’s  a  Great  time  to  Build  An  Engine
Page 10: Hey Indies, It’s  a  Great  time  to  Build  An  Engine
Page 11: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

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.

Page 12: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

The Content Problem

“Shovel content into the game as fast possible.”

Bitmaps Audio Models Environments Animations Objects Behavior ...

???

Page 13: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

ModelGeometry

Textures

LOD 1LOD 2LOD 3...

ColorBumpDetailSpecular...

SkeletonLOD 1LOD 2LOD 3...

Vertex weights

AIBehaviorPerceptionScript support...

AnimationsAction logic

Ragdoll

AudioFXDialogue...

Game params(~10 bajillion)

Page 14: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

CryEngine 2

Sandbox TM / Roads and Rivers Tool

Page 15: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

CryEngine 2

Editorfull-featured terrain editor

StorageParametric surface

RuntimeDynamically tessellated polygon-based terrain

Page 16: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

Flexibility vs. Usability

Flexibility

Usab

ility

Universal Principles of Design – Lidwell, Holden & Butler , 2003

Page 17: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

Generality vs. Usefulness

Generality

Usef

ulne

ss

Behavior

Your Engine

Universal Principles of Design – Lidwell, Holden & Butler , 2003

Bitmaps Licensed Engine

Page 18: Hey Indies, It’s  a  Great  time  to  Build  An  Engine
Page 19: Hey Indies, It’s  a  Great  time  to  Build  An  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)

Page 20: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

MIDDLEWAREPart 2:

Page 21: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

The Hard Bits

Reinvent as much of the wheel as necessary.

Physics Animation Scripting Pathfinding

For the rest, there’s middleware.

Page 22: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

The Ideal

The best way to build an engine is to assemble it.

Page 23: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

Choose your Price

Box2d, Bullet Havok Physics, PhysX

Cal3d Granny, Havok Behavior, Morpheme

GameSWF Scaleform, Iggy

Lua ... Lua?Recast, OpenSteer AI.implant, Kynapse,

Navpower

Page 24: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

SPUTNIKPart 3:

Page 25: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

Sputnik

Dev Time: ~ 1 year

Team size: 2

Cost: $0 (excluding labor)

Page 26: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

ScriptClear

Maintainable

Iterable

Philosophy

Performant, Game-

agnosticExquisitely Engineered

C++

Loose

Game-specific

Page 27: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

Sputnik

App-Layer Features

AI / A* 2d physics Embedded Flash Layer-based rendering skeletal 2d animation

Page 28: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

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”

Page 29: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

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

Page 30: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

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

Page 31: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

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

Page 32: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

Pervasive Scripting

The Goals

Everything you can do in C++, you can do in Script

To Create a Continuity between Prototyping and Production

Page 33: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

Pervasive Scripting

We use Lua Runtime recompilation Dynamic typing

Two parts Component scripts System scripts

Hurray!2x Productivity

Kill me now

Page 34: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

Component Scripts

A*

Perception/Ray-casting

Target selectio

n

Behavior

Physics

Animation

playback

Animation control

Squad behavi

orRando

mScript

Page 35: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

Component Scripts

A*

Perception/Ray-casting

Target selectio

n

Behavior

Physics

Animation

playback

Animation control

Squad behavi

orRando

mScript

Page 36: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

System Scripts

I/OBoids

Subtitles

Console

Effects

Rendering

Achievements

Missions

Random

Script

Page 37: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

System Scripts

Missions

Page 38: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

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.

Page 39: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

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

Page 40: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

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

Page 41: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

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.)

Page 42: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

DEMO

Page 43: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

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

Page 44: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

Necessities

Time Experienced engineering Data

Serialization Versioning

Tools Don’t be afraid to go custom Optimize the critical pipelines Undo/redo Copy/paste

Page 45: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

“Write Games Not Engines”

Yes.Don’t build in isolation

You won’t get your representations right

The Engine IS the game

Page 46: Hey Indies, It’s  a  Great  time  to  Build  An  Engine

Thanks!