没想到这么久了我还能想起来这个东西。
今天在old哥的安排下折腾一下Dyson Sphere Program的联机mod:Nebula
下面是官方wiki
Setting up a development environment
Development Setup
Repo Setup
- Fork the repository to your own Github account.
- Pull git repository locally (pass
--recursive
togit clone
to init and clone submodules)git clone https://github.com/lssb/nebula.git --recursive
这个代码阴影不是圆角看起来好丑
- Initialize git submodule(s) by running the following command:
git submodule update --init --recursive
This command can also be used to fetch and update changes.
Nebula setup
- Get the most up-to-date version of Dyson Sphere Program from Steam.
- Install BepInEx inside the Dyson Sphere Program Steam installation folder.
- Download
BepInEx_x64_5.4.22.0.zip
- Unzip the content to
F:\SteamLibrary\steamapps\common\Dyson Sphere Program
- Download
- Run the game once to activate BepInEx (new subfolders should appears in the BepInEx folder)
- Add a
Nebula
folder inside theBepInEx\Plugins
folder - Load
Nebula.sln
inside Visual Studio # 尬住了 - Add NuGet to Visual Studio package sources.
- In the toolbar open Tools -> Options, then find NuGet Package Manager -> Package Sources
- Create a new source with name NuGet and url https://api.nuget.org/v3/index.json
- If your game installation is not at the default location
C:\Program Files (x86)\Steam\steamapps\common\Dyson Sphere Program
aDevEnv.targets
file should have been generated at the root of your copy of the Nebula repo. You can change the path to your game installation location. - Build entire solution to generate binaries.
- Nebula uses Visual Studio build events to automatically copy the mod binaries to the BepInEx\Plugins\Nebula folder.
Verify Setup
- Make sure that you have built the entire solution without errors
- Start the game using
Steam
- From the game main menu, you should now see a
Multiplayer
button
How to run 2 game instances on the same computer
There are two options for running multiple instances:
Remove Single Instance
Edit Dyson Sphere Program\DSPGAME_Data\boot.config
, removing the single-instance=
line from the file.
If you would like to keep the instances’ settings separate then Sandboxie might be preferred.
In order to run the game from the exe you must create a steam_appid.txt
file in the root of the game directory (next to DSPGame.exe
) with the text 1366540
Sandboxie
- Install Sandboxie Plus
- Launch Sandboxie Plus
- Right Click on
DefaultBox
and chooseRun -> Run Program
- In the popup window browse to select the
Steam.exe
from your Steam installation location. - Make sure to check the
Run As UAC Administrator
and clickOK
- Also start steam normally
- You should now have 2 Steam apps running at once.
- Start
Dyson Sphere Program
on both of them. - You should now have 2 Dyson Sphere Program running at once.
Recommended Tools
I highly recommend you to use the very useful plugin UnityExplorer. Once installed, you only need to press F7 while in-game to toggle it and you will be able to inspect any Unity GameObjects, Components and it has a runtime console to run some code at runtime.