Get Started With Scalatron
Scalatron consists of these main parts:
- A server application that simulates the virtual game world in which players’ bots compete. Besides running the tournament loop, this server also includes a web server to which players can connect to edit, build and test their bots in a browser. The entire source code of the server is available for you to browse and download.
- The bot plug-ins of the players, each of which contains compiled Scala code that determines the behavior of a particular player’s bot. Example bots are included in the installation and their source code is also available online.
- Extensive documentation on how to set up the server; how to set up the players; what the game rules are; how the server talks to bots; and lastly a longish step-by-step tutorial on how to build a bot in Scala.
How To Install
- Download the latest version of the Scalatron game as a .zip file from github
- Unzip the compressed file on your computer
How To Run
Scalatron is a Scala application that is distributed as a compressed Java archive (.jar) file. The file is called
Scalatron.jar and you can find it in the
/bin sub-directory inside the installation directory. It can be started in two ways:
- By double-clicking the application file
- By opening a terminal, changing into the
/bindirectory and running
java -jar Scalatron.jar
Note that in order to run Scalatron, you need to have a sufficiently recent Java Runtime Environment installed. Scalatron requires version 1.6 or later.
What You Should See
Once you have the Scalatron server running, you should see two windows come up:
- The Scalatron tournament window showing a game in action, with a score board and leader board. If you are running a workshop with other players, you could use a projector to display this on a wall.
- A web browser showing a “Welcome To Scalatron” log-in screen; this is the entry page of the browser-based administration tools and of the Scalatron IDE (Integrated Development Environment). The IDE lets players edit, build, test and publish your bots without installing anything else.
If you have problems launching or configuring the Scalatron server or accessing it from your browser, check out the trouble-shooting guide in the
/doc directory of the installation, or right here online.
How To Play
To play, you can now write a bot program in Scala, build it, and publish it into the game. There are two basic approaches to doing this, which are explained in laborious detail in the player setup guide (also as pdf):
- The “serious” path involves setting up a local development environment like IDEA, Eclipse or SBT. This approach is fairly complex and is recommended only for experienced programmers that wish to have full control over their development process. For details on how to do this, please refer to the player setup guide linked above.
- The “casual” path involves using the browser-based Scalatron IDE, which is a snap.
Here are the steps for getting started with the “casual”, browser-based approach:
If you do not have a browser window open already that is connected to the Scalatron server, open a web browser now and point it to the appropriate web address:
- If you are on the same computer, try
- If you are on another computer, try the address the server tells you about on the console, such as
- If you are on the same computer, try
This should bring up the Scalatron log-in screen with the title “Welcome To Scalatron”
Log in as
Administrator(there is no password, initially)
Create a user account for yourself and anyone else who wants to play
Return to the welcome screen again
Log in under the user account which you created for yourself
This will take you into a browser-based code editor, pre-populated with the source code for a simple working bot
Click Run in Sandbox to build your bot and run it in a private sandbox game
Click Publish into Tournament to build your bot and publish it into the tournament
- Read the contents of the
Readme.txtfile in your installation directory (or online)
- All of the documentation is also available in the installation directory, in a sub-directory called
- Once you know your way around, invite some friends for a bot coding tournament and have fun!
- Fork Scalatron on github and help us make it better!