Thank you for investing your time in contributing to our project!
In this guide you will get an overview of the contribution workflow from opening an issue, creating a PR, reviewing, and merging the PR.
To get an overview of the project, read the README. Here are some resources to help you get started with open source contributions:
- Finding ways to contribute to open source on GitHub
- Set up Git
- GitHub flow
- Collaborating with pull requests
- Install
Visual Studio 2022
- Clone the Oni Multiplayer repository
- If you do not have a custom
steam library
location forOxygen Not Included
skip tostep 4
- Copy/paste the file
Directory.Build.props
inside theroot
folder, and rename the copy toDirectory.Build.props.user
- Erase all contents, and fill it in with the following (example for
D
drive)
- Copy/paste the file
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<SteamLibraryPath>D:\SteamLibrary</SteamLibraryPath>
</PropertyGroup>
</Project>
- Open the
OniMod.sln
file inside of theroot
folder - If you do not have the multiplayer mod subscribe skip to step 6. If you do have it installed you will have 2 entries in game, so lets distinguish them: to the right of solution explorer, go to
MultiplayerMod -> mod.yaml
- Add
DEV
to the text value end of theTitle
property
- Add
- Build solution (keys ctrl+shift+B) or
Top bar build -> build solution
- If you get an error about
Unable to find package
inside ofMicrosoft Visual Studio Offline Packages
.- Right click the
solution
in the top right - Click
Manage Nuget
- Click the
gear
at the right top - Add name:
nuget.org
, url:https://api.nuget.org/v3/index.json
- Right click the
- If you get an error about
- Start the game trough steam
- If you did
step 5
, then go to mods and make sure you got theDEV
versionenabled
and thesubscribed
onedisabled
- Edit your code, and repeat
step 6
,step 7
and test ingame
To debug the mod, you will need two copies of the game on separate steam accounts, and two computers. Download the version of Unity that the game uses via:
You can find the current game version by checking the Player.log file in this folder:
%appdata%\..\locallow\klei\Oxygen Not Included
As of writing, the Unity version in use was 2020.3.30f1
.
Next, go to the unity installation folder and navigate to:
Editor\Data\PlaybackEngines\windowsstandalonesupport\Variations\win64_development_mono\
From that folder we need three files:
- WindowsPlayer.exe
- UnityPlayer.dll
- WinPixEventRuntime.dll
Copy these to ONI's installation folder, rename WindowsPlayer.exe
to OxygenNotIncluded.exe
and replace the files. Keep in mind to make a backup of the original files otherwise you would have to verify the game files to retrieve the original ones.
Then, in ONI's installation folder, find OxygenNotIncluded_Data\boot.config
and open it with a text editor. Add the following lines:
wait-for-managed-debugger=1
player-connection-debug=1
Now when you start the game via steam it should show a message box saying that you can attach a debugger. Make sure to have the Visual Studio Tools for Unity installed. In VS you can then go to Debug -> Attach Unity Debugger and should be able to attach VS to the game.
If you spot a problem with the docs, search if an issue already exists. If a related issue doesn't exist, you can open a new issue using a relevant issue form.
Scan through our existing issues to find one that interests you. You
can narrow down the search using labels
as filters.
After you've found an issue that you'd like to tackle - let other know about it. Write down a comment or assign it to yourself.
If you are in doubt feel free to ask questions via comments.
For local development you can use any tool that you prefer. We've tested the project with JetBrains Rider and Visual Studio 2022.
When you're finished with the changes, commit your changes and create a pull request, also known as a PR.
- Fill the "Ready for review" template so that we can review your PR. This template helps reviewers understand your changes as well as the purpose of your pull request.
- Don't forget to link PR to issue if you are solving one.
- Enable the checkbox to allow maintainer edits so the branch can be updated for a merge. Once you submit your PR, a maintainer will review your proposal. We may ask questions or request additional information.
- We may ask for changes to be made before a PR can be merged, either using suggested changes or pull request comments. You can apply suggested changes directly through the UI. You can make any other changes in your fork, then commit them to your branch.
- As you update your PR and apply changes, mark each conversation as resolved.
- If you run into any merge issues, checkout this git tutorial to help you resolve merge conflicts and other issues.
Once your PR is merged, your contributions will be publicly visible on the Mod repository.