MK2 Bot from the 2015-10-01 Scalatron Hackathon in Warsaw
Introduction
This is code for a bot created with Michał during the "Scalatron na Narodowym w JAVEO" Hackatron.
It’s a simple bot that mostly implements simple "bad-avoidance, good-following" with a twist (see Notes). Instead of focusing on the AI we’ve decided to work on the code structure instead, working towards something akin to a nice entity-component-system [1].
Notes
-
This is a very rudimentary SBT project, with no automated deploy tasks. We’ve looked over a couple of various SBT definition templates, but none seem to be really complete (and completely working with all version of Scalatron).
-
We partially based the project on the "Reference bot", but only used the utility classes (
XY
,Direction
,View
etc.), and further modified them for our needs. The logic itself is built from the ground up. -
This is not the same code as the one used in the tournament. In particular, it adds a rather nasty feature [2] that aggressively tries to monopolize all available resources by mass spawning, recursive minibots. Kills the reference bot (and the CPU) a treat. If you want to test the bot in the "tournament version", remove the spawning logic in
normalBehavior()
. -
No, the code is not very clean ;).
-
Believe it or not, the logic is deliberately simple. In a tournament of this type, it looks like the situation is so chaotic that it pays to just keep focusing on the local situation, instead of focusing on elaborate globalized solution that may be actually fare worse than a pure random-walk [3].