Instructions for running Sauerbraten
For windows: install, and run the sauerbraten.bat. For linux: gunzip, run chmod
+x sauerbraten_unix and then ./sauerbraten_unix. Needs a decent
& compliant OpenGL implementation. before you do, you may want to look at
the config which is in "autoexec.cfg" and which should be fairly familiar if
you ever played a quake style game. If you want to rebind your keys, see the
"bind" command below. Press ESC to go into the menu with many useful commands,
but will not rewrite the config file for you. Sauerbraten derives its
simplicity from some rather brute force rendering methods, and as such it needs
a beefy machine to get good visual quality. It runs best with "vertical sync"
OFF and at high refresh rates (you may get excessive LOD/FPS variance
otherwise).
Command line options
-d runs a dedicated server
Default is a non-dedicated server with only a single client. Dedicated servers
run in the shell only (no graphics), with increased priority yet use very
little cpu time & memory, so you can run one in the background, or at the
same time with a client if you want to host a game (which is usually better
than using a listen server). Cube servers need to be restarted every 3 weeks,
otherwise atleast one game will not have correct timing. Servers port are fixed
at 28785 (UDP) and 28786 (UDP), currently.
-wX sets desired screen width to X, default is -w640
-hY sets desired screen height to Y, default is -h480
-t runs windowed
-f forces the renderpath to the old fixed function pipeline (no shaders)
-lM loads map M on startup
-uN sets the server upstream bandwidth to N bytes per second. only set this
parameter if you know what you are doing, specifying a wrong value is worse
than not specifying it at all.
-nN sets the server description, for people pinging the server. usually does
not need to be set if you have a descriptive domain name already, but if you
set it, keep it short as it may otherwise be truncated, i.e.
-nBobsInstagibServer
-iIP sets the server ip to IP. this option is only useful for people running on
machines with multiple network interfaces.
-mM sets the master server to use for either server (registering) and client
(updating) to M. M is the base url of the master server and has to end in a /
and without a http:// prefix, the default is
wouter.fov120.com/cube/masterserver/
General console commands and configuration
bind K A
editbind K A
Binds key K to commands A (see console language below for what you can put in
A). To find out what key names and their default bindings are, look at
data/keymap.cfg, then add bind commands to your autoexec.cfg. Editbind works much the same way, except
now the key is only available in edit mode (if no editbind is defined for a certain
key, it will use the normal binding).alias N A
Binds name N to commands A, after which you can use N as a shortcut for A. You
may re-bind N as often as you like, call it recursively etc. You may use N = A as a shortcut for alias.
quit
Quits without asking.
forward / backward / left / right
Move you in said direction (defaults to cursor keys).
attack
Fires the current weapon. default = left mouse
jump
Triggers a jump. default key space & right mouse.
invmouse B
Sets mouse to "flight sim" mode if B is not 0
sensitivity S
Sets mouse sensitivity (default = 10). should be a similar number to quake.
sensitivityscale S
Scales the effect of an increase or decrease in the sensitivity value. The
larger the value, the smaller the difference between sensitivity values.
(default = 1)
fov N
Sets your FOV to 10..150.
fog N
Sets fog distance to N (default currently 160). You can do this for tweaking
the visual effect of the fog, or if you are on a slow machine, setting the fog
to a low value can also be a very effective way to increase fps (if you are
geometry limited). Try out different values on big maps / maps which give you
low fps.
dynlight B R
Determines wether dynamic shadows & lights are rendered (default B=1).
provided just incase they slow your fps down too much. With radius you can
optionally specify the radius of a dynamic light (default 16), smaller to maybe
gain some speed, or bigger to see the effect of dynamic shadows more
dramatically (try shooting it past some pillars that have a dark area on the
other side... or use the "gamespeed" variable).
loddistance N
Sets the distance at which world vertex array blocks are rendered at a higher
LOD (level of detail). The lower this value, the more geometry popup you will
see, but the faster it may render. Every system has a different optimal
value, experiment. This variable only has an effect for large scale maps where
the level designer has turned on LOD using the "lodsize" variable.
watersubdiv N
Determines the subdivision of the water surface in maps, which can greatly
affect fps on slow machines. Must be a power of 2: 4 is the default, 8 is
recommended for people on slow machines, 2 is nice for fast machines, and 1 is
quite OTT. See "waterlevel" (edit reference) on how to add water to your own
levels.
maxparticles N
Sets the maximum number of particles rendered at any one time. If more
particles are generated than this number, the oldest ones are culled, so you
can safely set this number relatively low without loss of information. default
1000.
setfullscreenshader Name
Sets your favourite fullscreen shader. Active permanently once set. Use without name
argument to turn it off. Current example shaders: invert, gbr, sobel, bloom
screenshot
Writes out "screenshotN.bmp", where N is the number of milliseconds since cube
was launched (default key = F12).
musicvol n
soundvol n
Sets the music/sound volume from 0 to 255
soundbufferlen n
(default 512) tweak this if you experience stuttering or lagging sound
gamma n
Sets the hardware gamma value to n percent (default 100). May not work if your
card/driver doesn't support it.
hidestats b
Turns on/off display of fps/rendering stats on the HUD (default = 1).
hidehud b
Turns on/off the entire hud display, which includes rendering stats, ammo, and
echoed text. (default = 0)
maxroll n
Sets the maximum value your display will roll on strafing (0..20, default = 3)
crosshairsize n
Sets the size of your crosshair, 0 being off (default = 3)
crosshairfx b
Turns on or of crosshair effects (default 1). when on, the crosshair will go
grey when the weapon is reloading, orange when health <= 50, or red when
<=25.
exec C
Executes all commands in config file C.
newmenu N
Creates a new menu with name N. All following menuitem commands will apply to
this menu
menuitem N A
menuitem A
Creates a new menuitem with description N and action A. if you only specify 1,
then it will be used for both the description and the action. See
data/menus.cfg for examples. If N starts with the special character "^", then the name will
be evaluated as a command when being displayed, and the the variable "s" used as name. This
allows you to create menu items that depend on changing gamestate.
showmenu N
Displays the menu with name N previously defined, and allows the user to pick
an item with the cursor keys. Upon pressing return, the associated action will
be executed. pressing ESC will cancel the menu.
history N
Executes the Nth command in the command line history. For example, binding
"history 0" to a key allows you to quickly repeat the last command typed in
(useful for placing many identical entities etc.)
keymap K N A
Sets up the keymap for key code K with name N and default action A. You should
never have to use this command manually, use "bind" instead.
Console Language
Cube's console language is similar to console languages of other games (e.g.
Quake), but is a bit more powerful in that it is almost a full programming
language.
What is similar to quake is the basic command structure: commands consist of
the command itself, followed by any number of arguments seperated by
whitespace. you can use "" to quote strings with whitespace in them (such as
the actions in bind/alias), and whereever a command is required you can also
use ; to sequence multiple commands in one.
What is new compared to quake is that you can evaluate aliases and expressions.
You can substitute the value of an alias as an argument by prefixing it with a
"$" sign, i.e.: echo The current value of x is $x
You can even
substitute the values of console variables this way, i.e $fov gives the current
fov. Some aliases are set automatically, for example $arg1 to $argN are set if
you supply arguments when you execute an alias.
An alternative re two alternatives to "" for quoting a string: () and []. They work in
the same way as "", with the difference that they can be nested infinitely, and
that they may contain linefeeds (useful for larger scripts). () is different
from [] in that it evaluates the commands contained in it _before_ it evaluates
the surrounding command, and substitutes the results. () bracketed strings are
called expressions, and [] bracketed strings may be thought of as blocks.
An alternative to $x is @x, which uses an alias as a macro. The difference is that @x
can be subtituted inside [] or () forms before they have ever been evaluated (at parse time),
which makes them useful for composing strings or creating code on the fly. The @x form will be
substituted using the value of x at the time the enclosing [] is evaluated. You can add more @ prefixes
to move up more levels of []s, so @@x will move up two levels of []s and so on.
Example: x = 0; if $cond [x = 1; [x = 2; echo @@x]] will echo 0, since it uses the value of x at two levels up.
The form @(body) is similar to @x, except that body contains commands executed at parse time.
The result value after body executes is substituted in for @(body).
You may use multiple @ prefixes as with the @x form.
Example: @(result "Hello, World!") will substitute itself with Hello, World!
The following commands are available for programming:
+ A B
- A B
* A B
div A B
mod A B
(add, substract, multiply, divide, modulo): these all work like the integer
operators from other languages. Example:
echo x squared is (* $x $x)
= A B
< A B
> A B
strcmp A B
(equals, lessthan, greaterthan, stringcompare): comparison operators that
return 1 for true and 0 for false.
if cond true false
executes the true or false part depending on wether cond is "0" or
something else. Example:
if (< $x 10) [ echo "x is" $x ] [ echo "x is too big" ]
loop I N body
evaluates body N times, and sets the alias I from 0 to N-1 for every
iteration. Example:
loop i 10 [ echo $i ]
while cond body
evaluates body while cond evaluates to true. Note that cond here has to have
[], otherwise it would only be evaluated once. Example (same result as the
"loop" example):
i = 0; while [ (< $i 10) ] [ echo $i; i = (+ $i 1) ]
concat S...
concatenates all the arguments and returns the result
concatword S...
same as concat but without spaces between the elements.
format F V1..Vn
substitutes the V values into the format string F and returns the result. The format strings %1 through %9 are substituted with V1 through V9, respectively, and may be
used multiple times. %% will generate a
single % character. Example:
format "%1 bottles of %2 on the %3, %1 bottles of %2!" 99 beer wall
at S N
grabs the Nth word out of string S and returns the result
listlen L
returns the number of items in the list L
onrelease A
only executes A if the command is executed on the release of a key/button (must
be in an action in a bind or an alias in a bind).
retval V
Normally the result of a [] block is the result of the last command in the block. If you want the result to be a particular variable or value, you can use e.g. "retval $i" etc.
variables that are only really useful when used as value:
$editing
true when in edit mode