CellSplit

CellSplit: Programmable bots in Agar.io-like environment

CellSplit is a 2D multiplayer game where you play as a cell that can grow and attack other cells. This provides a great sandbox for experimenting with coding of simple bots. There are only a few rules:

Coding environment

The game includes a live coding environment for coding your own bots:

The main window contains the source code of the script. It is written in FixScript language. It has familiar C-like syntax and shouldn't be hard to pickup. Whenever you edit the code it is instantly being run. The global variables are preserved, you can also reset it by pressing Ctrl+R to restart it.

On the right is the log panel, you can use it to print the content of your variables and objects by using the log and dump functions. It is recommended to use clear_log function to clear the log for every update. You can manually clear the log by pressing Ctrl+L.

You can use a code completion popup by pressing Ctrl+Space. It allows you to complete keywords and functions as well as already existing names in your script.

To actually run the default bot code uncomment a call to set_target at the bottom. Otherwise you're just controlling the cells with your mouse as in a normal game.

Documentation

Functions:

Classes:

Vector class

Vector

Vector stores either a vector or a position as two coordinates (x & y).

It has support for these operators: +, -, *, /, +=, -=, *= and /= (between Vectors and scalars for multiplication/division). You can also use the short-hand variants of the constructors: Vector() and Vector(x: Float, y: Float).

Fields
Static methods
Methods
Cell class

Cell

Cell represents information about individual cell.

Fields
Static methods
Methods
Pellet struct

Pellet

Pellet represents a single pellet. It is a structure not a class. It can be used only in a packed array and has specific rules to work with. You can avoid working with it by using the get_position_of_most_pellets function.

Fields

Tips

There are some common strategies:

Play with the sandbox

To play you can either directly run it in a browser or download the game for Windows or Linux.

Once in the game, choose Bot Test from the main menu. Saving and loading is currently not implemented, but it's as easy as copying the code using a clipboard. Uncomment a call to set_target at the bottom of the script to control the cells by the code.

The support for running the bots in the browser is currently experimental, it is preferred to use the native application for the full experience.