Asteroids

In 2008, I participated in a programming contest hosted by c't, and got 17th place.

The task was to write a bot which would play the Asteroids arcade video game. An emulator would send video frames over a network, and the bot had to send back input.

The task was complicated by the fact that the network communication was done via UDP, so the bot had to handle packet loss.

I used the best method for this problem – I decompiled the ROM and reimplemented the game logic. This was a long and tedious process – most of the time was spent debugging desynchronizations (which were caused by differences between the actual game logic and my implementation).

However, due to poor time management, by the time the game logic and synchronization code were flawless there was no time left to work on the actual behavioral logic. If I have had a few more days, I would have surely outperformed the other contestants. (Their source code was published, all of their works were more primitive than mine – so there is no doubt about this.)

The moral of the story is that I lost a lot of time and effort on a failed attempt to win a large monetary prize – due to my laziness/procrastination. I did get a special mention, however – the perfect synchronization and the simple default logic allowed the bot to continuously accelerate and fly around the map, making wild bends around asteroids, and never colliding (in the event that it would get in a dead end, it would teleport, always safely). Of course, all this fancy flying around didn't get it as many points as the winners – the first prize winner used the same basic idea as mine (ROM decompilation and synchronization), but his ship never moved.

Downloads and replays are available at the link above.

My digitalmars.d announcement: D submission for c't programming contest gets special mention

c't magazine scans (parts about me highlighted): Page 1, Page 2 (thanks to evilworm for the scans).

No one commented on this page yet. Why not be the first?