We crown ourselves

Royal Para Regiment

Linux Server Hosting

More
3 years 1 month ago - 3 years 1 month ago #1 by mökki medium
Linux Server Hosting was created by mökki medium
First of all, I am running the Steam version of the game through Steam Play = proton.
At the time of writing, Proton Experimental refuses to start the game at all. Proton version 5 and everything under that gets horrible FPS for me (although I have managed to circumvent this in the past by using dxwrapper to convert directx8 -> directx 9 and then dxvk to convert that to vulkan, which runs a million times smoother. This is out of the scope of this guide though), so I am using Proton version 6.3-7.
If you have done any kind of modifications to Proton, it can be a good idea to uninstall and reinstall Proton.
As-is, the game should launch fine without any modifications. However, as with Windows, Proton also needs DirectPlay installed for multiplayer to work at all. Singleplayer works fine out of the box.
I installed directplay by using a winetricks wrapper called protontricks
Simply make sure you have launched the game at least once and then run
Code:
protontricks 703320 directplay
For whatever reason, this failed with "permission denied" errors for me. The windows/syswow64 folder was read-only by default for some reason. I changed the permissions in the folder to read+write:
Code:
cd (steam libary location)/steamapps/compatdata/703320/pfx/drive_c/windows/syswow64 chmod -R +rw *
And then re-ran the protontricks command to install directplay. This time it succeeded.
On my first try multiplayer still didn't work after this. Later I reinstalled Proton 6 however and did all of the commands again, after which it started working. Once again I have no clue what was wrong with my proton, but this is why I recommended starting with a clean install.
Once you have the game's multiplayer working, the next thing to tackle is hosting a server. Using the "Create server" function in-game seems to randomly either fail creating the server or succeed at it. Regardless of the outcome, no one will be able to join the server because of the known issue with the H&D2 server - When binding the UDP ports, for whatever reason the first port is bound to IPv6 and the rest are correctly IPv4. Because the first port is wrong, the server doesn't work.
I did not find anything on the internet to singularly prevent WINE/Proton from using IPv6 so I had to disable IPv6 completely on my operating system, just like one would do on Windows.
This part will obviously differ greatly depending on your linux flavor/distribution, but on Ubuntu it is simple enough:
Settings -> Network -> Ethernet settings (Or Wi-Fi if that's what you're using).
Under the IPv6 tab choose "disable" and then press Apply. I have noticed that this does not actually apply the settings and a restart is required before the changes take effect.
An alternative is to launch nm-connection-editor, delete the original network profile and create a new one with IPv6 set to "Disabled". The changes will take immediate effect like this.
After this you can run
Code:
ifconfig
to make sure you are no longer on IPv6. Under "eth0" or whatever your network device is called (can be wlan0, for me it is enp6s0) you should only see an IPv4 address under "inet", and you shouldn't see "inet6" at all.
After this the server runs just fine - if all you need to do is host servers in-game you are done. For launching dedicated servers however you will need to launch the server outside of steam as steam will not let you run "two instances" of the game at once (steam counts the server as an instance of the game)
I did this by creating a new wine prefix strictly for the server:
Code:
env WINEPREFIX=~/Wineprefixes/HD2Server WINEARCH=win32 winecfg
The win32 WINEARCH means you are creating a 32-bit prefix. This is not strictly necessary, but it is common practice to create 32 bit prefixes unless you explicitly need it to be 64bit.
After this you need to install directplay to the new prefix. This time no permission changing is necessary as that was only a proton-related issue:
Code:
env WINEPREFIX=~/Wineprefixes/HD2Server winetricks directplay
After this you can navigate to your H&D2 install folder and run
Code:
env WINEPREFIX=~/Wineprefixes/HD2Server wine ServerLauncher.exe
to start the server launcher. If you already have a config set up, you can also directly run
Code:
env WINEPREFIX=~/Wineprefixes/HD2Server wine HD2DS_SabreSquadron.exe -cmd exec ServerConfigs\\Default.cfg
Replacing "ServerConfigs\\Default.cfg" with the path to your specific server config.
It is important to note that the H&D2 dedicated server binary launches its own custom command line window instead of running under the regular command line. This means that you cannot run the server in a headless server, as the window needs to be created in order for the server to start succesfully.

After following this guide you should be able to both run H&D2 multiplayer through steam and host a dedicated server with your local wine installation.
I am running wine version 6.18.

P.S.: I have also noticed that if you get stuck with a non-working game or server during some of the steps, for whatever reason restarting the computer might fix these issues. Realistically proton/WINE shouldn't be affected in any way by an OS restart but it's worth a try if you get stuck.

P.P.S.: It is worth noting that the last part of this guide - the one about IPv6 and running the server under WINE - should be applicable to any version of the game, be it gog, CD install or anything.
Last edit: 3 years 1 month ago by mökki medium.
The following user(s) said Thank You: snowman, toadlife

Please Log in or Create an account to join the conversation.

  • snowman
  • Offline
  • Your most dear friend.
More
3 years 1 month ago #2 by snowman
Replied by snowman on topic Linux Server Hosting
Awesome! Many thanks!

Have you tried using our Server Manager / RSC yet? On Windows, that's what we use to start and manage everything that has to do with the servers. Asking because we would use that to start the servers if possible.

You open the ports specific to the ones the game needs. For RSC and Server Manager, you would need to open the specific ports.

If I understand correctly, you don't need proton if you can install it from CD. I did it and I'm playing from my Arch installation. The only problem I have with the game is that on some mission restarts or nextmap, I have to restart the game... or sometimes I can't drive vehicles. This happens only to me, of all Arch users around here.

"Straight and narrow is the path."

Please Log in or Create an account to join the conversation.

  • snowman
  • Offline
  • Your most dear friend.
More
3 years 1 month ago #3 by snowman
Replied by snowman on topic Linux Server Hosting
If you want, you can add your horrible FPS fix on our Linux thread here
[img

"Straight and narrow is the path."

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago #4 by mökki medium
Replied by mökki medium on topic Linux Server Hosting
Yeah proton is only related to the Steam version. I have not been able to get the Server Manager working on Linux yet - the client complains of a "Data transfer error" and the server logs "Error: Connection timeout". WINE terminal output doesn't reveal what exactly is going wrong.

I just managed to get the FPS fix installed on my current installation (Improves FPS on Proton 6 as well even though it already runs pretty good), I can go make a post on that thread about it.
The following user(s) said Thank You: snowman, toadlife

Please Log in or Create an account to join the conversation.

  • snowman
  • Offline
  • Your most dear friend.
More
3 years 1 month ago #5 by snowman
Replied by snowman on topic Linux Server Hosting

Perhaps changing the name and port is necessary? I was also changing the ports on my servers while trying to get them to show up. Whatever the cause, it's been very frustrating. All three of my servers are showing up now, so I'm not changing anything!
 

I've changed the names and ports, restarted the remote and only 3/6 servers showed up. Turned off the servers on the new host and started the ones on the old host, got 2/6 servers showing up. Reverted changes and now on Hetzner we have 4/6 servers showing up. It might be better for you since you are from USA, where QTracker is located, but server from Europe have a problem with it.

"Straight and narrow is the path."
The following user(s) said Thank You: toadlife

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago #6 by toadlife
Replied by toadlife on topic Linux Server Hosting
Thanks so much for this! I tried disabling ipv6 when I tried Linux but I must have not disabled it correctly.

For whatever reason, it works on FreeBSD even with ipv6 enabled on the host, but I would have rather been able to use Linux since it supports a wider variety of hardware.
The following user(s) said Thank You: snowman

Please Log in or Create an account to join the conversation.

  • Hellcat in 2 days
  • Winters in 3 days
  • Alexliberty in 4 days
  • Mizha in 8 days
  • British Bulldog in 9 days
Powered by Kunena Forum