24
Programming with a gamepad Dave Griffiths 1

Programming with a gamepad · • Live coding doesn't have to be about text editors • Live coding doesn't have to be hard 4. Gamepads • Analogue sticks • Directional pad •

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Programming with a gamepad · • Live coding doesn't have to be about text editors • Live coding doesn't have to be hard 4. Gamepads • Analogue sticks • Directional pad •

Programming with a gamepad

Dave Griffiths

1

Page 2: Programming with a gamepad · • Live coding doesn't have to be about text editors • Live coding doesn't have to be hard 4. Gamepads • Analogue sticks • Directional pad •

Overview

• 2 music live coding environments

• Common stuff they share

Gamepads

Ringmenus

Uncrashable languages

• Betablocker

Demo

• Al-Jazari

Demo

• Thoughts

2

Page 3: Programming with a gamepad · • Live coding doesn't have to be about text editors • Live coding doesn't have to be hard 4. Gamepads • Analogue sticks • Directional pad •

Common stuff

3

Page 4: Programming with a gamepad · • Live coding doesn't have to be about text editors • Live coding doesn't have to be hard 4. Gamepads • Analogue sticks • Directional pad •

Vague themes

• Make watching live coding a bitmore accessible

• Live coding doesn't have to beabout text editors

• Live coding doesn't have to behard

4

Page 5: Programming with a gamepad · • Live coding doesn't have to be about text editors • Live coding doesn't have to be hard 4. Gamepads • Analogue sticks • Directional pad •

Gamepads

• Analogue sticks

• Directional pad

• Right hand buttons

• Shoulder buttons

• Force feedback

• Analogue buttons

5

Page 6: Programming with a gamepad · • Live coding doesn't have to be about text editors • Live coding doesn't have to be hard 4. Gamepads • Analogue sticks • Directional pad •

Ring Menus

6

Page 7: Programming with a gamepad · • Live coding doesn't have to be about text editors • Live coding doesn't have to be hard 4. Gamepads • Analogue sticks • Directional pad •

Ring menus

Values from analogue stick

7

Page 8: Programming with a gamepad · • Live coding doesn't have to be about text editors • Live coding doesn't have to be hard 4. Gamepads • Analogue sticks • Directional pad •

Ring menus

Convert to vector

8

Page 9: Programming with a gamepad · • Live coding doesn't have to be about text editors • Live coding doesn't have to be hard 4. Gamepads • Analogue sticks • Directional pad •

Ring menus

Use magnitude to activate menu

9

Page 10: Programming with a gamepad · • Live coding doesn't have to be about text editors • Live coding doesn't have to be hard 4. Gamepads • Analogue sticks • Directional pad •

Ring menus

Use angle to pick from items

10

Page 11: Programming with a gamepad · • Live coding doesn't have to be about text editors • Live coding doesn't have to be hard 4. Gamepads • Analogue sticks • Directional pad •

Ring menus

• Nice tactile feel• Good use of muscle memory• You can pick from quite a large

range• Seems easier than mouse based

'gestures'

11

Page 12: Programming with a gamepad · • Live coding doesn't have to be about text editors • Live coding doesn't have to be hard 4. Gamepads • Analogue sticks • Directional pad •

Uncrashable Languages

12

Page 13: Programming with a gamepad · • Live coding doesn't have to be about text editors • Live coding doesn't have to be hard 4. Gamepads • Analogue sticks • Directional pad •

Uncrashable Languages

• Design away crashesDivide by 0 returns 0Invalid memory read returns 0

• Genetic programming: Tierra• Not good for general purposes

Crashes stop unintended codefrom executingRemoving them makes bugs veryhard to find

13

Page 14: Programming with a gamepad · • Live coding doesn't have to be about text editors • Live coding doesn't have to be hard 4. Gamepads • Analogue sticks • Directional pad •

Uncrashable Livecoding

• Good for live coding:Less chance of embarrassment!Things can run out of controlChanges how you programMalleable/brittle

• All possible programs areexecutable

14

Page 15: Programming with a gamepad · • Live coding doesn't have to be about text editors • Live coding doesn't have to be hard 4. Gamepads • Analogue sticks • Directional pad •

Betablocker

15

Page 16: Programming with a gamepad · • Live coding doesn't have to be about text editors • Live coding doesn't have to be hard 4. Gamepads • Analogue sticks • Directional pad •

Betablocker influences

• TOPLAP discussion on virtualmachines ("Hello (& Chaos)" 2004)

• Corewars (Redcode)

• Forth

• Mr Driller

16

Page 17: Programming with a gamepad · • Live coding doesn't have to be about text editors • Live coding doesn't have to be hard 4. Gamepads • Analogue sticks • Directional pad •

Betablocker

• First attempt at gamepad coding

• Virtual machine

• Multithreaded

• No memory protection

• All memory is visible

• The rhythm is a direct result of theinstruction count

• Very unpredictable

17

Page 18: Programming with a gamepad · • Live coding doesn't have to be about text editors • Live coding doesn't have to be hard 4. Gamepads • Analogue sticks • Directional pad •

Demo

18

Page 19: Programming with a gamepad · • Live coding doesn't have to be about text editors • Live coding doesn't have to be hard 4. Gamepads • Analogue sticks • Directional pad •

Al-Jazari

19

Page 20: Programming with a gamepad · • Live coding doesn't have to be about text editors • Live coding doesn't have to be hard 4. Gamepads • Analogue sticks • Directional pad •

Al-Jazari

• 13th century scientist and inventor

First recorded use of gears

Crankshaft

Mechanical clock

Combination lock

• Programmable humanoid robot

Robot musicians for royal drinkingparties

20

Page 21: Programming with a gamepad · • Live coding doesn't have to be about text editors • Live coding doesn't have to be hard 4. Gamepads • Analogue sticks • Directional pad •

Al-Jazari

(live coding for royal drinking parties)

21

Page 22: Programming with a gamepad · • Live coding doesn't have to be about text editors • Live coding doesn't have to be hard 4. Gamepads • Analogue sticks • Directional pad •

Al-Jazari influences

• Influences

The Sims

Gullibloon's Army of Darkness

Simon Yuill's Spring Alpha (livecoding game)

• Musical robot livecoding

• Code in 'thought bubbles'

• Indirect musical triggers

• No text

22

Page 23: Programming with a gamepad · • Live coding doesn't have to be about text editors • Live coding doesn't have to be hard 4. Gamepads • Analogue sticks • Directional pad •

Demo

23

Page 24: Programming with a gamepad · • Live coding doesn't have to be about text editors • Live coding doesn't have to be hard 4. Gamepads • Analogue sticks • Directional pad •

Thoughts

• Simple languages

No abstraction, so hard/impossibleto build layers

Fun to play with

More practice will influence thelanguages

• Using a gamepad

More restricted than a keyboard

People don't think you areprogramming

People want to have a go

Detaches you from the laptop

24