Save the Robot – Chris Dahlen

Work blog

My first Google Wave Project: The Yo Mama Bot

with 10 comments

Yo_Mama_Bot

So I landed an invite to Google Wave last month (thanks to Ed Atwell), and I finally took a stab at using it for something. And boy, this is something that will change the world: it’s a bot that tells, and learns, “Yo Mama” jokes.

Google Wave makes it very easy to make bots in Java or Python. The documentation that I followed includes:

- The App Engine “getting started” guide

- The Google Wave Bots tutorial

After setting up Eclipse and using these guides, I had a simple bot up and running in a couple of hours (and my Java is rusty). The whole project took five hours.

Wave offers sample codes for very simple bots that will pipe up during your Waves. The trick here is that I wanted to save jokes as well as telling them – and idea I picked up from the game Dangerous High School Girls in Trouble. This seemed like the real hook: as people across Google Wave interact with the Yo Mama Bot, it’s learning and then dishing out new jokes.

And it was pretty easy to code, using Google’s almost dummy-proof data store feature. Basically you set up the class you want to persist (e.g. Joke), add tags to the properties you’re persisting, let the built-in Data Nucleus thing “enhance” the class, and you’re all good. The App Engine gives you a dashboard where you can see and edit all the saved data, as well as browse logs, look at traffic, and so forth.

That said, although Wave does most of the heavy lifting for me, I also ran into weird bugs. At first, everything my bot said was repeated – like, “Yo mama! Yo mama!” I made plenty my own mistakes, but this turned out to be a Google Wave bug; luckily, it was easy to find a workaround. I also made a small change that was supposed to improve performance and then, somehow during my build, managed to screw up the Joke class so that it wouldn’t persist anymore, which made me go, “WHA?” and led me to the simplest solution, which was just to rename the class and rebuild the whole thing. The “new” class was correctly enhanced and persisted, and the app ran again.

Other hassle here: you still can’t deploy and test the bots locally; you have to do it in Wave. So the bot I was sharing with my close pals kept crashing all day Saturday. Whoops!

But now it’s up and running and I’m pretty pleased with it. I just need to spread the word, to people who actually have Wave access. If you want to give it a whirl:

1. Add “yomama-bot@appspot.com” as a contact.
2. Add it to a wavelet.
3. It’ll say hi. And after that, type in a “Yo mama” joke to get one back, or just say “Oh yeah?” to hear one that it knows.

Don’t run anything too offensive – I record the names. (Google Wave does not, so far as I know, have anonymous users.)

What did I learn from this? One, a lot of “yo mama” jokes. Two, even though this is a simple example – that was fairly simple to build – it’s also powerful. You could run a sophisticated Java app on the app engine, use Google’s data store for your data layer, and really be in business. If you wanted to run a tabletop-esque game session on Wave, you could code any number of very powerful bots to enforce rules, persist characters, deliver content, or really anything you want. Apparently, Wave can also be embedded in other apps, which opens the door to bringing a sophisticated chat-type thing right into your game or app.

And of course, the nice thing about bots in Wave, as opposed to Twitter, is that you can invite them in to specific waves. You only see them when you need them. Gaming on Twitter appears to have stalled because seeing other people’s posts and autoupdates is lethally annoying. But Wave is fertile ground for bots, and I see a lot of potential here.

Written by savetherobot

November 3, 2009 at 11:43 am

Posted in Uncategorized

10 Responses

Subscribe to comments with RSS.

  1. I don’t have save access, so here goes:

    “yo mama’s so fat that when she hauls ass she gotta make two trips”

    Iroquois Pliskin

    November 3, 2009 at 11:58 am

  2. er wave access!

    Iroquois Pliskin

    November 3, 2009 at 11:58 am

  3. Absolutely brilliant.

    Now, how about bending your considerable talents to Wave-ifying the bot from http://archive.gamespy.com/fargo/august03/autorpg/index.shtml ?

    Ethan

    November 3, 2009 at 12:00 pm

  4. Iroquois – Added!

    Ethan – Thanks! Thanks for taking a look, I really appreciate it. And I love that bot! Truth be told I’m just fascinated with all these bots, the sillier the better. I wrote a story earlier this year about the Glider bot that let people cheat in World of Warcraft, and it was fascinating to learn how sophisticated they’d become – they’ll hop fences, throw out junk items from your inventory, and walk to towns and trade with NPCs who they can identify by name. I almost felt like, “Jeez, these things are too good to ban!”

    savetherobot

    November 3, 2009 at 12:12 pm

  5. Only the inventor of the funkulator would have come up with that. Very cool.

    Ian

    November 3, 2009 at 2:04 pm

  6. ya momma’s so fat, she smokes turkeys after sex

    Iroquois Pliskin

    November 3, 2009 at 8:52 pm

  7. So what happens if a bunch of people start telling it nonsense jokes as an act of sabotage?

    Mark

    November 12, 2009 at 4:44 am

  8. I would delete them. But that’s about the only thing I’d delete.

    savetherobot

    November 12, 2009 at 7:59 am

  9. Hmm… I decided to give it a whirl because I hope in the future to be able to create a bot that updates a custom news feed on a site I’m developing. I tried using the Google Wave Robot Tutorial (that you linked to) for Python instead of Java and after copying everything exactly it doesn’t work… I was able to create the bot and add it to my contacts, but upon adding it to a wave it did nothing.

    Any tips/ideas as to what might be going on?
    Thanks.

    jeffrey296

    November 14, 2009 at 12:46 am

  10. aren’t this google wave are like reddit ?

    sonya

    November 18, 2009 at 4:25 am


Leave a Reply