Skip to content

Compiling Teeworlds Server

by Finn Espen Gundersen on July 4th, 2012

This post was updated in December 2015 to account for clang in FreeBSD and the updated Teeworlds 0.6.3 (which contains an important server bugfix).

Teeworlds is a great game. It is free and runs on any platform, download it now.

You will soon want to run your own server to host your own matches and levels. If you have a FreeBSD server without X, this is not straightforward. The FreeBSD Teeworlds package is game (client) and server bundled in one, and the Teeworlds server sources are meant for Linux. Here is how:

First, make sure you have Python installed. Then, fetch and unzip the sources:

# fetch http://teeworlds.com/files/bam-0.4.0.zip
# unzip bam-0.4.0.zip
# rm bam-0.4.0.zip
# fetch https://downloads.teeworlds.com/teeworlds-0.6.3-src.zip
# unzip teeworlds-0.6.3-src.zip
# rm teeworlds-0.6.3-src.zip

We need to remove the linux-ism before building. Edit bam-0.4.0/make_unix_clang.sh to remove -ldl near the end of the last line.

# cd bam-0.4.0
# ee make_unix_clang.sh

Then build it:

# ./make_unix_clang.sh

It should build fine, now build the server itself:

# cd teeworlds-0.6.3-src
$ ../bam-0.4.0/bam server_release

If you get errors about mising g++, then install gcc48 (pkg install gcc48) and link gcc48 to gcc and g++48 to g++ in /usr/local/bin and retry. Likewise for python2.7 to python if necessary. You can now run the server:

./teeworlds_srv -f teeworlds.cfg

A sample teeworlds.cfg file:

sv_name “Underbuksepiratene”
sv_high_bandwidth 1
sv_register 1
sv_map dm7
sv_rcon_password “mypw”
sv_maprotation dm1 dm2 dm6 dm7 dm8 dm9
sv_rounds_per_map 2
sv_motd “Welcome! Anything goes.”
sv_gametype mod

If you just want to play locally set sv_register 0. If you want to make your server public make sure people can connect to it by UDP on port 8303.

Happy gaming!

 

From → FreeBSD

One Comment
  1. Hi, it doesent work. And i dont know whats missing.

    Problem:

    ee make_unix_clang.sh

    command not found – what is missing ?

    Next:

    pi@raspberrypi4 ~/gameserver/teeworlds/bam-0.4.0 $ ./make_unix_clang.sh
    ./make_unix_clang.sh: 2: ./make_unix_clang.sh: clang: not found
    src/tools/txt2c: 1: src/tools/txt2c:ELF: not found
    src/tools/txt2c: 2: src/tools/txt2c: ▒: not found
    src/tools/txt2c: 1: src/tools/txt2c: : not found
    src/tools/txt2c: 1: src/tools/txt2c: @: not found
    src/tools/txt2c: 3: src/tools/txt2c: 8H: not found
    src/tools/txt2c: 4: src/tools/txt2c: ,: not found
    src/tools/txt2c: 5: src/tools/txt2c: @,: not found
    src/tools/txt2c: 1: src/tools/txt2c: : not found
    src/tools/txt2c: 6: src/tools/txt2c: @10615Q▒tR▒td▒▒/lib64/ld-linux-x86-64.so.2GNUGNUy▒n-▒%▒
    ▒▒▒9▒P▒▒▒: not found
    src/tools/txt2c: 7: src/tools/txt2c: Syntax error: “(” unexpected
    ./make_unix_clang.sh: 4: ./make_unix_clang.sh: clang: not found

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS