sauerbraten / p1xbraten

my patches on top of the official Cube 2: Sauerbraten client & server
15 stars 3 forks source link
cube2 sauerbraten

p1xbraten

This repository contains the source for my client mod, as well as the patches applied to the vanilla Sauerbraten source to get there.

Installation

The latest release is always at https://github.com/sauerbraten/p1xbraten/releases/latest.

Windows

Download and run p1xbratensetup\<version>.exe from the link above. p1xbraten will be installed alongside your existing Sauerbraten installation.

macOS

  1. Download macos.zip from the link above, open your Downloads folder in Finder and double-click the zip file to extract it.
  2. Navigate into sauerbraten.app
  3. Open a second Finder window
  4. Go to Applications, right click Sauerbraten.app, select "Show Package Contents"
  5. Make a copy of Contents/MacOS/ (in case you want to go back to the vanilla client in the future)
  6. Drag the Contents folder from the zip file into the Finder window, merging it with the existing folder and replacing any existing files.
  7. Open a Terminal and type chmod +x (note the space at the end), then drag the p1xbraten_x86_64_client file from Finder into the Terminal window
  8. When it says chmod +x [...]/Contents/MacOS/p1xbraten_x86_64_client, press Enter to execute
  9. In Finder, right click start_protected_game_x86-64.app, select "Show Package Contents", go into Contents, then into MacOS
  10. In the terminal, type chmod +x again, then drag the start_protected_game file from Finder into the Terminal window
  11. When it says chmod +x [...]/Contents/MacOS/start_protected_game_x86-64.app/Contents/MacOS/start_protected_game, press Enter to execute

If this seems like a lot of work that's because it is. I blame Apple.

Linux

Download and extract linux.zip from the link above and put its contents into your Sauerbraten directory, then chmod +x bin_unix/p1xbraten_x86_64_client bin_unix/start_protected_game. Use p1xbraten.sh/anticheat.sh to launch.

Menu

For easy configuration of the new features, an updated version of the menus.cfg file is automatically installed when you start p1xbraten for the first time. The new file brings UI options for added features and also includes various cleanups of the vanilla GUI.

If you do not want to use the p1xbraten menus, run /usep1xbratenmenus 0.

Patches

a.k.a. Features

upstreamed to SVN

moviehud.patch

scoreboard.patch

hudfragmessages.patch

You can easily configure the hud frag messages using the improved menu (options → hud → adjust hud frag messages).

fragmessages

fullconsole.patch

hudscore.patch

serverbrowser.patch

The p1xbraten menu gives you a simple search field on the serverbrowser using this variable. Use /p1xbratenmenus 0 to use the default serverbrowser.

listteams.patch

The updated menu includes a better master menu thanks to these changes:

master menu

tex_commands.patch

decouple_framedrawing.patch

This patch allows using maxfps without compromising on the frequency of input polling and network event processing. In vanilla Sauerbraten, maxfps limits the whole game's main loop. This patch removes the main loop limiting and instead skips only frame drawing until a new frame is needed, but still processes network events and player input on every main loop iteration.

While vanilla Sauerbraten is truly unlimited after /maxfps 0, p1xbraten's mainloop can additionally be limited using the maxtps variable. Setting maxfps to any value other than 0 also forces a maximum tick frequency of 1000 (but respects lower settings), even if you set maxtps 0, so that p1xbraten can prioritise frame draw timing. Set both maxfps and maxtps to 0 to get vanilla's unlimited behavior back.

Using maxfps and maxtps, you can optimize for different goals:

crosshaircolor.patch

zenmode.patch

gamehud.patch

gamehud with player state

chat_highlight_words.patch

modversion.patch

This lets you see wether a player connected to the same server as you is using p1xbraten, and what version. It relies on p1xbraten clients sending additional packets to the server, which the server then broadcasts to all other clients. This means other players can tell you're using p1xbraten (and what version). No information other than "I use p1xbraten, version X.Y.Z" is sent. No information is sent to me (p1x) or any third party. Opt out if you are firefly!

For an overview of who uses p1xbraten, you can run /showgui p1xbratenusage.

minimizedframes.patch

hasflag.patch

playerspeed.patch

up_down_hover.patch

paused_spec_movement.patch

clientdemo.patch

Client-side demos record the game as you experience it, and work independently of server-side demo recording. They also work locally, without being connected to any server. Your own position, movement and view is recorded at 125 frames per second.

colored_weapon_trails.patch

You can also adjust the trail colors in the options menu.

crosshairreloadfade.patch

better_console.patch

Name completion tries old-style prefix matching first, then will also try substring matching to suggest more names. In addition to vanilla's matching at the end of the line, it also works in the middle of the input, as long as the cursor is placed in front of a space character.

If you want to keep using Tab to complete commands in the chat prompt (without explicitly typing '/' at the beginning), use this bind:

bind "T" [inputcommand "" "" "" "c"] // instead of saycommand

Also, you can put the following into your autoexec.cfg for cleaner command prompts (replace the keys to your liking):

bind "SLASH"     [inputcommand "" [$commandbuf] "/" "cx"]
bind "BACKQUOTE" [inputcommand "" [$commandbuf] "/" "cx"]
bind "CARET"     [inputcommand "" [$commandbuf] "/" "cx"] // BACKQUOTE on German keyboards
bind "BACKSLASH" [inputcommand "" [servcmd $commandbuf] "#"] // works for #commands on zeromod, spaghetti, and remod
bind "HASH"      [inputcommand "" [servcmd $commandbuf] "#"] // only works with German keyboard layout

nextfollowteam.patch

To use it, put the following lines into your autoexec.cfg (and remember you'll have to change them back to nextfollow before using the autoexec.cfg with other clients!):

specbind "MOUSE1" [nextfollowteam]
specbind "MOUSE2" [nextfollowteam -1]

anticheat.patch

Integrates Epic's Online Services SDK and Anti-Cheat framework to provide protected game sessions on p1xbraten anticheat servers.

setfont.patch

fullscreenmonitor.patch

Server Patches

These are the patches that make p1x.pw different from other servers.

authservers.patch

For example, you can put addauthserver "p1x.pw" "p1x.pw" 28787 "m" into your server-init.cfg to allow users registered with my master server to claim auth on your server.

serverlogging.patch

Improves logging when running a dedicated server:

server_ogzs.patch

managed_games.patch

autoauthdomains.patch

proxy_setip.patch

This patch adds support for the SauerDuels proxy which can be used to obfuscate the IP of tournament servers. The setip protocol extension allows the proxy to forward the client's real IP, replacing the proxy's IP.

anticheat.patch

serverbotbalanceearly.patch

This is a more aggressive form of auto-balance than vanilla's serverbotbalance, which only reassigns bots, and never adds or removes bots on its own. It's intended for public play and disables manually adding/removing bots.

bans.patch

All of these commands are admin-only. You can use these from cubescript or as a remote command (e.g. #listbans).

Project Structure

Building your own binary

You don't have to do this if you already followed the installation instructions above and just want to play!

Build dependencies

Building

On Linux or macOS, just run make install (given you installed the usual Sauerbraten dependencies). Building on Windows is not supported.

This will put the resulting binary into the usual place inside this repo. To use it, you have to copy it over to the same place in your actual Sauerbraten installation. On Linux, the start.sh script will launch the new binary from inside this repository, using the Sauerbraten files in $SAUER_DIR and ~/.p1xbraten as user data directory.

Using fresh upstream sources

You can build my client using fresh vanilla sources. Set $SAUER_DIR to the path of your Sauerbraten directory, then use make from-patches and make install:

export SAUER_DIR=~/sauerbraten-code
make from-patches
make install

A fresh source tree will be copied from the Sauerbraten directory, then all my patches are applied on top of that before buildling and installing a new binary.

Debugging

On Linux, I replace -O3 with -g -rdynamic in the Makefile, and exec with exec gdb --args in start.sh to set up debugging. Then:

make clean && make && make install
./start.sh

In gdb, typing run starts p1xbraten.