Slide 1

Slide 1 text

Building a 2D Tile Engine in Unity by Michael C. Neel @vinull / vinull.com

Slide 2

Slide 2 text

What is this talk?

Slide 3

Slide 3 text

Unity 4.5 – A New Hope …Lost

Slide 4

Slide 4 text

What is a 2D Tile Engine?

Slide 5

Slide 5 text

What is a 2D Tile Engine?

Slide 6

Slide 6 text

What is a 2D Tile Engine?

Slide 7

Slide 7 text

Background

Slide 8

Slide 8 text

Tiled and XTiled

Slide 9

Slide 9 text

Unity Options Few free and Open Source Only basic support Limited map size

Slide 10

Slide 10 text

UTiled Project Goals All Features of Tiled No Size Limit Modifiable (destructible environments) “The Unity Way”

Slide 11

Slide 11 text

The Unity Way Prefabs for Layers Scriptable Objects Unity 4.3 – Sprites and Spritesheets Colliders from Polygons Editor UI

Slide 12

Slide 12 text

What a mesh! Sprite object have high overhead “Pixel Perfect” Physics issues better in 4.5, but still some remain No Zlib or Gzip compression support in Unity’s Mono Cannot access source image before import processor

Slide 13

Slide 13 text

M*E*S*H Geometry is painless

Slide 14

Slide 14 text

M*E*S*H Geometry is painless

Slide 15

Slide 15 text

1 (0,0,0) 3 (1,1,0) 4 (0,1,0) 2 (1,0,0) V[] = (0,0,0), (1,0,0), (1,1,0), (0,1,0) M*E*S*H Geometry is painless

Slide 16

Slide 16 text

1 3 4 2 1 2 1 = 1, 3, 4 2 = 1, 2, 3 T[] = 1, 3, 4, 1, 2, 3 M*E*S*H Geometry is painless

Slide 17

Slide 17 text

1 3 4 2 M*E*S*H Geometry is painless (0,0) (1,1) (0,1) (1,0) 0.167 UV[] = (0, 0), (0, 0.125), (0.167, 0.125), (0.167, 0)

Slide 18

Slide 18 text

M*E*S*H Geometry is painless 3 8 10 13 3

Slide 19

Slide 19 text

Demos! 1. Draw a circle 2.Draw the rest of the owl

Slide 20

Slide 20 text

The Technology Cooperative techco.org speakerdeck.com/vinull [email protected] vinull.com @ViNull