Closed adamryczkowski closed 4 years ago
I wouldn't expect it to work quickly, since devs are already facing a lot of problems at windows environment and i guess than making it work with wine is not an easy task, since installer contains precompiled dlls and its patching assembly in subnautica directory. This build not even work at Windows sometimes. ex. for me works only precompiled 1.0.3.1 all earlier releases were not working until i build them on my own.
[BY NICKNAME I NOTICED BOTH OF YOU FROM POLAND. IF YOU AREN'T FROM POLAND / NITROX RULES FORBIDDEN THIS ACTION / SOMEONE NOT FROM POLAND WANT TO KNOW MY METHOD, JUST ASK TO TRANSLATE]
Zawsze możesz użyć emulatora, na przykład VirtualBox. Co prawda potrzebujesz wtedy oryginalnego obrazu Windows i ma to dosyć słabą wydajność, ale zawsze coś... Dodatkowo możesz spróbować metody opisanej w Wiki, tj. budowanie od źródła. Byś musiał ręcznie zbudować binarkę Nitrox (i jakoś ustawić target na pakiet dla Ubuntu/Debian), a następnie ręcznie zdekompilować kod gry. I nie sądzę, że opisany w Wiki dnSpy tu zadziała. Trochę kłopotów jest ale się da. Możesz spróbować jeśli chcesz. I tak, skapnąłem się, że wszyscy na tym wątku są Polakami. Sorry, ale nick Sajgoniarz, albo Adam Ryczkowski, są raczej exclusiveami dla Polski.
@GuzioMG I am from Poland indeed, but my problem is not specific to that country. If we keep this thread in English it will benefit others and perhaps we may get valuable contributions in return.
Wiki explains how to build the server part. My question is about the client. Installing a Nitrox server under a Virtualbox is relatively easy and straightforward, but configuring all workstations to run Windows just to play one game with family is completely another. Just like said in the question, bare Subnautica runs really good under wine.
I am from Poland indeed, but my problem is not specific to that country. If we keep this thread in English it will benefit others and perhaps we may get valuable contributions in return.
OK, translating:
You can always use an emulator, VirtualBox for instance. You'll actually need an official Windows image and performance is low, but it's always possible. Also, you can build from source. You have to compile mod's code for Ubuntu and decompile the code of the game. And probably, dnSpy mentioned in Wiki won't work. There's a bit effort, but you can do it.
By the way, I used polish for 2 reasons: -I was writing on the phone and I don't have Grammarly for that platform. And I can write in English without it, but I always do some small mistakes, mostly skipping "a" / "an" / "the" or small typos like "mistakest" instead of "mistakes". -I decided to come to a solution in polish and then close this issue with English command with our solution, but actually, I should discuss this idea, before just using it.
Wiki explains how to build the server part. My question is about the client.
I know, but Wiki also mentions the client part:
Type git clone --recursive https://github.com/SubnauticaNitrox/Nitrox.git
- Load
Nitrox.sln
inside Visual Studio
Adjust your folder location (see wiki)
- Build an entire solution to generate binaries
- Load up
dnSpy
- Inject before the first line of
GameInput.Awake()
- Add a reference to
NitroxPatcher.
This should be in the same directory asAssembly-CSharp.
If not, follow step 3 more carefully.- Inject startup code:
NitroxPatcher.Main.Execute().
- Start Subnautica
- If you see a multiplayer button Nitrox is correctly loaded.
- Verify Subnautica logs at
Subnautica/Subnautica_Data/output_log.txt
(Search for nitrox, verify no errors) NOTE: There will always be some errors, but nothing substantial in the first part regarding loading of Nitrox.- Run NitroxServer project and... /Now it's really about the server/
Here is the source: https://github.com/SubnauticaNitrox/Nitrox/wiki/Setting-up-a-development-environment-for-Nitrox I know, some things are not going to work exactly the same (like dnSpy) and some are not important (like creating your own fork, because you can just type git clone --recursive https://github.com/SubnauticaNitrox/Nitrox.git), but generally, most things are similar.
Dear GuzioMG, thank you very much for a great explanation! I wonder - how does one "load Nitrox.sln inside Visual Studio"? AFAIK VS does not work under wine (https://appdb.winehq.org/objectManager.php?sClass=version&iId=35535). Should I do that in Windows?
...and yes, I do appreciate the fact that in the big vast internet we've met together in this thread :-)
Should I do that in Windows?
Yes, I think. I just noticed that VS is not available for Linux. I thought it would be easy. Now, it's a bit harder, due to the second OS required. Anyway, if you can use Windows to do it, it's still simple.
On the other hand, building on Windows can cause more problems than answers. First of all, if you set your path to Subnautica on Windows, will it work on Linux? The worst thing is Windows's partition system. It's impossible to just put your Subnautica folder in the same location as on Linux because Windows starts everything with [LETTER]:(path) and Ubuntu (and every other distro)- /(path). Maybe you can ignore it, as, after the build, it's still needed to attach the output to game manually, but it MAY be a problem. Also, I'm not sure how to set a build target to Ubuntu/Debian. It may also be a problem. And finally - inserting mod code into the game. I have no idea, which program can decompile Linux C# apps.
I will look for the .sln format - compatible IDE with Linux support. Maybe building on Windows will not be needed. Now, you can try my way of doing it and tell, is it working.
you can start the launcher under Wine
This issue is tracked here: #988
Should I do that in Windows?
Yes, I think. I just noticed that VS is not available for Linux. I thought it would be easy. Now, it's a bit harder, due to the second OS required. Anyway, if you can use Windows to do it, it's still simple.
On the other hand, building on Windows can cause more problems than answers. First of all, if you set your path to Subnautica on Windows, will it work on Linux? The worst thing is Windows's partition system. It's impossible to just put your Subnautica folder in the same location as on Linux because Windows starts everything with [LETTER]:(path) and Ubuntu (and every other distro)- /(path). Maybe you can ignore it, as, after the build, it's still needed to attach the output to game manually, but it MAY be a problem. Also, I'm not sure how to set a build target to Ubuntu/Debian. It may also be a problem. And finally - inserting mod code into the game. I have no idea, which program can decompile Linux C# apps.
you can use VS Code
On the other hand, building on Windows can cause more problems than answers. First of all, if you set your path to Subnautica on Windows, will it work on Linux? The worst thing is Windows's partition system. It's impossible to just put your Subnautica folder in the same location as on Linux because Windows starts everything with [LETTER]:(path) and Ubuntu (and every other distro)- /(path). Maybe you can ignore it, as, after the build, it's still needed to attach the output to game manually, but it MAY be a problem.
Did you forget you don't need the letter if its on a certain partition?
\this\is\a\windows\path /this/is/a/linux/path
on top of that Nitrox tends to not use hard coded \ or / in the case of directories, specifically because of OS shenanigans
Also in my testing in the past the NitroxServer gave zero ****s about the path separator characters just as long as it was a correct path
I cannot find any information about how to install the mod in Linux.
The game itself runs in current wine 4.2 just fine, without any tricks or hacks. (OK, there is this occasional glitch with the mouse that happens roughly once every 30 minutes. But it is easy to walk around).
I was also able to run the current Nitrox installer
Alpha 1.0.3.1-159-1-0-3-1-1548635843
(downloaded from the Nexus mods). I pointed the installer into the Subnautica's installation directory, in a hope it would modify some files in theSubnautica_Data
subfolder. Unfortunately, the installer failed to modify anything, and the game ran without any hint of the mod loaded.I use Ubuntu 18.04.