Sins of a Solar Empire II

Sins of a Solar Empire II

Not enough ratings
Steam Deck, Fixing Multiplayer and Crashing Issues
By Kilroy
There are 2(3?) issues that I will be adressing in this Guide.
1. Sins 2 crashing during loading or shortly after loading has finished.
2. Being unable to join players on Windows systems (and having bad latency issues once you connect)

Was asked to create a guide compiling all of the solutions to issues I've experienced on the Steam Deck instead of leaving comments on other peoples threads/community discussions that will be lost to time. Those who know Linux will probably find this a bit long winded, but I have tried to make this guide simple enough that anyone and their grandmother should be able to follow along (maybe with with a few quick google searches).

Full Credit to the following people, who came up with these solutions, I am simply making this accesable to those not fluent in linux (Like myself):
https://steamproxy.com/id/LinLo
https://www.reddit.com/user/Ancient-Grand-46/
Links to the appropriate threads are in the guides.

   
Award
Favorite
Favorited
Unfavorite
Crashing Due to Memory Issues
Sins 2 was crashing at the end of the loading screen any time I had more than 2-3 AI in a match, regardless of map size. I narrowed this down to a Memory issue.

The best solution I have found to date is to download CyroUtilities and use the author recomended settings. Please refer to the following video (skip to 2:15 for the installation tutorial):

https://www.youtube.com/watch?v=C9EjXYZUqUs

You will still experience crashes in certain battles, usually when zoomed in when there is a lot of missle spam.

*******************Old Fix**********************
This solution as written will require 16GB of space on your internal drive.
You can change it to 8GB (which will also be playable) by simply changing the `16` in step #4's `count=16` to `count=8`. Though you may want the extra headroom provided by 16GB.

This is not a perfect solution, as you will experience large lag spikes during more intense battles. This fix essentially uses your drive as extra memory. The issue being the speed of your drive is much slower than that of your system memory. But its better than crashing due to a lack of memory.


1.
Go to desktop mode

2.
Application Launcher > Search for "Konsole"

3.

If you have not set up a root password, see steps 6 and 6.1-6.3 of the multiplayer fix guide below.

4.
In the Terminal (Konsole) Enter the following, one line at a time:
'sudo steamos-readonly disable'
**Enter your root password from step #3**
'cd /home'
'sudo swapoff -a'
'sudo dd if=/dev/zero of=swapfile bs=1G count=16'
'sudo mkswap swapfile'
'sudo swapon swapfile'

(Do not copy the ` at the beginging or end of these lines. This indicates text to be copied into the Terminal.)

As you see we need to disable read only filesystem so you'll need to do the procedure for every steam OS updates.

This fix was taken from the following thread, please refer to it if you have issues.
https://www.reddit.com/r/SteamDeck/comments/waiujt/how_to_increase_the_swap_on_the_deck/
Multiplayer With Windows Users and Latency Fix
Disclaimer
I do not fully know what I am doing, I got a 3 hour crash course in Linux from a friend while trying to get this fix up and running (But hey, it worked. Others have gotten it working following this method). I will likely be unable to act as tech support for any further issues not addressed here.

0.
To simplify things, make sure Sins 2 is installed on your internal SSD, not your SD card or other external devices. (Otherwise, you are on your own when it comes to locating the Sins 2 directory)

1.
Follow this Guide and install GE-Proton9-11:
https://www.rockpapershotgun.com/how-to-install-proton-ge-on-the-steam-deck

2.
In desktop mode, search the applications for "Konsole" (This is a Terminal, and will be refered to as such from here on out).

3.
Enter the following into the Terminal:
`alias protontricks='flatpak run com.github.Matoking.protontricks'" >> ~/.bashrc`

(Do not copy the ` at the beginging or end of these lines. This indicates text to be copied into the Terminal.)

4.
Right click on the Terminal icon in the task bar, open a new window, and enter the following:
`flatpak install com.github.Matoking.protontricks`
This step will not work if you continue to use the same window as step #3, you need a new Terminal window. (Not a new Terminal tab, a completely new window).

5.
"With GE-Proton9-11, launch in a terminal `protontricks 1575940 winecfg` then, in staging tab select "Hide wine version from applications" and apply/ok."-LinLo

6.
******************************************************************************
This is where I was told steamdeck OS updates may break this fix, and all subsequent steps may need to be repeated if you update your steamdeck.
******************************************************************************
In your Terminal, enter the following:
`sudo steamos-readonly disable`
You may need to set up a Root Password for this step.
It will not recognize any other passwords if you have not set this one up yet.
It may act like you set up a password, even if you have not done so yet.
See steps 6.1-6.3 for password methods.
You can Ignore them if you have your root password setup already and know what it is.

6.1
The non terminal method:
System Settings > Personalization > Users > User (Default is "Steam Deck User") > Change Password.

6.2
To setup a password in the Terminal, enter the following:
`passwd`
Type your password and hit enter. (The characters will be invisible, so be careful!)
You will be asked to re-enter your password to confirm (The characters will still be invisible).

6.3
If you have set up a password in the past and want to change it, perform the same steps as Step 6.1, but you will be asked to enter your current password as confirmation. I had forgotten mine and had to try a few passwords out before it would let me reset. If you are unable to guess your password, you may have to factory reset your steamdeck (or wait for Stardock to fix things).

7.
Once you have entered your password for Step 6, enter the following, in order:
`sudo pacman-key --init`
`sudo pacman-key --populate archlinux`
`sudo pacman -Syu`
`sudo pacman -Syyu`
`sudo pacman-key --populate holo`
`sudo pacman -S curl`
`sudo pacman -S cabextract`

7.1
If Curl or Cabextract error out or say files are corrupted, you will want to run the following:
`which curl`
`which cabextract`

The file path after each of those commands should look like this:
"/usr/bin/curl"

If it looks like this, you will want to re-run the relevant commands from the start of Step 7.:
"error: cabextract: signature from "GitLab CI Package Builder <[email protected]>" is unknown trust
:: File /var/cache/pacman/pkg/cabextract-1.11-1-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n]"

8.
Download the Script provided by LinLo:
https://pastebin.com/k1P9NKKx
Make sure ".su" is at the end of the file name and not ".su.su".
You can fix it by rightclicking and renaming the file, removing the second ".su"
For the purpose of this guide, this is the only change to the name you should make.

9.
Right click on the Script > Open With > KWrite
This will allow you to edit the file and save the changes made.

10.
Change the "${USER}" in line #5 of the Script to the Username linked to your steamdeck account. Follow Step 6.2 to navigate to your account information. Make sure to use the "Username". Do not use the "Name".

When in doubt, the default Username appears to be "deck".

Save the changes to the Script.

11.
Search the applications for "Dolphin".
This will be your file explorer.
Enter the following into the adress bar:
"/home/deck/.steam/steam/steamapps/"
(You will be unable to navigate here manually, as the ".steam" directory is hidden)
Ensure that you can find the "compatdata" folder, and that there is a subfolder called "1575940".

12.
Replace the "${STEAM_DIR}" in line #7 of the Script with the path to your steamapps folder.
Eaxample:
"/home/deck/.steam/steam/steamapps/".

This is the default directory if you installed Sins 2 on your internal drive.

The end result should look like:
"/home/deck/.steam/steam/steamapps/compatdata/1575940"

Save the file

13.
In the terminal try running the following command:
`dos2unix ./fix_desync_sins2.sh`

If it doesnt work, run this command in the Terminal:
`sudo pacman -S dos2unix`

Then, try running the command again:
`dos2unix ./fix_desync_sins2.sh`

The reason for this step, is that the script will not run and will error out on the Steam Deck otherwise. Other linux systems may not have this issue.

14.
In the Terminal, enter "cd" followed by the directory where you saved the script.
Example:
`cd /home/deck/Downloads/Fix_Sins_2/`

(I placed the script in a folder inside of my "Downloads" named "Fix_Sins_2")

15.
In the Terminal, enter:
'sh ./fix_desync_sins2.sh'
This should run the script.

If it runs correctly, you should now be able to join your friends on windows without latency issues.
If you start crashing when loading into games with your friends, see the Crash Due to Memory section.

This was taken from my comment in the following thread, all credit to LinLo for coming up with the solution and script, I just went into the finer details of how to perform it:
https://steamproxy.com/app/1575940/discussions/5/7026264603287379799/

To reiterate, I do not know Linux very well. I only just started learning in order to fix these issues, so I will likely not be helpful in any troubleshooting beyond what is written here.

5 Comments
hibbidy_jibbidy 6 Sep, 2024 @ 1:01pm 
i am in awe of your skill at this....but even more on attemting to play this with a controller
LinLo 19 Aug, 2024 @ 12:37pm 
Interesting deep explanation of the issue:
https://www.codeweavers.com/blog/rbernon/2022/9/12/ucrtcringedll-reverse-engineering-ucrtbasedll-for-pain-and-non-profit

Extract:
---
Solution

There’s actually only one good solution to this issue: games, or game engines, should implement and embed their own maths approximations.

And now, you know how to build your own, it’s not so hard and there’s even existing open-licensed reference implementations for some extra easy.

Including the implementation within the game will ensure that - assuming the hardware works the same, but most of the time it does - it would not depend on the runtime anymore. Whether you run on Windows or Wine, it will give you the exact same results.
---
LinLo 19 Aug, 2024 @ 12:36pm 
Hi !

After digging about this multiplayer desync issue, I found that replacing only ucrtbase.dll (64bits only) from the vcredist using cabextract is enough to avoid any desync issue. Also, not replacing the other dlls can possibly avoid some slowness, even if I did'nt see any maybe it can have impact on lower-end cpu.

Sources on same desync issue
- CompanyOfHeroes2:
https://github.com/ValveSoftware/Proton/issues/3875#issuecomment-813091381
- dawn of war:
https://github.com/ValveSoftware/Proton/issues/3481#issuecomment-1242828198
Kilroy  [author] 19 Aug, 2024 @ 9:44am 
Was unaware of CryoUtilities before you brought it up.
Yes, it appears the default recomended settings will work, and should even be an improvement over what I have written for the current swap fix. Will Update the guide.

Still have isues with crashes during zoomed-in battles with medium scale missle spam, but the stuttering is gone.
TehJustOne 18 Aug, 2024 @ 9:35pm 
Isn't the swap thing covered when using cryoultilites on the steam deck?