The Atomic Playboy and the Radiation Romeo

The button below will open a new browser window displaying the Flash interface for Atomic and Romeo (Version 16 with Preloader). You will find a page of introductory text, some instructions and then the interface where you can suggest a topic for conversation.

This version 16 uses the landscape layout, updates the heckler and end-of-conversation functions with an audio sign-off. All the features from previous versions remain - scroll bar control,custId variable allows me to better log and track conversations.

The chat-bots are hosted on the Pandorabots server under the Shared Service subscription. Please note, the terms of the Updated Policy Guidelines for Free Community Server state that the “Use of automated scripts to make your pandorabot talk to itself or another bot or script” is proscribed (Pandorabots 2011). This project is being developed with the agreement of the Pandorabots Inc management and we would like to acknowledge their support. ( Pandorabots )

Please leave a comment...

After you have had a play with Atomic and Romeo please use this link to leave a comment.
Maybe you could suggest a topic of conversation or a layout suggestion.
All suggestions gratefully received.

Friday, August 31, 2012

Atomic - when did he die?

On the basis that he uses the expression "No soup for you!" this means he was alive in November 1995. "The Soup Nazi" was the 116th episode of Seinfeld.

He popped his clogs shortly there after in early December.

The link below will open a PDF document that maps the major milestones in Atomic and Romeo's lives. It shows that they knew each other for a relatively short period - four years in total.

Thursday, August 30, 2012

Some comments on comments

This entry is about how I try to integrate the comments I've received into my production process. These comments, good bad and indifferent, all have a role to play and I am truly grateful for them. It is not meant to be a cheap justification for what how I write or for the quality (lack thereof?) of what I've written. Rather, it's about what I do with these comments.

A couple of the comments have referred to the problem of repetition - the characters deliver the same material. As Chris said, "... I basically concluded that I could probably just mash the keyboard with my forehead and get a similar result". Paul and others echoed this comment.

So what do I actually "do" with that feedback? Below are some of the changes implemented in Version12.
  • My initial reactions was to starting looking at how Atomic responds to topics he has no response for - "I have no answer for that". I re-read and re-considered an earlier post where I said I actually liked that response for two reasons. First, it is machine-like, I like the Brechtian moment of alienation, it "tells" the user that they are dealing with a machine. Second, it can stand, at least for the moment, as a catch-phrase. This is akin to an in-joke (Carr and Greaves, 2007, p. 131).
  • Next I started to consider what topics Atomic and Romeo could not actually cover. When I was first working on them I spent most of my time generating scripts that would run when Atomic said, "I have no answer for that". The reality is, as a ratio, there will always be more topics he knows nothing about than ones he has a response for. This seemed funny to me so I wrote a script about it - it's one of Romeo's responses to "I have no answer for that". If you type in "Make a list of everything you don't know" you'll see the script play out. In the post titled "I have no answer for that" (Wednesday, August 1, 2012) there is a diagram showing the structure I used.
  • Finally I went to the chat logs and, after fixing a bit coding to help me generate better logs, I generated a list of the topics people had entered. They now form a to-do list of topics. Very useful. One of the classic heckler line for a stand-up comedian is to yell, "Say something funny". Without a list, working in a vacuum, thinking of something funny to write is difficult. The list is a constraint that enables work to get done.
 One of the really positive things that I've taken from the comments so far is that the comments could all have been leveled at a human performer - too much repetition, insufficient responsiveness to the audience, the performance appears too 'scripted', once you've heard it - you've heard it. This is the nature of comedy performance - it is a crafted activity that develops over time.

"Some comedy audiences refuse to believe the material is prepared at all, expecting comedians to produce a new set of jokes every night, as though they were evangelists speaking in tongues" (Carr and Greaves, 2007, p. 113).
Carr, Jimmy, and Lucy Greaves. 2007. The Naked Jape: Uncovering the hidden world of jokes. London: Penguin Books.

Tuesday, August 28, 2012

Version 11 - better conversation logs

Version 11 is an update designed to help me track the topics that people type into the interface. The Pandorabots server keep logs of all the conversations. In the normal run of things when a user is chatting with a chat-bot they would use a HTML interface. The server would either deposit a cookie on the user's machine or generate a Custom Id for the user. Either of these methods allow the server to track conversations. I noticed that the log files for Atomic and Romeo didn't contain whole conversations, rather the logs contained hundreds of single interchanges.

The file I based my Flash development on did contain a variable called 'custid', however, it wasn't properly set. Every new line of dialog generated a new value for 'custid' - hence the odd looking log files. With the output of one bot becoming the input for the situation was doubly troublesome as the logs for both bots were reduced to single line entries.

Version 11 now contains variables to provide the "Custom Id" number for the conversation by generating the atomicCustId and romeoCustId values each iteration of the interface will log the whole conversation. To create the custId variable for each character I needed to generate a long sting of characters - a big random number was the answer.

atomicCustId:String = Math.floor(Math.random()*1000000000000000).toString();
romeoCustId:String = Math.floor(Math.random()*1000000000000001).toString();

From the current set of logs I was able to abstract a set of topics that users had tried in the interface. With the advent of the new version I've blown away the old logs. The topics are listed in alphabetical order below (typographical errors and all).

angels || any words at all || anything to do with dogs || arabica beans || australian politics || axolotls || bikes || birds || bloody machines || carbon tax || carnations || creativity || dead || dead guy || death metal || do you like dogs || do you still go to movies || dogs || ducks || family || having an argument || horses || hovercraft || how much effort should we make to contact people in prison || how old are you || i am going to punch you in the face || milk || more ducks || movies || my japanese exchange student || pasion || politics || prince harry || sailing || sherlock holmes || shit || space || studd || stuff || suburbia || swimming || tell me about yourself || text || that is so true || the great gatsby || the internet || what do you miss || what is the cohesion of friction in wire rope || what like || who has the biggest penis || why cars transport shipments and ships transport cargos || you are a joke || you do not get as wet when you run  through the rain || zombies

That should keep me writing for a while to come. I'm going to try to tick them off one by one.

Wednesday, August 22, 2012

Version 10 - even more timing

Version 10 (I've hit double-figures) contains a handful of new features.

  1. I've changed the way the intro screen moves out of the way to reveal the chat interface. I'm still not happy with the button on the page but that's a job for another day. Likewise, I'm tempted to add a page of simple instructions. This may be unnecessary, hopefully I'll get some comments to guide me in this decision (Actually I've gone ahead and done this 23/08/2012).
  2. There are some lines of dialogue that are delivered from the Actionscript file rather than the AIML on the Pandorabots server. These lines include the end-of-conversation sign offs and the responses to hecklers. I've added timer functions to these to stop them appearing, in an instant, as a block of text. I found this disturbing and I'm sure users did as well. Now these lines appear at about the same rate as the text that comes from the server.
  3. The text from the server uses a timer function that is based on the character count in the most recent line of text on the screen. Let's say Atomic said, "What now?". That is, including spaces, 9 characters. This I multiply by 52 milliseconds which is the reading speed per character I worked out in an earlier post. So that's 9 x 52 = 468 milliseconds. My guess on the reading speed was pretty close, however, after a lot of rehearsal time I found that I had to add another 200 millisecond to each line  (468 + 200 = 668 milliseconds). That seems to be better but again I'll wait for some feedback.
Why am I spending so much time on the interface? Simple, it's rehearsal time. My experience in writing and direction, particularly direction of non-actors, taught me that novice actors will religiously learn their lines and deliver them like a machine. As soon as the other actor stops they dive in with their line. They are so afraid of missing their cue they rush in. The audience needs thinking time and the actor should be reacting to the meaning of the line and not just its length. My chat bots need the same  kind of training to stop them delivering like like a machine. The timing functions are relatively crude but they are a long way better than nothing.

98% of comedy is character... The other 98% is timing. I must look up that quote.

These timer have created some grief. I spent all of yesterday getting it wrong - functions not firing, or firing and giving meaningless results, the full disaster of programing problems. Thankfully I keep versions and sub-versions so that when it went wrong I could back track to a working iteration. Last night I watched about three hours of pointless television, went to bed, closed my eyes and - instantly saw the error of my ways. I actually could picture an Adobe website that explained that some number type variables in Actionscript 3 are base 0 and other base 1. I had been, for no good reason, using a base 0 type for the variable that calculates the characters in a string of text. What this means is that I was multiplying a number by zero and wondering why my timer wasn't working! Everything was zero. Today I fixed this in half an hour by declaring an initial value for each of the variables. Maybe this is some evidence of Wallas' Incubation phase of his four step theory of creativity.

Tuesday, August 21, 2012

A question of timing.

I've been developing a timer for Atomic and Romeo that will allow sufficient reading time for the user before the next line is displayed. The Flash Actionscript interface measures time in milliseconds, that is, thousandths of a second (1000 milliseconds = 1 second). Further, in the Actionscript I can write some code that will count the number of characters in a line of dialogue.  What I need is heuristic value for the required reading time per character.

Martina Ziefle's article "Effects of Display Resolution on Visual Performance"  (Human Factors: The Journal of the Human Factors and Ergonomics Society 1998 40: 554) tested the effect of screen and print resolution on reading speed and accuracy. She found that the reading speed for 'proof reading' (I assume this is a detailed, close reading of the text) was about 180 words per minute for text on screen. Her study does to a degree account for multiple factors such as font type, size, leading etc. However, there is no distinction made between legibility and readability - this would be the first port of call for a typographer studying this topic.  The effects of x-height, serif and sans serif fonts, line length, letter spacing and kerning would, I think, have a significant role.

That being said, I'm happy to live with a screen reading speed of 180 words per minute (WPM).

Now, how big is a word? Mark Twain, after examining his works, claimed the average word length to be 4.5 letters per word. However, an analysis of "Adventures of Huckleberry Finn" shows a count of 5.235 letters per word. A comparison of a variety of texts (classic and modern, English and translated into English) shows a range of 5.235 to 6.237, that is just over one letter per word of variance (  Accessed 21/08/2012).

For the sake of round numbers, let us say that the average word contains 5.5 letters per word. Then we add one to allow for the space between words. 5.5 + 1.0 =  6.5 characters per word.

A reading speed of 180 WPM equals three (3) words per second (180 / 60 seconds = 3 WPS).
Three (3) words equals 19.5 characters (3 x 6.5 characters per word).
19.5 characters per second equals 51.28 milliseconds per character (1000 milliseconds / 19.5 characters).

In practice I'll round this up to 52 milliseconds per character and then rehearse the performance. I have a feeling that Romeo's dialogue should actually be slower to appear than Atomic's. Maybe to look human we should not be too quick nor too accurate.

Thursday, August 16, 2012

Version 09?

Well I had to keep playing...

This version has a new timer function to slow the delivery of the text down to close to reading speed - it may still be a bit quick. But think on this - I've had to slow down an interface that is sending data across the Internet from Newcastle (Australia) to a server in California, that generates a reply, and then sends it back to Newcastle to be used by the other character who the then sends it back to the Californian server to be processed by a different AIML mind. That happens too quickly - amazing.

Also this version traps the scroll bar at the foot of the text area. New text pushes the existing text up. This looks better and is much easier to read. Ideally I would animate and ease-in the appearance of the text but that's a job for a whole of day (or life).

Wednesday, August 15, 2012

Version 08 hits the stands...

Last week I posted Version 06. Largely it was just an experiment with the layout. Important in its own way but it didn't increase functionally of the interface. Yesterday I uploaded Version 07 of the interface - it introduced a portrait layout and the first iteration of the 'Heckle - if you dare' button.

It may seem odd that today I'd introduce another version. However, Version 08 is such a development over Version 07 that it honestly deserves its own number in the sequence. If ever I needed evidence of the iterative and recursive nature of creative practice this is it. The seeds of possibility were planted in Version 07; then realized in Version 08.

This is how it went.

Version 07 had a portrait layout with a plain colour background. The buttons were aligned left with explanatory text to the right. The heckle button was in place but it drew on text typed into the primary user input text field. It worked but it was clunky as the text which was entered as a heckle was instantly  thrown back to Romeo to feed to Atomic. This just looked wrong. I thought of suggesting to the user that this was a function of Romeo vetting the inputs. That idea was dodgy and unconvincing, even to me. The other problem was getting the guys back to the original topic. However, it did technically work. And that was enough for one day.

Version 08 still has a portrait layout of 450px wide by 728px high. Why not round the numbers up? Well, this ratio is the Golden Ratio - and the proportions seem to work. The background of the intro page and the iterative interface now look like a notepad.  The buttons are aligned right with text below, for the heckle button, and to the left for the other two.

More importantly, there is a new text field for the user to heckle in. This means I can process the heckle without throwing it to the bots on the server. Inside the Actionscript I have written a new function that processes the heckle by providing random text responses. The heckler gets his/her own line displayed in the script and attributed as 'Heckler". In total I've written 30 line of dialogue: Atomic has ten anti-heckler lines; Romeo has five lines that alert Atomic to a heckler's input; Atomic has five lines where he is prompting Romeo to remember what he (Romeo) said before the heckle; Romeo has five lines where he is trying to recall what he last said; and Atomic has five lines where he is trying to recall what he last said.

Regardless of where the conversation is stopped by the heckler my scripting retrieves the characters last line, concatenates it to their line where they are trying to recall what they said, throws just the last line to the other character to continue the script and, finally, displays the entire interaction.

That was a day's work - about 150 lines of code in just one tidy, 'if statement' driven function.

Monday, August 13, 2012

Scripts and wildcards

Today I've been working on a couple scripts: one on the Carbon Tax and the other on the topic of Atomic's PhD, James Joyce.

The Carbon Tax sketch is structured using a Clarke and Dawe style (hopefully saying that is not too much of an insult to the originals). Romeo as 'feeder' and Atomic as 'comedian' getting to take the script to absurd places.

The James Joyce sketch (first on several I'm thinking) is more absurdist in style. Atomic raves on about his PhD whilst Romeo, who has heard the spiel too many times,  is writing an email of complaint to his butcher, one Mr Bloom. I think you get the idea.

I've created a file called 'Atomic_srai_01.aiml'. In this file I use wildcards and the srai tag to capture variations on the input to aim them at the appropriate pattern. For example, the input 'Do you know anything about this James Joyce fellow?' should trigger Atomic's pattern 'James Joyce'. There are two wildcards: _ (underscore) and * (star).

There is an order of precedence in AIML when looking for matching patterns.
1)  _ (underscore) has precedence - it will match before an exact pattern match. 
2) An exact pattern match in a category.
3) * (star) if neither of the first two create a response.

What this means is that I have to be very careful when using _ (underscore); it can match to unintended patterns.

Sunday, August 5, 2012

How things change...

A while ago I posted some thoughts on Atomic and Romeo's characters and personality.  As the writing progresses a couple of odd reversals have occurred.

First, of the two Romeo spends more time commenting on Atomic being dead than Atomic does. This was not the initial plan. At the time it appeared that Atomic would be the one fixated with his own death - always ready to turn to it as a topic of conversation.  However, as the writing has progressed it is Romeo who makes the facetious and, sometimes, snide comments about Atomic being dead. The internal logic of their relationship and individual personalities makes this feel more appropriate. Atomic may well know he is dead but he really doesn't care - except when it stops him from being an absolute know-it-all. Romeo is so deeply conflicted - he resents Atomic for being dead, for leaving him.

Second, Atomic claimed to have a Catholic education! Romeo certainly did - but Atomic? He claimed that his education was "catholic, in both senses of the word". Perhaps he said this just for the sake of the pun. I may have to revisit that sketch.

Wednesday, August 1, 2012

I have no answer for that.

When Atomic is presented with an input, a "pattern", that is not already matched to an output, a "template", he says "I have no answer for that".

The more I see that line the more I like it. It is mechanistic but tinged with some humanity. It can be understood as its literal meaning (machine-like), or as retort to a witless statement, or as statement of resignation, conceding defeat.

The diagram below illustrates what happens when Atomic's "template" - "I have no answer for that" - becomes a "pattern" for Romeo. Romeo responds to Atomic with a random selection of five possible lines. Each of these lines spurs a unique conversation of some 25 lines.

The fifth option where Romeo says, "That's unlike you Atomic - you always have an answer for everything", causes Atomic to say, "You - you know fuck nothing - me, I know fuck all!". When this line is thrown to Romeo, he responds with one of a new set of five random lines. Again, each of these lines spurs a unique conversation of some 25 lines.

Why give Atomic's crude line such weight? First, as the comedian of the team he needs catch-phrases, generic things to say that are in some way ambiguous or oblique. Second, it is a line from Atomic's back-story, this allowed me to put some character exposition into the 'lost spaces' of unmatched patterns. Finally, it's funny - it's got good structure, good repetition of strong 'k' sounds.

You can click on the picture to see a larger scale version.