Cube 2: Sauerbraten is a first person shoot-em-up games engine. It can be played in single player mode or in multiplayer mode across a network. However, this is more than just a bit of light relief for a programmer while they're waiting for a program to compile or for a database to update. Cube 2: Sauerbraten allows a user to make changes to the game in one of two ways:
- editing maps using the Cube 2: Sauerbraten GUI (Graphical User Interface)
- using the CubeScript scripting language
And most remarkably, the programmer can do this while a game is actually running. The starting point is, therefore, to download Cube 2: Sauerbraten and then to start creating customized maps.
Obtaining Cube 2: Sauerbraten
To obtain Cube 2: Sauerbraten it's just a matter of downloading it from the Cube 2: Sauerbraten web site. It's free and is open source (it is written in C++).
Running Cube 2: Sauerbraten
Once it's been installed it can be run by:
- using the Sauerbraten icon in the start menu
- running sauerbraten.bat on a Windows machine
- running unix_ sauerbraten on a Linux machine
The command file is particularly useful to the programmer because it allows them to start the application in different modes. For example, changing:
to:
will start Cube 2: Sauerbraten in Windowed mode rather than full screen (as shown in figure 1 at the bottom of this article). That will be very useful when referring back to this article to see what to do next.
Editing the Cube 2: Sauerbraten Map
Existing maps can be edited from within a game but, to begin with, it may be easier to start with a blank canvas:
- press "E" to start the edit mode
- press "`" (next to the number 1) to enable the Cube 2: Sauerbraten CubeScript console
- enter newmap, and it's worth noting that every CubeScript input must be preceded by a "/", for example:/newmap
A new, blank map will appear (as shown in figure 2). This can be edited in a few ways:
- items such as walls an pits can be created by left clicking a block and scrolling the mouse wheel
- items can be added by pressing the Esc key and then selecting "Editing..."
- the programmer can use CubeScript to create objects. For example, a tree can be added by entering:/newent mapmodel tree1
This new map can then be saved (and this should be done as often as possible) by using the savemap command, for example:
This will save the map (in this case it will be saved as mabword.ogz and will appear something like figure 3), and it can reloaded at any time by typing:
However, at the moment, the new map will not be available for any games.
Making the Map Visible to Game Players
Cube 2: Sauerbraten accesses all of its maps though a set of menus, but these menus do not update automatically. That must be done manually. Fortunately this is not difficult to do. The information is stored in a text file in the Cube 2: Sauerbraten directory, and that file is:
The new map is then added to the most appropriate menu, for example:
When Cube 2: Sauerbraten is restarted then the new custom map will be available to any players and it can be used in any of the single or multiplayer game modes(as shown in figure 4). It can then be tested, modified and remodeled as required.