Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Contact Us
Online Help
Domain Status
Man Pages

Virtual Servers

Topology Map

Server Agreement
Year 2038

USA Flag



Man Pages

Manual Reference Pages  -  XTBOT (6)


xtbot - automatic player for xtris


See Also


xtbot [ -help ] [ -n nick ] [ -quiet ] [ -test ] [ [ port ] ]


-help Prints out a summary of the command-line options xtbot recognizes.
-n Sets the nickname for the bot; the nickname appears at the bottom of the screen on xtris clients.
  Sets quiet mode: xtbot will not output any diagnostics or error messages. xtris always starts xtbot with this option.
-test Runs the bot in test mode: xtbot will not connect to a server or show the game in progress, but will just simulate 16 games as fast as it can and print stats on the number of lines it did and the number of bricks it played.

  Specifies the machine on which an xtris server (xtserv) runs. xtbot will connect to that server, and add itself to the game.

If the server is not specified, xtbot will attempt to connect to a server on localhost ( If no server is running on localhost, xtbot will exit with an error message.

port Specifies the port to connect to, if the server was started on a port other than the default (19503).


xtbot is a robot (i.e an automatic player) for xtris, a synchronous multi-user version of Tetris.

xtbot connects to an xtris server, registers itself as a bot, and simulates a game of Tetris whenever a human player hits ’play’.

The current version of xtbot uses a pretty good decision algorithm, which usually does several thousand lines before losing, when playing on its own. When playing against a bot, though, the main limiting factor is the speed, whic is why xtbot purposefully waits a little before dropping each brick, so that humans can compete speed-wise.

xtbot is started automatically by xtris, with the option ’-quiet’, when a player presses the ’bot’ button.

Running copies of xtbot can be killed either by clicking on their name from an xtris window, or by killing the process.

It is fairly easy to adapt xtbot to make your own bots based on your favorite decision algorithms. For this the easiest way is to change the decision function in decide.c while keeping the rest of the bot’s skeleton (in xtbot.c). See the comments in decide.c, decide.h and xtbot.h for details about the interface between these. Alternatively, the protocol between the client and the server is described in detail in the file PROTOCOL, so you can make completely independent bots.


The default algorithm for the bot depends on 6 coefficients to evaluate each possible position of the piece. You can set the environment variables XTBOT_FRONTIER, XTBOT_HEIGHT, XTBOT_HOLE, XTBOT_DROP, XTBOT_PIT, XTBOT_EHOLE. See the file decide.c to see what they do.

The values for the coefficients that xtbot uses now were obtained with a genetic algorithm using a population of 50 sets of coefficients, calculating 16 generations in about 20 hours on 20-odd Sparc workstations. This improved the average number of lines from 10,000 to about 50,000. The code used for this isn’t nearly clean enough to distribute in a release. If you’re interesed, please e-mail the author privately.


xtris(6), xtserv(6)


None known; please report any bugs to the author.


xtbot was written by Roger Espel Llima <>.

Search for    or go to Top of page |  Section 6 |  Main Index

Roger Espel Llima XTBOT (6) Oct 13, 1996

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.