Inspiration

I, personally, love the arcade game Tron. I became very good at the game snake, and eventually that translated into a love for tron as well. So, when we ran into a wall with our first idea, I posited we make a tron game.

What it does

It is the game Tron, but you can choose whether or not to play with two people or against a bot. The bot is a built in AI whose strategy is summed up as "survival with nuance," in that its goal in life is to cleverly dodge the other player. In tron, the best strategy for humans is to encompass as much space as possible, and this bot favors the edges of the map, which in theory lets it capture the most space it can. The nuance of its survival, however, comes from a heuristic in which if it's given a choice between two safe ways to turn, it will turn in the direction that tends to have less presence of the enemy within it.

How we built it

We built it all in the processing IDE using code. It was very much a cut-the-fanciness, pure programming challenge.

Challenges we ran into

In programming the heuristic, one subtask was to split the whole field on which the tron bikes roam into two separate 2D arrays. Now, processing is essentially java with better graphics, so the arrays are particularly finnicky, which led to the team all congregating at around 2 AM around one computer and a pen-and-paper drawing of grids while we excruciatingly plotted out every step of the decomposition, as it had been giving us errors for hours before.

Accomplishments that we're proud of

Obviously, we overcame this challenge, and when we confirmed our code worked it was one of the most cathartic experiences we've ever experienced in any programming challenge; before we solved this problem it had given us a lot of ache.

What we learned

Through the deliberate process of figuring out the exact way to index and iterate through the 2D arrays, we learned a valuable lesson that can really be extended to all of programming: it's better to be calm and deliberate in figuring out a problem than to just throw attempts at it until it's solved. Even though we, for several hours, had attempted many times to achieve this task, the only time we succeeded was when we slowed down and thought about the process we were doing, which I feel is an applicable experience to many other situations one might find themselves in when coding a project.

What's next for TronBots

This is a fun game. I know I'd like to see more of it, and I think we'll all work on more bots to see if we can find a more optimal strategy — a much more interesting problem than can be done in 24 hours. For example, there is one particular strategy (which I won't spoil) that guarantees a win against the current bot, assuming you can pull it off.

Built With

Share this project:
×

Updates