Top Banner
@hunterloftis We Will All Be Game Developers
54

We Will All Be Game Developers

Apr 16, 2017

Download

Software

Hunter Loftis
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: We Will All Be Game Developers

@hunterloftis

We Will All Be Game Developers

Page 2: We Will All Be Game Developers

@hunterloftis

Page 3: We Will All Be Game Developers

@hunterloftis

Page 4: We Will All Be Game Developers

@hunterloftisdemo

Page 5: We Will All Be Game Developers

@hunterloftis

“Would you be interested in a project for one of our

artists based on that FPS? We'd like to provide the

full album stream on Rustie's website while fans have

to navigate through the world.”

– Warp Records

Page 6: We Will All Be Game Developers

@hunterloftis

Time(3 weeks)

Page 7: We Will All Be Game Developers

@hunterloftis

Budget($)

Page 8: We Will All Be Game Developers

@hunterloftis

Technical Constraints(iPhone, iPad, Android & Desktop!)

Page 9: We Will All Be Game Developers

@hunterloftis

“Optimism is an occupational hazard of

programming. ”

– Kent Beck

Page 10: We Will All Be Game Developers

@hunterloftis

Page 11: We Will All Be Game Developers

@hunterloftis

4 Million Rays / Second

demo (FF)

Page 12: We Will All Be Game Developers

@hunterloftis

Page 13: We Will All Be Game Developers

@hunterloftis

1 Month later…

demo (babylon)

Page 14: We Will All Be Game Developers

@hunterloftis

I’m not a game developer.Why should I care?

Page 15: We Will All Be Game Developers

@hunterloftisLeveling Up

Page 16: We Will All Be Game Developers

@hunterloftis

App interfaces are becoming

more like games.

Page 17: We Will All Be Game Developers

@hunterloftis

App interfaces are becoming

more like games.

Page 18: We Will All Be Game Developers

@hunterloftis

App interfaces are becoming

more like games.

Page 19: We Will All Be Game Developers

@hunterloftis

App interfaces are becoming

more like games.

Page 20: We Will All Be Game Developers

@hunterloftis

3 Ideas from gamedevfor better user interfaces

30 mins left?

Page 21: We Will All Be Game Developers

@hunterloftis

1: Minimize and isolate state

Page 22: We Will All Be Game Developers

@hunterloftis

Page 23: We Will All Be Game Developers

@hunterloftis

Page 24: We Will All Be Game Developers

@hunterloftis

Apparent State (for just a running dude!)

demo (dude in forest)

• position

• velocity

• acceleration

• direction

• frame

• distance

• time

• all must sync!

Page 25: We Will All Be Game Developers

@hunterloftis

Derived Statedemo (walking speed)

frame

direction

posedistance

velocityposition

time acceleration

Page 26: We Will All Be Game Developers

@hunterloftis

Pure Functionsdemo (walking speed)

frame

direction

posedistance

velocityposition

time acceleration

Page 27: We Will All Be Game Developers

@hunterloftis

Minimal State

Page 28: We Will All Be Game Developers

@hunterloftis

2: Use deterministic, immediate-

mode rendering

Page 29: We Will All Be Game Developers

@hunterloftis

Retained Mode

(the DOM)graphics source: MSDN

Page 30: We Will All Be Game Developers

@hunterloftis

Retained Mode

(the DOM)graphics source: MSDN

Hacks go here

To indirectly

optimize here.

Page 31: We Will All Be Game Developers

@hunterloftis

Immediate Mode

(Canvas, WebGL, ReactJS)graphics source: MSDN

Page 32: We Will All Be Game Developers

@hunterloftis

Deterministic Rendering

Page 33: We Will All Be Game Developers

@hunterloftis

Page 34: We Will All Be Game Developers

@hunterloftis

Immediate + Deterministic = simple

Page 35: We Will All Be Game Developers

@hunterloftis

3: Separate rendering and simulation

Page 36: We Will All Be Game Developers

@hunterloftis

A Browser Timeline

Page 37: We Will All Be Game Developers

@hunterloftis

setInterval(frame, 0);

Page 38: We Will All Be Game Developers

@hunterloftis

setInterval(frame, 17);

Page 39: We Will All Be Game Developers

@hunterloftis

requestAnimationFrame(frame);demo (variable bodies)

Page 40: We Will All Be Game Developers

@hunterloftis

Decoupled rendering & simulation

Page 41: We Will All Be Game Developers

@hunterloftis

Time accumulator

Accumulator

Page 42: We Will All Be Game Developers

@hunterloftis

Time accumulator

Accumulator

- 16ms (1 “tick”)

- 32ms

Page 43: We Will All Be Game Developers

@hunterloftis

Time accumulator

Frame (16ms) Accumulator

Page 44: We Will All Be Game Developers

@hunterloftis

Time accumulator

Frame (16ms) Accumulator

accumulator + 16 = 16

Page 45: We Will All Be Game Developers

@hunterloftis

Time accumulator

Accumulator Simulation step

1

accumulator - 16 = 0

steps = floor(16 / 16) = 1

Page 46: We Will All Be Game Developers

@hunterloftis

Time accumulator

Frame (24ms) Accumulator

Page 47: We Will All Be Game Developers

@hunterloftis

Time accumulator

Frame (24ms) Accumulator

accumulator + 24 = 24

Page 48: We Will All Be Game Developers

@hunterloftis

Time accumulator

Accumulator Simulation step

1

accumulator - 16 = 8

steps = floor(24 / 16) = 1

Page 49: We Will All Be Game Developers

@hunterloftis

Time accumulator

Frame (24ms) Accumulator

Page 50: We Will All Be Game Developers

@hunterloftis

Time accumulator

Frame (24ms) Accumulator

accumulator + 24 = 32

Page 51: We Will All Be Game Developers

@hunterloftis

Time accumulator

Accumulator Simulation steps

2

accumulator - 32 = 0

steps = floor(32 / 16) = 2

Page 52: We Will All Be Game Developers

@hunterloftis

Time accumulatordemo (10 fps vs 60 fps)

Page 53: We Will All Be Game Developers

@hunterloftis

My favorite bug

demo (box bug)

Page 54: We Will All Be Game Developers

@hunterloftisThank you!

2D: Pixi.js, Matter.js

3D graphics: ThreeJS, BabylonJS

Game servers: iojs + Heroku (+ ws for multiplayer)

DOM & Native UIs: React.js • http://gamasutra.com/view/news/169296/

Indepth_Functional_programming_in_C.php • http://iamralpht.github.io/physics/