Code Monkey home page Code Monkey logo

opensoldat's Introduction

OpenSoldat

OpenSoldat is a unique 2D (side-view) multiplayer action game. It has been influenced by the best of games such as Liero, Worms, Quake, Counter-Strike, and provides a fast-paced gaming experience with tons of blood and flesh.

This repository contains the source code of the so-called 1.8 version. Compared to the original version, the code has undergone many changes but is not in a finished state. We hope that by open-sourcing Soldat we can empower our community to improve the game at a faster pace.

Dependencies

Building OpenSoldat

OpenSoldat compiles on Windows, Linux and macOS.

Compilation using CMake

This approach automates some build steps. OpenSoldat's assets will be downloaded for you, and you will not have to worry about downloading pre-built libraries. This is the simplest way to build OpenSoldat for Linux.

CMake 3.14+ is required.

Build steps for Linux (Ubuntu)

  1. sudo apt-get install build-essential g++ cmake git fpc libprotobuf-dev protobuf-compiler libssl-dev libsdl2-dev libopenal-dev libphysfs-dev libfreetype6
  2. mkdir build && cd build
  3. cmake ..
  4. make

Build steps for Windows

  1. Install freepascal 3.2.2
  2. Install Visual Studio with C++ compiler/build tools and vcpkg
  3. Open Developer command prompt for Visual Studio
  4. vcpkg.exe --triplet x64-windows install sdl2 physfs openssl protobuf freetype openal-soft
  5. set PATH=%PATH%;C:\fpc\3.2.2\bin\i386-win32
  6. set OPENSSL_ROOT_DIR=C:\vcpkg\installed\x64-windows
  7. set PHYSFSDIR=C:\vcpkg\installed\x64-windows
  8. mkdir build
  9. cd build
  10. cmake -G "NMake Makefiles" -DCROSS_WINDOWS_64=1 -DCMAKE_TOOLCHAIN_FILE="C:\vcpkg\scripts\buildsystems\vcpkg.cmake" -DSDL2_BUILDING_LIBRARY=1 ..
  11. nmake

Build steps for macOS

  1. brew install openssl@3 protobuf fpc cmake sdl2 physfs freetype2
  2. mkdir build && cd build
  3. export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/opt/openssl@3/lib/pkgconfig
  4. cmake -DOPENSSL_ROOT_DIR=$(brew --prefix openssl@3) ..
  5. make

Available flags

The build can be customized by passing flags to cmake command. For example, you can choose whether you want to build the client, the server, or both. You can decide if you want to include OpenSoldat's assets in the build. There are also options for cross-compilation.

Check the CMakeLists.txt files in this repository to see the available options and their default values.

Example: cmake .. -DCMAKE_BUILD_TYPE=Release -DADD_ASSETS=1 -DBUILD_CLIENT=0 to get a release build of the server with OpenSoldat's assets

Compilation using other methods

If you decide to follow the approaches below, you will have to download OpenSoldat's assets and pre-built libraries for the game to work.

  1. Download pre-built libraries. The best way would probably be to download libraries from the latest build of OpenSoldat (from Github Actions, or Releases). You can download latest from here (includes libraries for 3 platforms - pick the ones you need) 2. Copy libraries to client/build and server/build
  2. Get soldat.smod file from base repository. You can either download the file from the latest release (recommended), or generate the .smod file yourself following the provided instructions
  3. Copy soldat.smod file to client/build and server/build
  4. Download play-regular.ttf file from base repository from the latest release
  5. Copy play-regular.ttf file to client/build

Compilation using Lazarus IDE

  1. Install Lazarus IDE
  2. Open server/opensoldatserver.lpi with Lazarus, press CTRL + F9 to compile the server
  3. Open client/opensoldat.lpi with Lazarus, press CTRL + F9 to compile the game client

Running OpenSoldat

You need to start the server first, and then join the game with client.

  1. Run opensoldatserver
  2. Run opensoldat -join 127.0.0.1 23073 (more generically -join ip port)

opensoldat's People

Contributors

brandougherty avatar deathbydenim avatar episage avatar furai avatar helloer avatar prplz avatar rzaba0 avatar shoozza avatar sternenseemann avatar surfersat avatar swamiumami avatar xvays avatar xyproto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

opensoldat's Issues

Esc key does not work in loading/error screen

If I start the Soldat client and I have either the loading screen or the network error screen (ping timeout/could not connect to server), the window says I can press Esc to quit. However, this does not work. I have to kill the process to get out.

System information:

OS: Linux 5.7.8 (Arch Linux)
Pascal: FPC 3.0.4
libGameNetworkingSockets: built myself, commit 8f60b0e (as recommended here: Soldat/prebuilt-libs#1 (comment))
libstb: built myself in Soldat repository
libphysfs: 3.0.2
make: GNU Make 4.3
Soldat: commit 078795a

Crash when no config already exists

OpenSoldat crashes when no configs directory with client.cfg or taunts.cfg already exists. The reason is that in client/Client.pas on lines 621 and 622 (as of a3aae37), you have this:

  PHYSFS_CopyFileFromArchive('configs/client.cfg', UserDirectory + '/configs/client.cfg');
  PHYSFS_CopyFileFromArchive('configs/taunts.cfg', UserDirectory + '/configs/taunts.cfg');

However, these are called before PhysFS_Init in line 664. Thus this results in an access violation. The solution would probably be to move that whole PhysFS_Init block up to before line 621.

That would put that whole block in front of LoadConfig('client.cfg)` though. Since I'm not sure if that would have unintended side effects, I opted to make this an issue instead of a PR.

Remove dependency on Indy10

We have decided to remove Indy10 from our codebase and replace it with other libraries.

  • Game downloads will be now HTTP based. Libcurl will take care of downloading the files in the game client and in the server we will use fphttpserver.
  • RCON needs be rewritten to use http://wiki.lazarus.freepascal.org/fcl-net or http://www.ararat.cz/synapse/doku.php/start
  • Communication with the lobby server also needs to be taken care of, however we must decide whether to use the current protocol or switch to a HTTP based solution.

Client and server don't extract all config files

Current behaviour
Client: taunts.cfg is missing in configs folder
Server: mapslist.txt, remote.txt, bots folder, weapons.ini, weapons_realistic.ini are missing in configs folder

Expected behaviour
Client: client.cfg, taunts.cfg are present in configs folder
Server: mapslist.txt, remote.txt, bots folder, server.cfg, weapons.ini, weapons_realistic.ini, banned.txt, bannedhw.txt are present in configs folder

More thoughts
I don't know all code, but what about mod.ini? Shouldn't it be treated as a config file? It seems only client uses it

Tasks

  • Make decision on #82, because it affects all implementation. Contributors need to know if their pull request will be accepted, or it's waste of time
  • Make fixes in base repository (organize config files, set reasonable defaults). Do you want separate issue in base?
  • Make new assets release in base repository
  • Make fixes in this repository - make sure config files are unpacked on first run, or change logic as presented in #82

How to test?
Make client-only and server-only builds. You will need Soldat assets from base repository, so probably change cmake_modules/SoldatAssets.cmake to download new release (mentioned in 3rd task), or download manually and copy to bin folder. Verify that all config files are present in bin/configs folder

Support GameNetworkingSockets 1.3.0

Tried updating the library today and it seems like the connection between client and server just times out when connecting to a locally started server.

I think this has to do with the changes to locking and threading made in that release, but I am not familiar enough with the soldat codebase to know how to best fix this (error messages say something about likely thread starvation, so seems to check out).

Allow linking against system GameNetworkingSockets

Currently the only way to link against GameNetworkingSockets is by building it as an external project. This requires checking out a git repository while building which isn't desireable in a packaging context. Ideally we have one GameNetworkingSockets packgae and one soldat package.

Would be nice if there'd be at least a cmake flag to switch between ordinary dependency and external project.

Missing option to disable/enable weapons in server

Server can't customize which weapons should be available in game. As of now, all weapons are enabled by default, and the only way to change it requires recompiling the game.

Judging by code, this option was meant to be implemented with cvars, probably with CVAR_SYNC flag:

//TODO: Implement enabled weapons in cvar system
for i := 1 to MAIN_WEAPONS do
WeaponActive[i] := 1;

The UI for this is ready in launcher's weapons-settings branch, but functionality is missing.

How to make and test a Steam build?

When fixing #36 I wanted to make a Steam build of server, but I was not successful. First of all, I encountered compilation problems, that I temporarily fixed in my branch. After fixing this, I had problems when linking client and server binaries. More specifically, it couldn't find -lsteam_api. After scrolling through documentation I downloaded the SteamWorks SDK, but it only offers version 1.53a, which seems incompatible with Soldat. Do I need a Steam account to download other versions? Can anyone make Steam builds, or is it restricted to members of THD, or how does it work? And more importantly, how can we test Steam builds? Does it also require a Steam account?
All of this raises many questions about Steam builds, but I can't find much documentation.

Maps not loaded (Mac OSX)

There is a problem when loading maps on the mac client. I suspect it is either:

  1. The map is not downloaded, in the correct folder
  2. The map is not downloaded at all

Error when map is not found
Violation

Define Roadmap for 1.8

I'd suggest we create a "minimal" roadmap so we know what to do to get Soldat 1.8 ready to ship asap.

My suggestions for must have tasks:

  1. improve building instructions
  2. bugfixing
  3. implement new gui

Did I miss something?

Incorrect instructions about pre-built libraries?

The install instructions say:

Download pre-built libraries and copy libraries from win64_dlls to client/build and server/build

What if I'm on GNU/Linux? Do I also need the pre-built libraries then? And if yes, I'm guessing it won't be win64_dlls. ;-)

It seems the README might be incorrect/misleading here. Can you please clarify this step?

/say admin command doesn't work anymore

It was used by TCP clients to send messages to console, also by in-game admins to inform players about something important or even checking if they are already logged in as admin. Now all players seem to have some kind of /say command which works the same as typing on "t", dunno really what's the point of that.

Error writing PID file (linux docker)

I am trying to build a docker image for soldat server using the latest develop commit. The reason for that is because installing fpc 3.0.4 is a very difficult task on my ubuntu 20.10 box, when the package manager provides only 3.2.0. Manually installing 3.0.4 and I get missing library prompt during the build process.

The Dockerfile currently looks like (WIP):

FROM ubuntu:18.04

WORKDIR /workspace

COPY GameNetworkingSockets-1.2.0.tar.gz ./
COPY soldat/ soldat/

RUN apt-get update \
  && apt-get install -y git cmake ninja-build golang libssl-dev libprotobuf-dev protobuf-compiler fpc libsdl2-2.0-0 libsdl2-dev libopenal-dev libphysfs-dev libphysfs1

RUN tar xf GameNetworkingSockets-1.2.0.tar.gz \
  && cd GameNetworkingSockets-1.2.0 \
  && mkdir build \
  && cd build \
  && cmake -G Ninja .. \
  && ninja \
  && mv bin/libGameNetworkingSockets.so /usr/lib/

RUN cd ../../soldat/server && make
RUN adduser --disabled-password --gecos "" soldat && su soldat

ENTRYPOINT ["sleep", "3600"]

I am still testing the build process so at the moment I exec into the container to perform tasks.
I managed to build the server but when it gave the following error when executed:


             -= Soldat Dedicated Server 1.8.0 - 2.9.0 (build ) =-

----------------------------------------------------------------
         Soldat Dedicated Server initializing...
----------------------------------------------------------------

   Need help running your server?
   Discord: https://discord.gg/soldat

   ---> https://forums.soldat.pl/

   Additional parameters:
   ./soldatserver -net_port PORT -sv_maxplayers MAXPLAYERS -sv_password PASSWORD
   Example: ./soldatserver -net_port 23073 -sv_maxplayers 16 -sv_password "my pass"


 Compiled with FreePascal 3.0.4

Could not load base game archive (soldat.smod).
Error writing PID file
----------------------------------------------------------------
Shutting down server...
An unhandled exception occurred at $000000000041B9F7:
EAccessViolation: Access violation
  $000000000041B9F7
  $0000000000418A71

It looks like the server wants to write a pid file somewhere but cannot do so. A few things:

  • I need to sudo to user because the server refuses to run as root - maybe this limitation can be removed?
  • When run as a normal user maybe it's trying to write a pid file somewhere but failed due to missing privilege - but I don't know where it's attempting to write. Copying the soldatserver_x64 to the user's home where it can write also failed with the same error message.

Any hint on how to resolve the error?

Server segfault with bots

I run soldatserver -bots_random_bravo 1 and immediately get this:

...
[NET] Server is listening on 0.0.0.0:23073
[FileServer] Starting fileserver on 0.0.0.0:23083
Shutting down server...
Shutting down game networking.
[NET DEBUG] Shutting down low level socket/threading support.
[FileServer] Stopping fileserver
An unhandled exception occurred at $0000000000470462:
EStringListError: List index (0) out of bounds
  $0000000000470462
  $00000000004386A8
  $000000000042A9C5
  $000000000040363E

An unhandled exception occurred at $000000000041BF47:
EAccessViolation: Access violation
  $000000000041BF47
  $0000000000418FC1
  $000000000040363E

InterfaceGraphics.pas(2962,67) Error: (3205) Illegal qualifier

Hi,

i am trying to build soldat according to your description.

fpc -l -B -MDelphi -Scgi -O1 -g -gl -l -vewnibq -vh- -dDEBUG -dDEVELOPMENT -Fi../3rdparty/Indy10/Lib/Core -Fi../shared -Fl./libs -Fu./libs -Fu../3rdparty/Pascal-SDL-2-Headers -Fu../3rdparty/Indy10/Lib/System -Fu../3rdparty/Indy10/Lib/Core -Fu../shared -Fu../shared/libs -Fu../shared/libs/GameNetworkingSockets -Fu../shared/libs/PhysFS -Fu../shared/libs/SteamWrapper -Fu../shared/mechanics -Fu../shared/network -Fu../server -Fu./libs/dglOpenGL -Fu./libs/stb -Fu./libs/FreeType -Fu./libs/openal -FE./build/ -o./build/soldat_x64 -k-rpath -k'\$ORIGIN/' -FU./build/linux -Tlinux -Px86_64 soldat.lpr
Compiling Debug Version
Free Pascal Compiler version 3.0.0 [2020/05/03] for x86_64
Copyright (c) 1993-2015 by Florian Klaempfl and others
(1002) Target OS: Linux for x86-64
(3104) Compiling soldat.lpr
(3104) Compiling Client.pas
(3104) Compiling GameStrings.pas
(3104) Compiling /home/user/build/soldat/shared/libs/PhysFS/PhysFS.pas
(3104) Compiling /home/user/build/soldat/shared/TraceLog.pas
(3104) Compiling Client.pas
(3104) Compiling GameStrings.pas
(3104) Compiling /home/user/build/soldat/shared/libs/PhysFS/PhysFS.pas
(3104) Compiling FileClient.pas
(3104) Compiling GameRendering.pas
(3104) Compiling Gfx.pas
(3104) Compiling /home/user/build/soldat/shared/Vector.pas
(3104) Compiling ./libs/dglOpenGL/dglOpenGL.pas
(3104) Compiling /home/user/build/soldat/3rdparty/Pascal-SDL-2-Headers/sdl2.pas
(3104) Compiling BinPack.pas
(3104) Compiling ./libs/stb/stb.pas
(3104) Compiling ./libs/FreeType/freetype.pas
(3104) Compiling Input.pas
(3104) Compiling /home/user/build/soldat/shared/Constants.pas
(3104) Compiling /home/user/build/soldat/shared/Weapons.pas
(3104) Compiling Client.pas
(3104) Compiling FileClient.pas
(3104) Compiling GameRendering.pas
(3104) Compiling Client.pas
(3104) Compiling FileClient.pas
(3104) Compiling Client.pas
(3104) Compiling /home/user/build/soldat/shared/Version.pas
(3104) Compiling /home/user/build/soldat/shared/Util.pas
(3104) Compiling Client.pas
(3104) Compiling /home/user/build/soldat/shared/Cvar.pas
(3104) Compiling /home/user/build/soldat/shared/Command.pas
(3104) Compiling Client.pas
(3104) Compiling /home/user/build/soldat/shared/Cvar.pas
(3104) Compiling Client.pas
(3104) Compiling ClientCommands.pas
(3104) Compiling Client.pas
(3104) Compiling /home/user/build/soldat/shared/Parts.pas
(3104) Compiling /home/user/build/soldat/shared/mechanics/Sprites.pas
(3104) Compiling /home/user/build/soldat/shared/Anims.pas
(3104) Compiling Client.pas
(3104) Compiling /home/user/build/soldat/shared/mechanics/Sprites.pas
(3104) Compiling /home/user/build/soldat/shared/MapFile.pas
(3104) Compiling /home/user/build/soldat/shared/Waypoints.pas
(3104) Compiling /home/user/build/soldat/shared/Calc.pas
(3104) Compiling Client.pas
(3104) Compiling /home/user/build/soldat/shared/mechanics/Sprites.pas
(3104) Compiling /home/user/build/soldat/shared/PolyMap.pas
(3104) Compiling Client.pas
(3104) Compiling /home/user/build/soldat/shared/mechanics/Sprites.pas
(3104) Compiling /home/user/build/soldat/shared/network/Net.pas
(3104) Compiling /home/user/build/soldat/shared/libs/GameNetworkingSockets/GameNetworkingSockets.pas
(3104) Compiling Client.pas
(3104) Compiling /home/user/build/soldat/shared/mechanics/Sprites.pas
(3104) Compiling Sound.pas
(3104) Compiling ./libs/openal/openal.pas
(3104) Compiling Client.pas
(3104) Compiling /home/user/build/soldat/shared/LogFile.pas
(3104) Compiling Client.pas
(3104) Compiling /home/user/build/soldat/shared/network/NetworkClientConnection.pas
(3104) Compiling /home/user/build/soldat/shared/libs/BitStream.pas
(3104) Compiling Client.pas
(3104) Compiling GameMenus.pas
(3104) Compiling Client.pas
(3104) Compiling /home/user/build/soldat/shared/Demo.pas
(3104) Compiling ClientGame.pas
(3104) Compiling Client.pas
(3104) Compiling /home/user/build/soldat/shared/Demo.pas
(3104) Compiling Client.pas
(3104) Compiling /home/user/build/soldat/shared/Console.pas
(3104) Compiling Client.pas
(3104) Compiling /home/user/build/soldat/shared/Game.pas
(3104) Compiling /home/user/build/soldat/shared/mechanics/Sparks.pas
(3104) Compiling Client.pas
(3104) Compiling /home/user/build/soldat/shared/Game.pas
(3104) Compiling /home/user/build/soldat/shared/mechanics/Bullets.pas
(3104) Compiling /home/user/build/soldat/shared/mechanics/Things.pas
(3104) Compiling Client.pas
(3104) Compiling /home/user/build/soldat/shared/Game.pas
(3104) Compiling /home/user/build/soldat/shared/mechanics/Bullets.pas
(3104) Compiling /home/user/build/soldat/shared/network/NetworkClientBullet.pas
(3104) Compiling /home/user/build/soldat/shared/network/NetworkServerBullet.pas
(3104) Compiling Client.pas
(3104) Compiling /home/user/build/soldat/shared/Game.pas
(3104) Compiling Client.pas
(3104) Compiling ControlGame.pas
(3104) Compiling /home/user/build/soldat/shared/network/NetworkClientMessages.pas
(3104) Compiling /home/user/build/soldat/shared/network/NetworkUtils.pas
(3104) Compiling InterfaceGraphics.pas
(3104) Compiling MapGraphics.pas
/home/user/build/soldat/client/InterfaceGraphics.pas(132,20) Error: (3205) Illegal qualifier
/home/user/build/soldat/client/InterfaceGraphics.pas(132,38) Error: (3205) Illegal qualifier
/home/user/build/soldat/client/InterfaceGraphics.pas(2955,53) Error: (3205) Illegal qualifier
/home/user/build/soldat/client/InterfaceGraphics.pas(2956,95) Error: (3205) Illegal qualifier
/home/user/build/soldat/client/InterfaceGraphics.pas(2957,83) Error: (3205) Illegal qualifier
/home/user/build/soldat/client/InterfaceGraphics.pas(2958,73) Error: (3205) Illegal qualifier
/home/user/build/soldat/client/InterfaceGraphics.pas(2958,143) Error: (3205) Illegal qualifier
/home/user/build/soldat/client/InterfaceGraphics.pas(2959,71) Error: (3205) Illegal qualifier
/home/user/build/soldat/client/InterfaceGraphics.pas(2959,140) Error: (3205) Illegal qualifier
/home/user/build/soldat/client/InterfaceGraphics.pas(2960,80) Error: (3205) Illegal qualifier
/home/user/build/soldat/client/InterfaceGraphics.pas(2961,78) Error: (3205) Illegal qualifier
/home/user/build/soldat/client/InterfaceGraphics.pas(2961,132) Error: (3205) Illegal qualifier
/home/user/build/soldat/client/InterfaceGraphics.pas(2962,67) Error: (3205) Illegal qualifier
InterfaceGraphics.pas(3065) Fatal: (10026) There were 13 errors compiling module, stopping
Fatal: (1018) Compilation aborted
Error: /nix/store/hrn6dbmychiskxyjiwbfc66p8pngclb1-fpc-3.0.0/bin/ppcx64 returned an error exitcode
make: *** [Makefile:58: linux_x86_64] Error 1

I am using fcp 3.0.0:

$ fpc -v
Free Pascal Compiler version 3.0.0 [2020/05/03] for x86_64
Copyright (c) 1993-2015 by Florian Klaempfl and others
Fatal: No source file name in command line
Fatal: Compilation aborted

Thanks so much for making Soldat open source, i'd love to replay some parts of my youth!

Soldat client dies when run without arguments

When you start the Soldat client under GNU/Linux without any arguments, the game dies instantly. The only thing that happens is that a window pops up for a split second, then Soldat dies.

There is no message, no error message, warning or anything that could be helpful to guide the user towards a solution.

Soldat version: 078795a

soldatserver: Compatibility with Bionic C library.

Bionic is a lightweight C library implementation for the Linux kernel, developed by Google, for use within the Android operating system.

It'd be nice if the server app could be built against Bionic. The main reason to consider this is due the low hardware usage Bionic makes use of, which would translate in efficient, faster server runtime.

Steam Integration

This issue concerns only the steam integration in the game client/server itself.

  • Steam Authentication - verifying steam users

    • Support every possible server configuration (non-steam servers, steam servers, steam players, non-steam players)
    • Session Ticket should be sent by the client with a game request message
    • Remember to invalidate game session in case of invalid session ticket (ValidateAuthTicketResponse_t) and kick the user with proper reason (i.e vac banned, timed out)
    • Add player's SteamID to TPlayer Object (internal)
    • Add player's SteamID to Msg_NewPlayer
    • SC3: Add SteamID to TActivePlayer
    • SC3: Add OnSteamAuth event
    • RCON: Add REFRESHXv2 with players SteamID
  • Stats and Achievements + Leaderboards

    • Local stats could be easily abused, same goes for game servers not operated/trusted by us so we will need to have a pool of trusted game servers.
    • Basic stats: Number of games/wins/losses, caps, kills, kills per weapon, kills per game mode.
    • Statistics should not be counted when playing with bots or on a modded server.
  • Steam Workshop

    • Workshop type: "Ready-To-Use"
    • Mods/Custom Interfaces - enumerate over workshop items on game startup
    • There are several ways to support maps from the workshop, test them and pick the best solution
    • Support for server mods/server scripts (TBD)
  • Steam Voice (in-game voice chat)

    • Voice-chat needs to be push-to-talk by default
    • Client/Server should have the option to disable it or mute specific players, re-use /mute and /gmute for that purpose.
  • Steam Screenshots

    • The user should have an option whether to use built-in screenshots or steam's feature.
    • When using steam screenshots, provide info about location (map name) and tag users visible in the screenshot.
  • Steam Overlay

    • We should make it easy to check other player profiles, the best way is to call ISteamFriends::ActivateGameOverlayToUser after clicking on the player's nickname in the scoreboard
    • Add a shortcut to open game server's webpage
  • VAC & Game Bans

    • "NOTE: VAC only attempts to detect cheats reported by the developer." VAC will detect only known cheats but we'll use it anyway.
    • Game bans can be issued by us to ban the player globally, we need to establish procedure and rules for it to prevent power abusing.
  • Misc

    • Additions to Scoreboard
      • Steam avatars
      • Icon for friends
      • Team Tag (from steam groups) next to nickname
    • Rich Presence
    • DLC support
    • Steam Cloud
    • Steam Error Reporting

Idle server using CPU resources

Currently, opensoldatserver uses CPU resources even when there are no human players. It's not too bad (<10%), but ideally an idle server should use almost nothing. It all adds up if you run multiple game servers on a single server which is what I do.

This could be fixed by inserting the following at server/Serverloop:40 after the AdminServer.ProcessCommands(); thing:

  if (PlayersNum - BotsNum) <= 0 then
  begin
    Sleep(100);
    Exit;
  end;

I looked through the rest of the AppOnIdle procedure, but I didn't see anything where this would cause issues. I played a few test games and it does work. CPU usage is nearly 0% when there are only bots. Spectating bots playing works as well.

The round time limit is paused too. That is, if there were X seconds left on the map and the last human players quits, then when a human player joins again after a few minutes, the round count down will continue from those X seconds.

The only side effect that I could see is that a player may be waiting for up to 100ms before being allowed to join the server due to the Sleep(100). That's hardly noticeable tough.

Thoughts?

Spaces in -fs_userpath are not allowed

When trying to set -fs_userpath to a path with spaces, only the part before the space is being considered. For example, when running opensoldat like this:

./bin/opensoldat -fs_portable 0 -fs_userpath ~/temp/soldat\ with\ space -join 127.0.0.1 23073

The reason is that at some point in shared/Command.pas there is code like this;

  InputParse := TStringList.Create;
  InputParse.Delimiter := ' ';
  InputParse.DelimitedText := TrimLeft(Input);

So even though the argument is correctly supplied on the command line, the above code will just split it out anyway.

I'll open a PR for this one. I was able to solve this one locally (although it's affected by issue #121).

Validation of /alias command

/alias command is very flexible. You can pass a long chain of commands to it by using double quotes like this:
alias "ns" "cl_player_name ""newstyle""; cl_player_headstyle 0; retry"
You can then use /ns command in game, and the chain of commands will be executed. It has many use cases, as it allows you to call many commands, or set multiple cvars at once with a short command. Note, however, that an alias doesn't work as an alternative name for a command. So, for example if you set /alias e echo, you can't pass arguments to echo when executing /e. /e "my text" will not call /echo "my text", just /echo as set in alias.

While it's a useful and handy command, its usage can lead to harmful consequences, such as stack overflows.

Scenario 1
Nothing stops you from setting /alias x x and then calling /x in game. This will lead to a stack overflow.

Scenario 2
/alias a b
/alias b a
Now call either /a or /b. Once again, that's a stack overflow.

So, how can we validate /alias command?

  • It doesn't make sense to prevent calling /alias with two equal parameters /alias x x, as it fails on Scenario 2
  • It's hard to check if 2nd argument of /alias name command is an actual command or a cvar, because it can contain a chain of commands and cvar settings separated by ;
  • It's also tricky to validate the aliased commands/cvars at runtime, in CommandExecuteAlias. We just pass commands split by ; to ParseInput, which ignores a non-existing command/cvar

It seems hard to sanitize user's input in this case. Do you have any other ideas?

Sync lazarus project file flags with makefiles

Currently the building settings for lazarus and the ones used in the makefiles are different.

Work already started to resolve this. The makefile now outputs into the same folders (build/win32-i386 for example).

But further work is needed for both to use the same flags when building debug / release builds.

Multi texture support

Game renderer supports multi texturing for polygons, but we need to update .PMS map format to make use of it. Ideally, this update to map format should be backwards compatible.

To make it usable, we need to store:

  • Textures array of texture filenames that are being used. Maybe we could reuse Scenery array?
  • TextureIndex new per-polygon field with an index to the Textures array

Currently, we set TextureIndex for all polygons to the default texture of the map here and here.

After updating .pms we will have to update PolyWorks and polywonks map editors to support this change.

demos recorded in Mac client are corrupt

If you record a demo on the native Mac client, it cannot be viewed on any client.
Opening the demo simply crashes the client.

This is a known issue but would like it to be fixed, or at least understand the issue so I could take a stab at it myself.

Edit: I can upload a sample demo tonight.

Inconsistent managing of config files and assets

I'm reviewing how Soldat handles config files. Soldat's behaviour looks inconsistent:

  • Client and server create folder structure on every run
  • Client and server don't overwrite config files if they already exist
  • Client copies client.cfg (and taunts.cfg, but this file was forgotten) to configs folder
  • Server is a mess. It has many config files, but they are all treated differently:
    • Some files (mapslist.txt, remote.txt) are not present in soldat.smod, server doesn't try to create/extract them, but still tries to load configs from there
    • bots folder is present in soldat.smod, but it's not extracted to configs folder, so server can't find them
    • server.cfg works ok, it's extracted from soldat.smod
    • weapons.ini and weapons_realistic.ini are present in soldat.smod, but they are in wrong path (root of soldat.smod instead of configs folder). Server tries to extract them to configs folder
    • banned.txt and bannedhw.txt are not extracted, they are created as empty files if they are missing
  • Client and server don't use PhysFS to read config files, so they won't be read from soldat.smod

Client also needs play-regular.ttf file, which is copied to bin folder by CMake. So, there are currently 2 approaches to distribution of game files (configs/assets):

  • play-regular.ttf and soldat.smod are copied to bin folder (CMake feature)
  • Configs are extracted from soldat.smod on first run

This inconsistency makes me wonder how other files will be included in a Soldat release. I think some other files like README, LICENSE, changelog.txt, Soldat's manual, ...) should be in zipped Soldat release. So, will Soldat unpack them from soldat.smod, or is it better to copy with CMake?

Wouldn't it be better if there was only 1 way to include game files?
I propose:

  • Client and server don't need to create folders or extract/create config files
  • When making a release of base, 3 archive files should be uploaded:
    • soldat.smod
    • client.zip: contains play-regular.ttf and configs folder
    • server.zip: contains bots and configs folders
  • New archive files (client.zip, server.zip) should have all the folder structure
  • CMake changes to download client.zip or server.zip, and extract to bin directory on make
  • New GitHub workflow in base for creating releases

Benefits

  • When someone downloads game, he is welcomed with README, configs, and whole folder structure. Files are not extracted from soldat.smod on first run. This behaviour is more similar to 1.7.1
  • Soldat's behavior becomes more consistent and structured, there is only 1 way to include game files
  • Client and server code becomes shorter, and hopefully is less buggy (don't need to change Soldat code when base changes)
  • Client-only and server-only files become separated. Currently soldat.smod has configs for client and server, but client-only build needs only client files, and server-only build needs only server files

Downsides

  • If user deletes config files, they will not be recreated from soldat.smod
  • Affects Makefile and other build methods

Alternatives
Find another way to keep Soldat's behaviour consistent (config files, play-regular.ttf, README/license/manual). Maybe config files shouldn't be in base repository? Or maybe it's important to keep config files in soldat.smod, so that users can modify Soldat and create their own version of soldat.smod with custom configs?

I leave this open for discussion.

Crash when trying to connect to server

I can't get Soldat to run. When I try to run a local server and start the client to connect to it, first, the loading screen appears, and then both server and client crash at the same time.

I have followed the build instructions to build Soldat myself, and I managed to build server and client, but they don't work.

System information:

  • OS: Linux 5.7.8 (Arch Linux)
  • Pascal: FPC 3.2.0
  • libGameNetworkingSockets: built myself, commit 8f60b0e (as recommended here: opensoldat/prebuilt-libs#1 (comment))
  • libstb: built myself in Soldat repository
  • libphysfs: 3.0.2
  • make: GNU Make 4.3

CRASH LOGS:

Server crash:

$ ./soldatserver_x64
ctf_Ash by chakapoko maker
Using default weapons mod
[NET] Game networking initialized.
[NET] Server is listening on 0.0.0.0:23073
[FileServer] Starting fileserver on 0.0.0.0:23083
[NET DEBUG] [#1950066577 UDP 127.0.0.1:45665] Remote host is using an unsigned cert.  Allowing connection, but it's not secure!
[NET] Received SteamNetConnectionStatusChangedCallback_t (1950066577, ((k_ESteamNetworkingIdentityType_SteamID, 18, 0, ['', '', '', '', '', '', '', '', '', '', '�', '�', '', '', '', '', 'a', '�', '', '', '', '', '', '', '', '', '', '', '', '', '', ''], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 127, 0, 0, 1, 97, 178, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], ['', '', '', '', '', '', '', '', '', '', '�', '�', '', '', '', '', 'a', '�', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''], (((0, 0, 65535, [127, 0, 0, 1]), [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 127, 0, 0, 1]), 45665), [0, 0, 4294901760, 16777343, 45665, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), -1, 65536, (((0, 0, 65535, [127, 0, 0, 1]), [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 127, 0, 0, 1]), 45665), 0, 1, 0, k_ESteamNetworkingConnectionState_Connected, 0, ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '#', '1', '9', '5', '0', '0', '6', '6'], ['5', '7', '7', ' ', 'U', 'D', 'P', ' ', '1', '2', '7', '.', '0', '.', '0', '.', '1', ':', '4', '5', '6', '6', '5', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''], k_ESteamNetTransport_Unknown), k_ESteamNetworkingConnectionState_Connected)
[Net] Destroying peer handle
[NET DEBUG] ../src/steamnetworkingsockets/clientlib/steamnetworkingsockets_connections.cpp(2605): Assertion Failed: Application didn't accept or close incoming connection in a reasonable amount of time.  This is probably a bug.
[NET DEBUG] [#1950066577 UDP 127.0.0.1:45665] problem detected locally (5003): App didn't accept or close incoming connection in time.
[NET] Received SteamNetConnectionStatusChangedCallback_t Shutting down server...
Shutting down game networking.
[NET DEBUG] Shutting down low level socket/threading support.
[FileServer] Stopping fileserver
An unhandled exception occurred at $0000000000497430:
EAccessViolation: Access violation
  $0000000000497430
  $00000000004D4F88  TOSTR,  line 424 of ../shared/Util.pas
  $00000000004D4F88  TOSTR,  line 424 of ../shared/Util.pas
  $00000000004FF015  PROCESSEVENTS,  line 1363 of ../shared/network/Net.pas
  $00000000004FE032  PROCESSEVENTSCALLBACK,  line 887 of ../shared/network/Net.pas
  $00007FB70B0D8B64 line 1077 of ../src/steamnetworkingsockets/clientlib/csteamnetworkingsockets.cpp
  $00000000004FDFD0 line 1173 of fgl.pp

An unhandled exception occurred at $000000000041B9A7:
EAccessViolation: Access violation
An unhandled exception occurred at $000000000041B9A7:
EAccessViolation: Access violation
  $000000000041B9A7
  $0000000000413663
  $0000000000426C6A
  $000000000040373E

An unhandled exception occurred at $000000000041B9A7:
EAccessViolation: 
  $000000000041B9A7
  $0000000000418BFC
  $0000000000413663
  $0000000000426C6A
  $000000000040373E

Client crash:

$ ./soldat_x64 -join 127.0.0.1 23073
[NET] Received SteamNetConnectionStatusChangedCallback_t (3565904154, ((k_ESteamNetworkingIdentityType_Invalid, 0, 0, ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''], (((0, 0, 0, [0, 0, 0, 0]), [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), 0), [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]), -1, 0, (((0, 0, 65535, [127, 0, 0, 1]), [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 127, 0, 0, 1]), 23073), 0, 1, 0, k_ESteamNetworkingConnectionState_Connected, 0, ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '#', '3', '5', '6', '5', '9', '0', '4'], ['1', '5', '4', ' ', 'U', 'D', 'P', ' ', 'i', 'n', 'v', 'a', 'l', 'i', 'd', '@', '1', '2', '7', '.', '0', '.', '0', '.', '1', ':', '2', '3', '0', '7', '3', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''], k_ESteamNetTransport_Unknown), k_ESteamNetworkingConnectionState_Connected)
[NET DEBUG] [#3565904154 UDP [email protected]:23073] problem detected locally (5003): Timed out attempting to connect
An unhandled exception occurred at $00000000004ECF40:
EAccessViolation: Access violation
  $00000000004ECF40
  $00000000004AACB0  TOSTR,  line 424 of ../shared/Util.pas
  $00000000004AACB0  TOSTR,  line 424 of ../shared/Util.pas
  $00000000004D271B  PROCESSEVENTS,  line 1067 of ../shared/network/Net.pas
  $00000000004D1B8B  PROCESSEVENTSCALLBACK,  line 889 of ../shared/network/Net.pas
  $00007FF0B59C9B64 line 1077 of ../src/steamnetworkingsockets/clientlib/csteamnetworkingsockets.cpp
  $00000000004D1B30 line 1173 of fgl.pp

[NET] Received SteamNetConnectionStatusChangedCallback_t [NET DEBUG] Shutting down low level socket/threading support.
An unhandled exception occurred at $000000000041CF27:
EAccessViolation: 
An unhandled exception occurred at $000000000041CF27:
EAccessViolation: 
  $000000000041CF27
  $0000000000414BE3
  $00000000004281EA
  $000000000041A17C
  $000000000045F120
  $000000000041AEC7
  $0000000000404CCA

Netconfig command can't be called from the command line

To reproduce, run ./opensoldatserver -netconfig 24 1000000, it crashes. The relevant code is in shared/Command.pas, in the CommandNetConfig function. It accesses the UDP global, but that has not yet been created when parsing command line arguments. We actually want to set the config value before UDP is created, so the setting applies to the listening socket on the server. We want to somehow set the global config value.

This is useful because it allows us to run both the client and server in the debugger via:

./opensoldatserver -netconfig 24 1000000 -netconfig 25 1000000
./opensoldat -netconfig 24 1000000 -netconfig 25 1000000 -join 127.0.0.1

which sets the connection timeouts very high, so you can run the game and server in the debugger without disconnecting.

Server crashes when trying to run server while another server runs

If you try to run a server but a server already runs on the system, the new server insta-crashes:

ctf_Ash by chakapoko maker
Using default weapons mod
[NET DEBUG] Cannot create listen socket.  Failed to bind socket.  Error code 0x00000062.
[NET] Failed to bind to 0.0.0.0:23073
Shutting down server...
Shutting down game networking.
[NET DEBUG] Shutting down low level socket/threading support.
Shutting down server...
An unhandled exception occurred at $00000000004157FD:
EAccessViolation: Access violation
  $00000000004157FD
  $000000000042A9ED
  $000000000040363E

An unhandled exception occurred at $000000000041BF47:
EAccessViolation: Access violation
  $000000000041BF47
  $0000000000418FC1
  $000000000040363E

System info:

  • OS: Linux 5.7.8 (Arch Linux)
  • Pascal: FPC 3.0.4
  • libGameNetworkingSockets: built myself, commit 8f60b0e (as recommended here: opensoldat/prebuilt-libs#1 (comment))
  • libstb: built myself in Soldat repository
  • libphysfs: 3.0.2
  • make: GNU Make 4.3
  • Soldat: commit 078795a

Server lobby registration fails

Soldatserver fails to register in the lobby server because API endpoint (http://api.soldat.pl/v0/servers/register) returns 404 page not found.

@jrgp can you help us with this?

Unable to set fs_userpath or fs_basepath

Commit 055d2a6 broke the parameters fs_userpath and fs_basepath. There used to be functions called fs_basepathChange and fs_userpathChange that would update BaseDirectory and UserDirectory, but they were replaced by CommandLineOnlyChange which doesn't update those variables.

This causes UserDirectory to be nil when running opensoldat like this:

./bin/opensoldat -fs_portable 0 -fs_userpath ~/temp/soldat/ -join 127.0.0.1 23073

Possible solution would be changing client/Client.pas:607--612 to this:

  begin
    if fs_userpath.Value = '' then
      UserDirectory := UserPathSDL
    else
      UserDirectory := IncludeTrailingPathDelimiter(fs_userpath.Value);
    if fs_basepath.Value = '' then
      BaseDirectory := BasePathSDL
    else
      BaseDirectory := IncludeTrailingPathDelimiter(fs_basepath.Value);
  end;

Though you may want to expand on that to create the directories if they don't exist.

Tag the initial commit

I makes sense to me to tag the initial commit at v1.8.0 so packagers have a canonical version to work with. =]

Soldat only has one map and no main menu

So, I finally managed to build Soldat on GNU/Linux. Hooray!

But now I have the next problem: There is only one map (ctf_Ash) when I try to select a different map and when I click “Exit to menu”, the game quits (no main menu).

System information:

  • OS: Linux 5.7.8 (Arch Linux)
  • Pascal: FPC 3.0.4
  • libGameNetworkingSockets: built myself, commit 8f60b0e (as recommended here: opensoldat/prebuilt-libs#1 (comment))
  • libstb: built myself in Soldat repository
  • libphysfs: 3.0.2
  • make: GNU Make 4.3
  • Soldat: commit 078795a

Specify server's country flag on configuration file.

In-game lobby, There're many servers with wrong country flag even if web lobby correct flag displayed it.
I think It is based on server's IP. but I wish I could specify it in a config file.
like this

Server_Flag=KR

And if this value is null, then the flag is based on server's IP. else, the flag is based on confg file.

Thanks to keep developing Soldat.

Scripting events are not working on 64-bit build

Following script code works flawlessly on a 32-bit soldatserver but on a 64-bit build any assigned game event is not called up. This seems to be related to remobjects/pascalscript#153 and this.

procedure MyOnClockTickHandler(Ticks: Integer); // this won't be called on 64bit
begin
  WriteLn('OnClockTick event called: ' + IntToStr(Ticks));
end;

begin
  WriteLn('This works');
  Game.OnClockTick := @MyOnClockTickHandler;
end.

Undefined reference to some gns functions

Trying to build soldat from sources, I'm getting the following error:

Linking /tmp/soldat/build/bin/soldat
/usr/bin/ld: CMakeFiles/soldat.dir/GameNetworkingSockets.o: in function `GETQUICKCONNECTIONSTATUS':
/tmp/soldat/build/client//../../shared/libs/GameNetworkingSockets/GameNetworkingSockets.pas:1995: undefined reference to `SteamAPI_ISteamNetworkingSockets_GetQuickConnectionStatus'
/usr/bin/ld: CMakeFiles/soldat.dir/GameNetworkingSockets.o: in function `GETFIRSTCONFIGVALUE':
/tmp/soldat/build/client//../../shared/libs/GameNetworkingSockets/GameNetworkingSockets.pas:2124: undefined reference to `SteamAPI_ISteamNetworkingUtils_GetFirstConfigValue'

Regards

Why Pascal?

Cool project! I remember playing a shooter named Soldat long time ago, it was this one: https://store.steampowered.com/app/638490/Soldat/ .

Just wondering, why Pascal? I used it long time ago, it was my first language that I learned, but I thought there are better alternatives today? Maybe it is for "artistic" reasons :D?

Support GameNetworkingSockets 1.4.0

Changelog looked tame, but the following linker error starts to happen:

Linking /build/soldat/build/bin/soldatserver
/nix/store/x2zbyl2l4xayv4d5is0b31plfq8xjjym-binutils-2.35.2/bin/ld: CMakeFiles/soldatserver.dir/GameNetworkingSockets.o: in function `GAMENETWORKINGSOCKETS$_$TSTEAMNETWORKINGSOCKETS_$__$$_GETQUICKCONNECTIONSTATUS$crcED937303':
GameNetworkingSockets.pas:(.text.n_gamenetworkingsockets$_$tsteamnetworkingsockets_$__$$_getquickconnectionstatus$crced937303+0xa): undefined reference to `SteamAPI_ISteamNetworkingSockets_GetQuickConnectionStatus'
An error occurred while linking /build/soldat/build/bin/soldatserver

Client and server can't load mod's archive, if mod's filename contains uppercase letters

This bug occurs on Linux, and affects both client and server.
It occurs when mod's filename contains at least one UPPERCASE letter.

Steps to reproduce:

  1. Download NNM.zip, and paste it to mods directory
  2. Change the file's extension to NNM.smod
  3. Run ./opensoldatserver -fs_mod NNM or ./opensoldat -fs_mod NNM

Current result:
Server shuts down with this message in console: Could not load mod archive (NNM).
Client shows a popup that says Could not load mod archive (NNM).

Expected result:
Client and server load the mod, despite UPPERCASE letters in .smod filename

Additional notes:
If you rename the file from NNM.smod to nnm.smod, then client and server can load the archive, both with -fs_mod NNM and -fs_mod nnm. It's as if the game always changed the value of fs_mod cvar to lowercase letters when loading the mod.

Last mesa update (mesa 20.1.1-1) Broke Soldat

I've to downgrade to mesa-20.0.7-3 to keep using the linux native client. Can't see any log (I tried to use log level 1 / 2) but didn't show anything. It's seems a rendering problem because it's show all textures red.

Provide a better description of the game

We need a better and longer description text of the game for the store page on steam:

Examples: (See "About this game" section)
https://store.steampowered.com/app/474210/BUTCHER/
https://store.steampowered.com/app/219830/King_Arthurs_Gold/
https://store.steampowered.com/app/718120/Jack_B_Nimble/

What steam says about it:
Use this space to describe your Game. Typically it is a good idea to start with a brief overview--if customers read nothing else, it should give them a pretty good idea of what your Game is about. Then you can go into more detail, add a list of key features, and whatever else you feel is relevant to describing your product. Note: You should not include links to other websites from this section.

We can use [B] [I] [U] [List] [H2] [URL] [IMG] bbcode tags.

Right now we only have this as a description:
[h2]Overview[/h2] [b][i]Soldat[/i][/b] is a unique 2D (side-view) multiplayer action game. It has been influenced by the best of games such as Liero, Worms, Quake, and Counter-Strike and provides a fast-paced gaming experience with tons of blood and flesh. Soldiers fight against each other in 2D battle arenas using a deadly arsenal of military weapons, across 7 default game modes.

How to contribute documentation?

As a person who wants to help develop Soldat, I want to know how I can contribute documentation.

Why do I need documentation?
When running Soldat for the first time, I wanted to change configuration, but I could not find much documentation. By default, the client window is too big on my screen and I can't see status bars (health, ammo, jets, ...), so I had to change r_screenwidth and r_screenheight cvars. I think it would be good to have an organized wiki page that could help new developers and Soldat players migrating to 1.8.0. For example an explanation of cvars would be nice, but I believe there are many other topics that can be documented (game's directory tree, how are game files stored, ...).

Where should documentation be?
I see many options:

When making this decision, ask yourself if 1.7.1 content should be mixed with 1.8.0, or maybe it's better to separate them? Also, maybe new documentation could be included in Soldat's releases too?

How can people contribute?
It would be good to have some guidelines and information about contributions. It applies both to code and documentation. For example who reviews contributions, and who merges them? Or who takes responsibility for this project and what is the team structure (if any)?

I suggest following tasks:

  • Decide where to store documentation
  • Create a CONTRIBUTING.md page with guidelines and explanations
  • Create documentation for cvars. I can do this

Building on Arch Linux

My goal is to try out Soldat for the first time.

After cloning the repository, neither build command appears to work:

% cd soldat/server
% lazarus soldatserver.lpi
[FORMS.PP] ExceptionOccurred
  Sender=EAccessViolation
  Exception=Access violation
  Stack trace:
  $00000000005BB923
  $000000000059A779
  $0000000000724F88
  $000000000072491A
  $000000000072052C
  $0000000000628969
  $000000000062886B
  $000000000047F8DA
  $000000000047B653
  $000000000043A62C
[FORMS.PP] ExceptionOccurred
% make
make: *** No rule to make target 'linux_', needed by 'build'.  Stop.

The problem with Lazarus might be because I'm not using X11/Xorg, but Sway/Wayland. (Note that both KDE and GNOME are moving towards using Wayland, so if this is the issue, it's not a narrow use case).

The problem with make might be caused by an unset variable?

Compile for aarch64

I have successfully compiled the server and client on a Raspberry Pi 4 running Arch Linux Arm. It all works surprisingly well. Might be able fully target arm in the future, however as of right now it took me some work to get it to properly compile. I have not extensively tested it and would imagine performance will take a hit once I add more than just me flying around playing 1v0 CTF.

Build Dependencies:

  • Kernel: 5.4.51-1-ARCH aarch64 GNU/Linux

  • I used this unmerged commit. This I believe is because of this issue. Same issue on arm as is in X86.

  • FPC 3.2.0 aarch64 download and install or build it yourself, does not exist as a package on Arch Linux Arm.

  • Completely remove pascalscript folder and replace with the latest repo.

  • mesa-20.0.7-3 is required as per this issue. The latest Mesa broke soldat. Show up as all red screen just like the issue states.

  • Built the latest repo of GNS.

Update the Makefile for both client and server for fpc to target aarch64.

Comment out /pascalscript/Source/uPSR_dll.pas line 106.

Comment out pascalscript/Source/uPSR_dll.pas line 106

There is one other line that needs to be commented out but it is escaping me right now.

I'll add more details later if need be but this should work.

I could push the changes to the Makefile but not really sure if this project wants to target arm in the future. The other changes I made to pascalscripts are what I did to get it to compile and I do not know what effects they will ultimately have on other architectures.

Edit: FWIW I am using Wayland and Sway window manager.

Cheers.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.