BallanceMMO is a project which brings online experiences to Ballance.
-
Install Ballance Mod Loader (aka. BML).
- Download the latest version of BML here.
- Extract and put
BML.dll
under$(game_directory)\BuildingBlocks
, where$(game_directory)
is where you installed your game to.
-
Download the latest mod release from the BMMO download site. Alternatively, try out builds from GitHub Actions which also support BallanceModLoaderPlus.
-
Put
BallanceMMO_x.y.z-[stage]b.bmod
and required.dll
dependencies under$(game_directory)\ModLoader\Mods
. (If the directory is not present, you may launch the game and BML will generate that for you) -
Launch the game and enjoy!
-
Download your desired server builds from GitHub Actions, as currently we don't have a release page for it (maybe we'll make one in the future?).
-
Extract the archive and run
start_ballancemmo_loop.bat
(Windows) orstart_ballancemmo_loop.sh
(Linux/macOS), which is our helper script to take care of logging and server crashes. -
Modify the generated
config.yml
according to your needs; you may also run./BallanceMMOServer --help
to see if there are any configurable command line arguments (you can also supply them through our helper script!). -
Type
reload
in the server console and apply your config changes. Now you're ready to share your address and invite others!
- CMake 3.12 or later: Generate makefiles
- A build tool like GNU Make, Ninja: Build server binary
- A compiler with core C++20 feature support
- This project has been successfully compiled under:
- GCC
9.4, 10.3, 11.3, 12.2, and 13.2 (server-side components; GCC 9 support dropped since January 2023) - Apple Clang 13.1 and 16.0 (server-side)
- Visual Studio 2019 and 2022 (client-side, or specifically, BML-related stuff)
- GCC
- This project has been successfully compiled under:
- One of the following crypto solutions:
- OpenSSL 1.1.1 or later
- OpenSSL 1.1.x, plus ed25519-donna and curve25519-donna. (Valve GNS has made some minor changes, so the source is included in this project.)
- libsodium
- Google protobuf 2.6.1+ (included in submodules)
- Steam GameNetworkingSockets (included in submodules)
- Read Evaluate Print Loop ++ (replxx) (included in submodules)
- Dev pack of BallanceModLoader (client-side, release page) and (optionally) BallanceModLoaderPlus
-
Clone this repo RECURSIVELY
git clone https://github.com/Swung0x48/BallanceMMO.git --recursive
-
(Linux/macOS) Install OpenSSL and Protobuf
-
Debian/Ubuntu
apt install libssl-dev apt install libprotobuf-dev protobuf-compiler
-
Arch
pacman -S openssl pacman -S protobuf
-
macOS with brew
brew install openssl@1.1 export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/opt/openssl@1.1/lib/pkgconfig brew install protobuf
(Haven't tried on a Linux distro with yum as package manager. Sorry Fedora/RHEL/CentOS guys...)
-
-
Building!
-
Linux/macOS
-
Ninja
chmod +x build_server.sh ./build_server.sh cd build ninja
-
GNU Make
chmod +x build_server.sh ./build_server.sh -G cd build make
You may also want to supply command line arguments such as
-DCMAKE_BUILD_TYPE=Release
when runningbuild.sh
, to specify the build type.If CMake failed to find openssl for some reason, you may need to specify path to openssl yourself.
For example:
$ ./build_server.sh -DOPENSSL_ROOT_DIR="/usr/local/opt/openssl@1.1/"
-
-
Windows
We're using vcpkg to take care of our dependencies on Windows. It should be automatically called during CMake setup.
> .\build_server.bat
Open and compile the generated Visual Studio Solution file in
build_server
after finishing this, and you should be fine to go.
-
-
Run your server!
(Don't forget to navigate to the build directory first:
cd BallanceMMOServer
)$ ./BallanceMMOServer
For help or customization, use the command line argument
--help
.$ ./BallanceMMOServer --help Usage: ./BallanceMMOServer [OPTION]... Options: -p, --port=PORT Use PORT as the server port instead (default: 26676). -l, --log=PATH Write log to the file at PATH in addition to stdout. -h, --help Display this help and exit. -v, --version Display version information and exit. --dry-run Test the server by starting it and exiting immediately.
Alternatively, use the bash script
start_ballancemmo_loop.sh
(start_ballancemmo_loop.bat
on Windows) which handles file logging automatically and restarts the server after crashes. All command line arguments for the server executable also applies there.$ ./start_ballancemmo_loop.sh
-
(Linux bonus) Building portable AppImages
As you may have already seen, our Linux server builds from GitHub Actions use AppImages. This is because some system dependencies used by our build outputs differ in version with different systems/distros, and we can pack them in an AppImage file to increase portability.
To build the AppImage, you have to first re-run the CMake configuration to tell it that you're trying to build one (append the
-G
switch if you want to continue with GNU Make):$ ./build_server.sh -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SERVER_APPIMAGE=ON
Then navigate to the binary output directory (this is to ensure that we can find our dependencies) and install the binaries somewhere (e.g.
AppDir
):cd build/BallanceMMOServer DESTDIR=AppDir ninja -C .. install
(replace
ninja
withmake
if you want)We use linuxdeploy to build our AppImages (get its releases here), so download and place it in the binary output directory, then run the command to generate our AppImage (if you can't run this, then try using the
--appimage-extract
switch to extract and usesquashfs-root/AppRun
instead):$ ./linuxdeploy.AppImage --appdir ../AppDir --output appimage --desktop-file ../../BallanceMMOServer/appimage/BMMOLaunchSelector.desktop --icon-file ../../BallanceMMOServer/appimage/BallanceMMO.svg
If everything goes smoothly then a file named like
BallanceMMOLaunchSelector-*arch*.AppImage
should appear, which bundles required dependencies and includes other tools like BallanceMMOMockClient (thus the LaunchSelector name). To see its usage:$ ./BallanceMMOLaunchSelector.AppImage --help Usage: ./BallanceMMOLaunchSelector.AppImage [OPTION]... Options: -h, --help Display this help and exit. -l, --launch [Target] Launch the selected target. Additional options will be forwarded to the target. Available targets (default: `Server`): Server MockClient RecordParser Examples: To see the server help: ./BallanceMMOLaunchSelector-x86_64.AppImage --launch Server --help To launch a mock client with a custom name: ./BallanceMMOLaunchSelector-x86_64.AppImage -l MockClient -n Name
On Windows, we can use the vcpkg package manager. The following instructions assume that you will follow the steps and fetch vcpkg as a submodule. If you want to install vcpkg somewhere else, you're on your own.
Warning Beforehand: DO NOT upgrade (cancel when prompted) when Visual Studio asks you to upgrade the solution/project on first launch. It will wipe include directories which has been set in the project file (wtf Microsoft???). Don't worry, following steps will guide you to switch to your already-set-up msvc toolchain.
-
Install/Modify Visual Studio and CMake
- In
Workload
tab, make sure you have installedDesktop Development with C++
. - IMPORTANT! In
Language pack
tab, make sure you have installedEnglish
.
- In
-
Bootstrap vcpkg
cd submodule\vcpkg .\bootstrap-vcpkg.bat
-
Generate the Visual Studio project file with CMake
-
CMake will automatically call vcpkg to take care of our dependecies during the setup.
-
This is the step where vcpkg will fail if you haven't got your English language pack installed. (Again, wtf Microsoft???)
> .\build.bat
-
-
Extract BML Dev pack and Boost Library, and place the following:
- BML:
- include\BML -> BallanceMMOClient\include\BML
- lib\Debug -> BallanceMMOClient\lib\BML\Debug
- lib\Release -> BallanceMMOClient\lib\BML\Release
- Boost:
- boost -> BallanceMMOClient\include\boost
- BML:
-
Open the Visual Studio project file
BallanceMMO.sln
, which could be found in thebuild
directory. -
Build the project!