|
||||||
Program Games with Sauerbraten Cube 2 CubeScriptHow to Create and Edit Maps for the Sauerbraten Games EngineThe Sauerbraten Cube 2 games engine allows programmers to modify maps by using its GUI and CubeScript code. And that's all done while a game is running
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:
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: SauerbratenTo 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: SauerbratenOnce it's been installed it can be run by:
The command file is particularly useful to the programmer because it allows them to start the application in different modes. For example, changing: bin\sauerbraten.exe -r %*
to: bin\sauerbraten.exe -tr %*
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 MapExisting maps can be edited from within a game but, to begin with, it may be easier to start with a blank canvas:
A new, blank map will appear (as shown in figure 2). This can be edited in a few ways:
This new map can then be saved (and this should be done as often as possible) by using the savemap command, for example: /savemap mabworld
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: /map mabworld
However, at the moment, the new map will not be available for any games. Making the Map Visible to Game PlayersCube 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: data/menus.cfg
The new map is then added to the most appropriate menu, for example: conceptmaps = "ladder spiralz canyon secondevermap firstevermap mabworld"
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.
The copyright of the article Program Games with Sauerbraten Cube 2 CubeScript in Computer Programming is owned by Mark Alexander Bain. Permission to republish Program Games with Sauerbraten Cube 2 CubeScript in print or online must be granted by the author in writing.
|
||||||
|
|
||||||
|
|
||||||