Skip to content

Boris-Barboris/dsubs_client

Repository files navigation

DSubs client

This is the DSubs client executable source code. DSubs is a multiplayer sensor-focused submarine simulator.
Forum link: https://www.subsim.com/radioroom/showthread.php?p=2598851

Build-time dependencies

Run-time dependencies

If you are trying to build it on windows, all dll dependencies are pre-build by me and placed in libs-win-x64 folder. This readme will not be covering the process of building the dependencies as it involves a lot of Visual Studio and CMake work.
If you are trying to build them on Linux, I have a couple of example command histories that I had to perform to build SFML-related stuff, in the folder "linux_build_examples". Pre-built shared libraries for Arch-linux are in "dsubs_libs" folder, they may work out-of-the-box on your distro.

Developing on Windows

Developing on Linux

  • Download and install the compiler using script: https://dlang.org/install.html. It behaves like python virtualenv, so you need to activate it before trying to invoke dub/dmd.
mkdir -p ~/dlang && wget https://dlang.org/install.sh -O ~/dlang/install.sh && \
    bash ~/dlang/install.sh install dmd-2.093.1
source ~/dlang/dmd-2.093.1/activate
  • Create "dsubs" folder in the place of your liking.
  • In the dsubs folder clone the following repos:
  • You should now have 3 folders. Enter "dsubs_client" folder in your shell.
  • Execute run.sh script:
    ./run.sh -c prod
  • If it fails to build and run the client, open an issue, so we can fix the documentation.

Source editing and debugging recommendations

Visual Studio Code with code-d and Trailing Spaces plugins are recommended. I do not know how to debug it under Windows without switching to Visual Studio with dlang plugin, which is very sensitive to code structure and compiler versioning.
Code-d often has troubles with auto-discovering dependency folders, so auto-completion is broken. I use explicit include-paths in vscode workspace settings in order to force what I need. Example part of global vscode settings.json:

...
"d.stdlibPath": [
        "/home/boris/dlang/dmd-2.093.1/src/phobos",
        "/home/boris/dlang/dmd-2.093.1/src/druntime/import"
    ],
...

dsubs_ws.code-workspace file that I have created in dsubs folder:

{
	"folders": [
		{
			"path": "."
		}
	],
	"settings": {
		"d.projectImportPaths": [
			"/home/boris/src/dsubs/DerelictSFML2/source/",
			"/home/boris/.dub/packages/derelict-cl-3.2.0/derelict-cl/source",
			"/home/boris/.dub/packages/derelict-util-2.0.6/derelict-util/source",
			"/home/boris/.dub/packages/derelict-al-1.0.3/derelict-al/source",
			"/home/boris/.dub/packages/standardpaths-0.8.1/standardpaths/source",
			"/home/boris/src/dsubs/dsubs_client/source/",
			"/home/boris/src/dsubs/dsubs_common/source/",
			"/home/boris/.dub/packages/gfm-6.2.13/gfm/math"
		],
		"debug.node.autoAttach": "off"
	}
}

These paths are version- and os-specific, you'll have to change them to fit your filesystem structure.

Debugging on linux can be performed using mainstream gdb or gdbgui tools.

About

DSubs multiplayer subsim client

Resources

License

Stars

Watchers

Forks

Packages

No packages published