Game a Week: Week 25

PLAY HERE

Idea

I really liked the aspect of last week’s game where I tried to get the community to play together towards achieving one goal. In addition to that, I’ve also been thinking a lot about creating a game that integrates into twitter. So, I did the logical thing and smashed those two thoughts together.

I thought of a few different ways that I could use twitter in a game – using mutual followers to power you (the player) up, using key words from a player’s tweets to generate a level, utilizing the interactions between you and others as enhancing gameplay abilities, etc. Ultimately however, I settled on a Twitch Plays Pokemon style game. I had a lot of grand plans about a whole text adventure setup, but as most short projects go, it got de-scoped all the way down to a simple maze. With a maze, all I had to worry about was which of the four cardinal directions the ‘maze player’ could move in and which direction was input by the twitter players.

What went right

I’ve been playing around with twitter bots on and off for the last month or so while working on a joke project with a friend, so I was already somewhat familiar with how I wanted to set this up. I used this PHP library as a place to start, and pared it down to only the parts that I needed.

I used a python script that I wrote a few years ago to generate a maze with a guaranteed solution between two points that I chose and saved that data out to a text file which I then read in to the PHP script every time that it’s run. I read in the current location and which moves are legal, and then check all of the mentions associated with the most recent tweet by @mazeBotGame. I filter out all of the mentions that contain a direction (North, South, East, or West) which also matches one of the maze’s current legal moves and then choose one of those at random. The bot retweets the chosen command and updates its location to the new current location within the maze and then tweets a new tweet indicating which moves are now allowed.

All in all, it was pretty simple, and I’m pleased with how it turned out. I skimped out on a few things (e.g. it looks for the direction commands in the order of North, South, East, then West – so it favors multiple inputs in one tweet in that order), but it seems to work pretty solidly.

I’m also extremely happy watching people play with the maze. It’s been going for almost a day now, and people have managed to go from the top left to the bottom left. . . and then all the way back to the starting (in 73 moves).

What went wrong

I’ve been toying around with how often the maze bot checks for input. I originally had it at 30 minutes which after a few times felt WAY too long. I downed it more and more until I got to 5 minute intervals. Now, it feels a bit too fast. I like when people are playing it, but I also do want it to take time. I’m going to continue playing with the time interval over the next day or two until I really find something that feels right. Basically, I want to find the sweet spot of time where it will take a nice long time to solve but people won’t completely forget about it. I wouldn’t say that this has gone ‘wrong’ per se, but at the very least, it’s not ‘right’ yet.

What I learned

I learned a lot about PHP this week. PHP is one of those things that I’ve used a bunch but never entirely delved into. Between this week and last, I’ve definitely used it more than I have in a while. It’s powerful and interesting – but also slightly infuriating (seriously, it’s impossible to see where a PHP script is failing).

I’ve also been trying to put more thought into what I want the player to get out of the game and build the experience out of that as opposed to just working on one solitary mechanic. That’s why I’ve been struggling with the time interval for checking so much. I ultimately want Maze Bot to be used as a community experiment, where the experience of navigating through this maze is a long and involved process. I panicked a bit when I woke up this morning and the maze had only moved a handful of times (and was still stuck in the beginning 4 spots), so I set the time interval much lower – to 5 minutes. However, that takes the amount of time that community could play this down a lot, which completely negates my intention with this game. So, now that people have seen a decent amount of the puzzle (and even mapped some of it out!), I upped the time interval back up to 30 minutes. I think I’ll just leave it now as a mysterious maze that people slowly wind their way through, like originally intended.

So yeah, if you’re interested in participating in helping @mazeBotGame navigate its way through this maze, make sure you follow it in order to be updated when it makes a move!

Also, someone made a bot to play with my maze bot! Awesome!

Leave a Reply