Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to install Nitrox in Linux (Ubuntu)? #737

Closed
adamryczkowski opened this issue Feb 24, 2019 · 14 comments
Closed

How to install Nitrox in Linux (Ubuntu)? #737

adamryczkowski opened this issue Feb 24, 2019 · 14 comments

Comments

@adamryczkowski
Copy link

adamryczkowski commented Feb 24, 2019

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 the Subnautica_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.

@Sajgoniarz
Copy link

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.

@GuzioMG
Copy link
Contributor

GuzioMG commented Apr 10, 2019

[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.

@adamryczkowski
Copy link
Author

@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.

@adamryczkowski
Copy link
Author

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.

@GuzioMG
Copy link
Contributor

GuzioMG commented Apr 13, 2019

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.

@GuzioMG
Copy link
Contributor

GuzioMG commented Apr 13, 2019

Wiki explains how to build the server part. My question is about the client.

I know, but Wiki also mentions the client part:

  1. Type git clone --recursive https://github.com/SubnauticaNitrox/Nitrox.git
  1. Load Nitrox.sln inside Visual Studio
  1. Adjust your folder location (see wiki)
  1. Build an entire solution to generate binaries
  2. Load up dnSpy
  3. Inject before the first line of GameInput.Awake()
  4. Add a reference to NitroxPatcher. This should be in the same directory as Assembly-CSharp. If not, follow step 3 more carefully.
  5. Inject startup code: NitroxPatcher.Main.Execute().
  1. Save file.
  2. Save your "workspace"
  1. Start Subnautica
  2. If you see a multiplayer button Nitrox is correctly loaded.
  3. 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.
  4. 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.

@adamryczkowski
Copy link
Author

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?

@adamryczkowski
Copy link
Author

...and yes, I do appreciate the fact that in the big vast internet we've met together in this thread :-)

@GuzioMG
Copy link
Contributor

GuzioMG commented Apr 17, 2019

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.

@GuzioMG
Copy link
Contributor

GuzioMG commented Apr 17, 2019

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.

@mcDandy
Copy link

mcDandy commented May 24, 2019

you can start the launcher under Wine

@Measurity
Copy link
Collaborator

This issue is tracked here: #988

@marcleonio
Copy link

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

@killzoms
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants