Sound like a dream? At Cubeia we often need to write bots, either to test a new aspect of Firebase, or to help customers quality test their products. So, naturally we’ve extracted a little framework for quickly writing bot AI and running batches of bots against a Firebase server.
We’ve never really “officially” released the Firebase Bots. Until now, that is. So here’s how to get functional bots, connecting to a Firebase server, sitting down at tables, ready to implement your own game logic, in 5 minutes.
(OK, so if you don’t have Java and Maven installed, it may take more than 5 minutes…)
First create a new Bot project:
mvn archetype:generate -DarchetypeGroupId=com.cubeia.firebase.bots -DarchetypeArtifactId=firebase-bots-archetype -DarchetypeVersion=1.8.0 -DarchetypeRepository=http://m2.cubeia.com/nexus/content/groups/public
When the archetype asks for a “gameId” choose the same ID as the game you want the bots to run against. When it’s finished, you have a new bot project which you can compile, but also, and here comes the deep magic, run against a Firebase server. So try this:
mvn clean package firebase-bots:run
The above package your bots and starts a bot server at HTTP port 8080. So open your browser and check it out!
Yes, the framework handles connections and lobby for you. Yes, they can connect using both binary protocols and Web Sockets or Comet. Yes, they’ll try to seat themselves auto-magically. Yes, it is a pretty neat little tool!
For more information, hit our wiki: Firebase Bots