ICFP 2002 (TIM-MAH!)

After the 2001 IFCP contest, which we failed to complete due to a curious and uncharacteristic apathy and a plethora of distractions, we vowed to take the next year’s contest more seriously. We dedicated ourselves to beginning as soon as the task was announced, and to not be interrupted or distracted for 72 hours, until our task was complete. We also gained the advantage of a third team member during the 2002 contest, though unfortunately not until half way through the weekend. Though we were dazed and very confused by Monday morning, we were proud of what we had produced, and anxiously awaited the results.

At the time of the 2002 Contest, James and Darin were still renting a house together in St. Peters, MO, so that was the natural place for us to do our work. We had a medium-sized bedroom (~15×25 ft?) that we shared as an office, with our two desktop workstations, and a Linux box serving as a firewall/router. The morning of Friday, August 30, 2002, we awoke early, being too excited to sleep. As soon as the challenge task was posted, we excited made a few printouts, and took off to Borders bookstore to start our design.

We discussed initial game strategies, but as I recall, we initially had trouble coming up with any real intelligent ways for plotting our agent’s strategy. We knew there was a lot of work to be done though, so we focused the first day on building a solid base for our entry. Darin took on building the data model of the world (and all related information, i.e. robot locations, package and base locations), while James took care of the protocol and all I/O handling. We pressed on late into the night, and finished Friday being able to read a world state, build a model from it, and issue elementary commands.

The morning of day 2, Saturday, was spent adding some finishing touches to the framework for our agent, and in finding and implementing an algorithm for plotting paths on the map. We found that Dijkstra’s shortest path algorithm would work well for this type of world, so using some help from online, we implemented it, and by the afternoon were able to have our agent intelligently pick a path between two points and move along it. It was about at this time when our third teammate, Tim, showed up. After spending some time getting Tim up to speed on the task, as well as what we had put in place so far, we finished up Saturday with a several hour discussion and design session, where we developed our mission based strategy, and laid out most of our cost and reward formulas.

To be honest, I don’t remember much of what happened on day 3, Sunday, September 1. I can assume that this was because it was an all out day of coding and testing our agent. I do remember that we named our agent TIM-MAH sometime before day 3, so allow me to share that story here. When our agent would run, we would output the map of the world, with the location of all robots marked as r characters. We quickly realized that we wanted our robot to stand out, so we changed it to be the next letter over on the keyboard, t. However, the small t was still a bit hard to see, so we changed it to a capital T, so it looked like it was yelling out it’s name and position. This, along with the fact that it acted, well, a little bit special, made us see the obvious similarities between our agent and South Park’s Timmy. Of course, it’s not pronounced “Timmy”, it’s pronounced, “TIM-MAH!”

Day 3 ended with all three programmers falling asleep at various locations around our office (most interesting was Tim on the floor). We were all up again within a couple of hours, and with just a few hours left before the 10 AM local time deadline. We were all to silly and exhausted though in those last few hours to make any real improvements to TIM-MAH! We struggled to even get him tar’ed up and submitted (in fact, we had to submit 3 times because of mistakes we kept finding in our tar files that we sent in). If only we could have been more awake, alert, coherent during those last few hours, we maybe could have fixed two of TIM-MAH!’s critical flaws, that by our calculations, prevented us from advancing to the second round of judging.

The first easily fixable problem was that TIM-MAH! did not realize it if a package that he picked up was undeliverable because the destination was blocked off by water or walls. In this situation, our Dijkstra’s algorithm would fail, and TIM-MAH! would just stay standing in the same place forever. The simple solution would have just been to have checked whether a package was deliverable when it was first encountered, and to have just deleted it from the model if no route could be found between it’s current destination and it’s goal. The second easily fixable problem was actually one line of code that was just missed. If TIM-MAH! was pushed, and dropped a package, he would still try to go deliver that dropped package. The solution was to just nullify his current mission whenever he dropped a package. We were already testing for that condition, but we just ended up taking no action when it occurred. These two errors caused us to get scores of 0 on several of the first round maps (we are entry 175 on that page). If these problems didn’t exist, we surely would have moved on.

Did we learn any lessons from these simple mistakes in TIM-MAH!? I don’t know yet. I know that had we been better rested on that final morning that we probably would have caught those mistakes. That makes the think that we need to be sure to have good rest the night before the final push is made. But at the same time, if we had all gone to bed early Sunday night, We wouldn’t have even finished our agent as well as we did. I suppose the biggest lesson to be learned is that we’re just not quite good enough… yet.