Title: LCC 6310 Computation as an Expressive Medium
1LCC 6310Computation as an Expressive Medium
2Overview
- Go over the syllabus
- Brief introduction to me and my work
- Art, programming and Java
3Syllabus
4Background
- Ph.D. in Computer Science
- Expressive AI Artificial Intelligence-based art
and entertainment - Worked in industrial research labs (Intel,
Tektronix) doing HCI research - New at Georgia Tech arrived in January
5AI Art
Black and White, 2000
The Senster, 1970
Edward Ihnatowicz
Peter Molyneux (Lionhead)
6Work
Façade interactive drama
Terminal Time interactive video
Office Plant 1 robotic sculpture
7Façade
- Dramatic world inhabited by computer controlled
characters (believable agents) - The user (player) plays a protagonist within the
story, first-person point of view - The player experiences a story with a dramatic arc
Collaborator
Andrew Stern, independent artist and researcher
8Terminal Time
Goal trees (ideology)
Historical events
Audience feedback
Collaborators
Steffi Domike, Design Department, Chatham College
Paul Vanouse, Art Department, SUNY Buffalo
9Office Plant 1
- Creates a background presence
- Sorts incoming email into social and emotional
categories - Behavior is a function of the email received
Collaborator
Marc Bohlen, Media Studies, SUNY Buffalo
10Combine AI research and art
Expressive AI
Artistic practice
AI research
AI methods and technology suggest new audience
experiences
Wrestling with meaningful human experiences
suggests new AI research directions
11Some directions
- Im someone to chat with about
- Interactive story (particularly procedural
approaches) - Robotic sculpture
- Video games as a cultural practice (design and
technology) - Meta-art (generative systems)
12Introduce yourselves
13Programming languages
- Abstract, human understandable language for
telling computer what to do - The abstract language must be translated into the
low level language understood by the machine - This translation is accomplished by an
interpreter or compiler - We will be learning the compiled language Java
14A simple Java program
class PrintLoop public static void
main(String args) for (int i 0 i lt 10
i) System.out.println("i " i)
Just prints the numbers 0 to 9 on the screen
15Human readable is relative
class PrintLoop public static void
main(String args) for (int i 0 i lt 10
i) System.out.println("i " i)
Java compiler translates this into
16Java VM assembly code
public static void main(java.lang.String)
Code 0 iconst_0 1 istore_1 2
goto 30 5 getstatic 8 new 11
dup 12 ldc 14 invokespecial 23 17
iload_1 18 invokevirtual 27 21
invokevirtual 31
24 invokevirtual 34 27 iinc 1, 1
30 iload_1 31 bipush 10 33 if_icmplt
5 36 return test.PrintLoop() Code 0
aload_0 1 invokespecial 43 4
return
17Object Oriented vs. Procedural Languages
- Procedural (e.g. C)
- We create some data representing an image (array
of pixels to draw on the screen) - We write a procedure than can be passed the image
and will draw it
- Object Oriented (e.g. Java)
- We create a class that contains an image AND a
routine draw it - The data and the behavior (ability to draw) are
in one "container"
18A couple of Javas relatives
- Smalltalk 80
- Alan Kay and the Dynabook (PARC)
- C
- Managing big C programs Bjarne Stroustrup
19Smalltalk 80
- Alan Kay and the Dynabook (PARC)
- Developed idea of a general purpose computer to
be used by normal people! - Highly interactive interface
- Included concept of windows!
- Smalltalk 80 end users could create their own
tools
20Smalltalk 80
- Includes objects
- Objects contain data and procedures
- Procedures in objects are called methods
- All computing is done by sending a message to an
object asking it to perform one of its method - Objects are defined by classes
21C
- Managing big C programs Bjarne Stroustrup
- Started as "C with Classes" idea borrowed from
Simula 67 Smalltalk - Goals
- Organize programs as classes with inheritance
- No performance penalty compared to C
- Thus somewhat dangerous!!!
- C is converted into C
22Java
- Designers started with C
- Smaller
- Simpler
- Safer
- Programming embedded systems
- Toasters, microwave ovens, TV set top boxes
- Reliability very important--avoid costly recalls
- Web programming
- Incorporated into web browsers at critical moment
23The virtual machine
- Since Java was designed to run on embedded
systems, it was designed around a virtual machine - Write once, run everywhere
PC
Mac
Cell Phone
Java VM
Java VM
Java VM
Windows
OS X
Phone OS
Processor
x86
G3/4/5
Java Machine
Java OS
Java VM
24Steps for running a Java program
Execute program
OS-specific Object Code
25Structure of Java programs
- Create one or more Java source files
- Compile each source file into a class file
- An application consists of these class files (not
a single file like a .exe) - To run the program, send one of the class files
to Java - This entry file must have method called main
- public static void main(String argv)
26Sample application
File HelloWorld.java
- public class HelloWorld
- public void greet()
- System.out.println("Hello World!")
-
- public static void main(String argv)
- HelloWorld hw new HelloWorld()
- hw.greet()
-
-
27Java file and class names
- Source code files must have the ".java"
extension. - The file name should match the class name. The
class name should start with a capital letter.
This naming convention is enforced by most
reasonable compilers. -
- A file containing
- class HelloWorld
- must be named HelloWorld.java
- Compiled bytecode has the ".class" extension
28Compiling HelloWorld
HelloWorld.class
javac
javac HelloWorld.java
0xCAFEBABE ...
javac is the Java Compiler
29Executing HelloWorld
java HelloWorld
java is the Java Virtual Machine
Cgtjava HelloWorld Hello World! Cgt
30Object Oriented Programming
- OOP is all about programming using something
called an object. - Objects are created from classes. An object is
called an instance of a class. - Objects do useful stuff by calling methods on
them. - Lets look at classes and objects in more detail.
31Previously...
- public class HelloWorld
- public void greet()
- System.out.println("Hello World!")
-
- public static void main(String argv)
- HelloWorld hw new HelloWorld()
- hw.greet()
-
-
32A Class
A class will be used to define how objects made
from this class will operate
- class Greeter
- String greeting
- public Greeter(String newGreeting)
- greeting newGreeting
-
- public void greet(String name)
- System.out.println(greeting ", " name)
-
-
33Field
A class typically will have one or more
fields which are the data items which the object
holds
- class Greeter
- String greeting
- public Greeter(String newGreeting)
- greeting newGreeting
-
- public void greet(String name)
- System.out.println(greeting ", " name)
-
-
34A Constructor
Classes can have Constructors which contain code
only run when an object is created. Useful for
initialization
- class Greeter
- String greeting
- public Greeter(String newGreeting)
- greeting newGreeting
-
- public void greet(String name)
- System.out.println(greeting ", " name)
-
-
35A Method
Once created an object can be asked to run a
"method" which will do something
normally involving data stored by the
object (plus sometimes data passed in.)
- class Greeter
- String greeting
- public Greeter(String newGreeting)
- greeting newGreeting
-
- public void greet(String name)
- System.out.println(greeting ", " name)
-
-
36Another Class
This class is just being used to hold a main
method. Here we make two Greeter objects and use
them
- class Driver
- public static void main(String args)
- Greeter g1 new Greeter("Hello")
- Greeter g2
- g2 new Greeter("Good morning")
- g1.greet("Bob")
- g2.greet("Mary")
- g1.greet("Sam")
- g2.greet("Joan")
-
-
-
Cgtjava Driver Hello, Bob Good morning,
Mary Hello, Sam Good morning, Joan Cgt
37OOP
- OOP consists of designing a bunch of classes most
of which are used as templates to make objects - The objects are used to hold data
- They are initialized with constructors and
perform useful functions by being asked to run
their methods