Giter Site home page Giter Site logo

nitrox's Introduction

Nitrox Subnautica Multiplayer Mod

Subnautica Nitrox

An open-source, multiplayer modification for the game Subnautica.

License: GPL v3 GitHub release (latest by date) Translation status Discord

FAQ

What is the current status?

The mod is in the very early stages of development; however, a solid foundation has been laid for the community to iterate on. The following milestones have been completed:

  • Client / Server Communication
  • Player movement
  • Picking up / Dropping item syncing
  • Long-range world syncing
  • Base building
  • Furniture building
  • Most furniture interactions (containers / medkit fabricators / chargers / etc)
  • Power management
  • Seamoth & Exosuit Syncing
  • Cyclops syncing
  • Chat system
  • New HUD for remote players
  • Basic player animations
  • Integration with Harmony
  • Friendly Launcher
  • Published on the Nitrox website

How can I play this mod?

Please do keep in mind that this mod is still in progressional development.

We finally have reached a stage, where we feel comfortable enough to give the public easy access to the mod by providing a launcher to use on each reoccurring update.

If you want to follow the development progress exactly on each pull request. Refer to the docs to set up a development environment where pushed updates will be synchronized automatically.

You can download the latest release of the mod on the Nitrox website.

Problems/bugs/issues

Due to the huge influx of new players for Subnautica the Issue tracker turned into a forum instead of its actual purpose. Please join the Nitrox Discord to discuss any and all issues you have with Nitrox. From there we'll pick up on new issues to track.

Keep in mind that your issue may already exist. Please refer to the existing issues on Discord if you want to add new information about existing issues. You can peruse the existing issues here on Github.

Translations

We have a translation platform for those of you who speak another language to work on translating the mod into your native language. You can get started at https://hosted.weblate.org/engage/subnauticanitrox/.

You'll need to sign up to start translating to a new language, or you can suggest translations for an existing language without an account (but someone with an account will have to manually verify your suggestions). This will send an email to the address you provide. Be sure check your spam folder, as Gmail can sometimes put the emails there.

How can I contribute?

Simply submit a pull request. Full documentation & contribution guidelines can be found on the documentation site. Feel free to join us in the Nitrox Discord channel.

How can I donate?

We do not accept donations to the mod. Those wishing to give money can do so here: https://www.doctorswithoutborders.org/

Why the name 'Nitrox'?

Nitrox is an alternative air mixture, used by scuba divers, to achieve longer bottom times. As a mod, it will provide a new dimension of gameplay to extend your enjoyment.

nitrox's People

Contributors

ahk1221 avatar alexanderheuts avatar amar0k avatar coding-hen avatar ctrlaltdavid01 avatar dartasen avatar dertyan avatar enflorence avatar garsia0 avatar ghaarg avatar grandoth avatar jannify avatar killzoms avatar madmaxofyore avatar marijns95 avatar measurity avatar micaww avatar mistaomega avatar mrpurple6411 avatar nesrak1 avatar ninjapedrox avatar quimnuss avatar shirkie01 avatar spacemonkeyy86 avatar sunnybat avatar sunrunner37 avatar tornac1234 avatar urlordjames avatar weblate avatar zanethefox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nitrox's Issues

Not sure what I am missing in getting this setup

Alright,

I've gotten through everything. Except, I am not getting the "Multiplayer" option in Subnautica. I injected the code into GameInput.Awake as was suggested, and I am able to debug at that location and see the code execute.

I am not seeing any mention of Nitrox in the log file, but I don't know if that's a good thing or not. I half expect to see it to be mentioned in the loading trace.

I've poked and prodded but have yet to find another entry point to try. I wanted to go ahead and ask for some wisdom from the tribe in hopes of speeding this along.

Thanks,
MadMax

Large spawn rate

While testing the mod I realized that the spawn rate is much bigger than in single player. This became so high that in the active lava zone you are literally unable to move. Am I the only one experiencing this? Otherwise, it's an issue to fix

Subnautica Nitrox error

I have an original subnautica

[Nitrox] Log level set to InGameMessages, ConsoleInfo, ConsoleDebug
[Nitrox] I: Patching Subnautica...
NullReferenceException: Object reference not set to an instance of an object
  at NitroxPatcher.Patches.ArmsController_Update_Patch..cctor () [0x00000] in <filename unknown>:0 
Rethrow as TypeInitializationException: An exception was thrown by the type initializer for NitroxPatcher.Patches.ArmsController_Update_Patch
  at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (object,object[],System.Exception&)
  at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
  at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
  at System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
  at System.Reflection.ConstructorInfo.Invoke (System.Object[] parameters) [0x00000] in <filename unknown>:0 
  at System.Activator.CreateInstance (System.Type type, Boolean nonPublic) [0x00000] in <filename unknown>:0 
  at System.Activator.CreateInstance (System.Type type) [0x00000] in <filename unknown>:0 
  at System.Linq.Enumerable+<CreateSelectIterator>c__Iterator10`2[System.Type,System.Object].MoveNext () [0x00000] in <filename unknown>:0 
  at System.Linq.Enumerable+<CreateCastIterator>c__Iterator0`1[NitroxPatcher.Patches.NitroxPatch].MoveNext () [0x00000] in <filename unknown>:0 
  at System.Linq.Enumerable+<CreateGroupByIterator>c__Iterator5`2[NitroxPatcher.Patches.NitroxPatch,System.String].MoveNext () [0x00000] in <filename unknown>:0 
  at System.Linq.Enumerable.First[IGrouping`2] (IEnumerable`1 source, System.Func`2 predicate, Fallback fallback) [0x00000] in <filename unknown>:0 
  at System.Linq.Enumerable.First[IGrouping`2] (IEnumerable`1 source, System.Func`2 predicate) [0x00000] in <filename unknown>:0 
  at NitroxPatcher.Main.Execute () [0x00000] in <filename unknown>:0 
  at GameInput.Awake () [0x00000] in <filename unknown>:0 
UnityEngine.Object:INTERNAL_CALL_Internal_InstantiateSingle(Object, Vector3&, Quaternion&)
UnityEngine.Object:Internal_InstantiateSingle(Object, Vector3, Quaternion)
UnityEngine.Object:Instantiate(Object, Vector3, Quaternion)
UnityEngine.Object:Instantiate(GameObject, Vector3, Quaternion)
SystemsSpawner:Awake()

Extended setting up env manual

Hi!

Can you expand wiki page about setting up project on local machine?

I am C++ developer and not quickly understand howto inject NitroxPatcher to Subnautica Assebly-CSharp.cs

When i try to inject NitroxPatcher Main.Execute() to GameInput.Awake (bottom of original code) by 'dnSpy -> change method' i get compilation errors:
'The type or namespace name ... could not be found ...'

Nitrox project successfully compiled and patcher and cliend DLL's auto copied to Subnautica folder.

PS: Sorry for 'bugged question', my cat hit 'Enter' when i open question editor =)

[Nitrox Server] State Persistence

  • Entity Saving
  • Base Saving
  • Vehicle Saving
  • World Inventory Saving
  • Player Inventory Saving
  • Player Equipment Saving
  • Base Metadata Saving
  • Power Saving

[Audio] Play audio effects

Currently behavior and usually animations are synced for actions, but sound is left out. Since sound is positional, this gives a much more immersive experience than if the other players are virtually silent.

TODO:

  • Go over all the synced actions, and implement sounds on the receiver side if they play a sound on the sending side.
  • Light toggles.
  • Vehicle enters/exists.
  • Base building and interaction.
  • Swimming/walking.
  • Tool usage.

Exception while processing event with param Story_AuroraWarning

immagine

I've never learned C# so I can't fix this myself. Every time the server processes an event of type PDA and with parameter Story_AuroraWarning(In the image the number 2, but it happened with number 1 too) it returns an exception. The exception translates to "ECall methods must be packed in a system module".
The server doesn't crash however and it keeps handling data between clients after resuming it.
Does it happens to others?

TypeLoadException

NitroxPatcher ( all libs ) Compiled with dotnet 4.0 and worked, but see output_log.txt.
Assembly-CSharp.dll modified by GameInput.Awake() method and write at the end NitroxPatcher.Main.Execute()

How can I fix this, TypeLoadException?
output_log.txt

--- output_log.txt ---
UnloadTime: 1.285892 ms
Platform assembly: F:\Steam\steamapps\common\Subnautica\Subnautica_Data\Managed\NitroxPatcher.dll (this message is harmless)
Platform assembly: F:\Steam\steamapps\common\Subnautica\Subnautica_Data\Managed\0Harmony.dll (this message is harmless)
Platform assembly: F:\Steam\steamapps\common\Subnautica\Subnautica_Data\Managed\NitroxModel.dll (this message is harmless)
TypeLoadException: A type load exception has occurred.
at GameInput.Awake () [0x00000] in :0
UnityEngine.Object:INTERNAL_CALL_Internal_InstantiateSingle(Object, Vector3&, Quaternion&)
UnityEngine.Object:Internal_InstantiateSingle(Object, Vector3, Quaternion)
UnityEngine.Object:Instantiate(Object, Vector3, Quaternion)
UnityEngine.Object:Instantiate(GameObject, Vector3, Quaternion)
SystemsSpawner:Awake()

Server error

I have errors in console and i can't connect to server.

[Nitrox] Log level set to ConsoleInfo, ConsoleDebug
[Nitrox] E: System.FormatException: Invalid input string format.
   at System.Number.ParseSingle(String value, NumberStyles options, NumberFormatInfo numfmt)
   at System.Single.Parse(String s)
   at NitroxServer.Serialization.WorldEntityDataParser.GetWorldEntitiesByClassId() in C:\Users\Skyte\Desktop\Nitrox\NitroxServer\Serialization\WorldEntityDataParser.cs:line 55
   at NitroxServer.GameLogic.EntitySpawner..ctor() in C:\Users\Skyte\Desktop\Nitrox\NitroxServer\GameLogic\Spawning\EntitySpawner.cs:line 24
   at NitroxServer.Communication.Packets.PacketHandler..ctor(PlayerManager playerManager, TimeKeeper timeKeeper, SimulationOwnership simulationOwnership) in C:\Users\Skyte\Desktop\Nitrox\NitroxServer\Communication\Packets\PacketHandler.cs:line 26
   at NitroxServer.Server..ctor() in C:\Users\Skyte\Desktop\Nitrox\NitroxServer\Server.cs:line 17
   at NitroxServer.Program.Main(String[] args) in C:\Users\Skyte\Desktop\Nitrox\NitroxServer\Program.cs:line 14

NitroxPatcher.dll

Where to get

NitroxPatcher.dll

i can't find in my Subnautica installation folder

Unpatching Harmony patches

Add functionality to remove Harmony patches from the game when the player leaves a session. There is a fork+PR of Harmony doing exactly this.

We should probably make a fork under SubnauticaNitrox, where our modified version of Harmony lives. It's a good idea to move the reloader into there as well (it uses a very similar codebase), and unify reloading/injecting of methods.

TODO:

  • Clone Harmony under the SubnauticaNitrox organization.
  • Add project to Nitrox repo & sln (with submodules?).
  • Merge in unpatching code from other Harmony fork.
  • Refactor our init code to be easily injected and removed.
    - Only the multiplayer button (and for devs the mplayer dev command) need to be loaded in.
    - Does this mean we should unload patches on typing disconnect, or on return to the menu?
    - Idea: Use namespace similar to how server patches are distinguished from client patches? (and migrate client stuff to NitroxPatcher.Patches.Client).
  • Migrate reloader to Harmony.
  • Unify reloading and patching (both tasks are almost identical, though Harmony is a bit of a ... to modify/work with).

Further reloader ideas:

  • 'field' reloader (add an attribute to a field, and it'll get initialized to it's default value on reload).
  • Fix type usage: When a type is in a reloaded assembly, that one is referenced instead (by reloaded code). When doing operations on these types, the wrong types are referenced and everything breaks.
    • Operations that use types to search (GetComponent<SomeTypeInReloadedAssembly>() suddenly returns null).
    • Static field references.
    • Method finding with parameter-types (such as in the reloader itself, this was fixed in MarijnS95@9c5bcb4).

Discovered blueprints sync

I tried the mod and realised that discovered blueprints are not synced between players. Is this an expected behaviour or an issue? Do you have plans to add this feature in future? Because it's really annoying while playing co-op to be unable to build the same things your friends can.
Thank you.

How to

Hello

I would like to play with a friend in multiplayer
but when I decided to install the mod that I did not understand how to install it. Can advise?

Sorry for my English
Apologies for its audacity

hey need help how to inject?

Inject NitroxPatcher into Assembly-CSharp:

Load up dnspy
Find a suitable method that gets executed before the actual game starts (GameInput.Awake() for instance)
Add a reference to NitroxPatcher. This should be in the same directory as Assembly-CSharp. If not, follow step 3 more carefully.
Inject startup code: NitroxPatcher.Main.Execute().

how to do it?

Clean up logging and exceptions

@SunnyBat worked on a logging framework, but most of the code is still using Console.WriteLine.

Logging TODO:

  • Make sure the logging framework has enough utility functions, like Console.WriteLine.
  • Use tags or classnames (through StackFrame) to indicate the origin of the message.
  • If applicable, print the name of the current player, or make it an option. (to distinguish clients when running multiple instances on a single machine, all dumping to the same log file).
  • Convert existing code to use the logging framework.
  • Disable certain logging functions with [Conditional("DEBUG")].
  • Enforce new code to use this framework.

In some places (such as Optional and Validate), we throw system exceptions (and our own exceptions.) This should be generalized as these are helpers and the exception is usually dependent on the context (for instance something is an ArgumentException for Validate, but that's not really descriptive when in the context that called this).

Exceptions TODO:

  • Come up with some descriptive exceptions to replace our current ones.
  • Replace existing exceptions.

Also:

  • Should Optional have an .AssertPresent, or should this be in Validate?

Both:

Because attaching a debugger to the Unity game doesn't work that well, see if more information about the code path, such as line numbers (and variables) can be printed to the console (StackFrame can do this based on debugging symbols).

error compiling

[Failure] Could not find file '(directory)\ReloaderSettings.cs'.
that message appears before compiling, when compiling this error occurs:

Severity	Code	Description	Project	File	Line	Suppression State
Error	CS0311	The type 'NitroxModel.Packets.Packet' cannot be used as type parameter 'T' in the generic type or method 'PriorityQueue<T>'. There is no implicit reference conversion from 'NitroxModel.Packets.Packet' to 'IPriorityQueueItem'.	NitroxClient	(directory)\Nitrox\NitroxClient\Communication\DeferringPacketReceiver.cs	16	Active

Compilation error "Access denied".

I was just first-time compiling and lunching (by using Visual Studio's "Run" button) the NitroxServer source code. I didn't use dnSpy or something like this, but I my Visual Studio returned this error:
image
(here should be scerrnshot)
Can somebody help me?
Polish translations (useful to read screenshot properly):
Rozpocznij-Run
Błąd podczas próby uruchomienia projektu-error while lunching a project
Nie można uruchomić projektu "(here is the filepath)"-Cannot run project "(here is the filepath)"
Plik-file
Edycja-edit
Widok-view
Odmowa dostępu-access denied
Dane wyjściowe-output
Kompilacja-compile
Zakończono powodzeniem-finished succesful
Zakończono niepowodzeniem-finished with error
zaktualizowano-updated
pominięto-skipped
Eksplarator rozwiązń -solution explorer

Other info:
-I'm on admin's profile
-VisualStudio 2017
-I'm from Poland, so I'm sorry, if i done any language mistakes
-I found a way to repair it on Google: re-open VS, but nothing happend. Alwas the same error.

compile error CS1061 and CS1503

Hello, i have build the project and i have this errors.

Error CS1503 Argument 1: cannot convert from 'void' to 'Harmony.PatchProcessor' NitroxPatcher E:\Donwload\Nitrox-master\Nitrox-master\NitroxPatcher\Patches\NitroxPatch.cs Line 50

Error CS1061 'PatchProcessor' does not contain a definition for 'Restore' and no extension method 'Restore' accepting a first argument of type 'PatchProcessor' could be found (are you missing a using directive or an assembly reference?) NitroxPatcher E:\Donwload\Nitrox-master\Nitrox-master\NitroxPatcher\Patches\NitroxPatch.cs Line 58

and

Error CS1503 Argument 1: cannot convert from 'NitroxModel.DataStructures.Util.Optional' to 'string' NitroxServer E:\Donwload\Nitrox-master\Nitrox-master\NitroxServer\Serialization\BatchCellsParser.cs Line 83

thanks

Error when starting server due to different localization numbers format

[Nitrox] E: System.FormatException: Входная строка имела неверный формат. в System.Number.ParseSingle(String value, NumberStyles options, NumberFormatInfo numfmt) в System.Single.Parse(String s) в NitroxServer.Serialization.WorldEntityDataParser.GetWorldEntitiesByClassId() в O:\Downloads\Games\subnautica\Nitrox\NitroxServer\Serialization\WorldEntityDataParser.cs:строка 56 в NitroxServer.GameLogic.EntitySpawner..ctor() в O:\Downloads\Games\subnautica\Nitrox\NitroxServer\GameLogic\Spawning\EntitySpawner.cs:строка 24 в NitroxServer.Communication.Packets.PacketHandler..ctor(PlayerManager playerManager, TimeKeeper timeKeeper, SimulationOwnership simulationOwnership) в O:\Downloads\Games\subnautica\Nitrox\NitroxServer\Communication\Packets\PacketHandler.cs:строка 26 в NitroxServer.Server..ctor() в O:\Downloads\Games\subnautica\Nitrox\NitroxServer\Server.cs:строка 17 в NitroxServer.Program.Main(String[] args) в O:\Downloads\Games\subnautica\Nitrox\NitroxServer\Program.cs:строка 14
Translation of error: The input string was not in the correct format.

Ok this error happens when you are compiling source code in different localization (in my case russian) and it have different number format.

string[] dimensions = items[1].Split('-');

I "fixed" it for myself using this code:
string[] dimensions = items[1].Replace(".",",").Split('-');

But of course its just fast workaround, and actually there should be proper fix.

[Creatures] Sync Actions and make AI multiplayer friendly

  • Audit actions and determine which ones are worth syncing. Prioritize order of execution.
  • Create common interface to serialize creature actions and their corresponding data.
  • Broadcast creature actions to other players.
  • Replay creature actions on other clients.
  • Make AI multiplayer friendly (instructions to choose prey based on criterias)

No fish spawning and this in server console: [Nitrox] W: Couldn't load serializable attribute for Peeper version

Hi,

I've followed the steps in this guide carefully: https://github.com/SubnauticaNitrox/Nitrox/wiki/Setting-up-a-development-environment-for-Nitrox

Everything is working fine except for the fish and any predators or whatsoever, there are just no fish etc in the game. limestone rocks etc plants its all there just not any fish or leviathans or whatsoever.

I did get this warning message twice in the server console but I don't know if it's causing the fish to not spawn or if it's something else causing this.
[Nitrox] W: Couldn't load serializable attribute for Peeper version

NOTE: The fish don't spawn in singleplayer either after editing game files via dnspy.

EDIT:

I discovered this in the subnautica output log.txt file:

[Nitrox] I: Applying NitroxPatcher.Patches.ToggleLights_SetLightsActive_Patch [Nitrox] I: Applying NitroxPatcher.Patches.uGUI_OptionsPanel_AddBindings_Patch [Nitrox] D: Added surrogate NitroxModel.DataStructures.Surrogates.ColorSurrogate for type UnityEngine.Color [Nitrox] D: Added surrogate NitroxModel.DataStructures.Surrogates.Int3Surrogate for type Int3 [Nitrox] D: Added surrogate NitroxModel.DataStructures.Surrogates.QuaternionSurrogate for type UnityEngine.Quaternion [Nitrox] D: Added surrogate NitroxModel.DataStructures.Surrogates.TechTypeSurrogate for type TechType [Nitrox] D: Added surrogate NitroxModel.DataStructures.Surrogates.Vector3Surrogate for type UnityEngine.Vector3 [Nitrox] I: Connected to server IndexOutOfRangeException: Array index is out of range. at Array31[System.Int32].Get (Int32 x, Int32 y, Int32 z) [0x00000] in :0
at Array3`1[System.Int32].get_Item (Int32 x, Int32 y, Int32 z) [0x00000] in :0
at GameInput.GetBindingInternal (Device device, Button button, BindingSet bindingSet) [0x00000] in :0
at GameInput.GetInputStateForButton (Button button) [0x00000] in :0
at GameInput.GetButtonDown (Button button) [0x00000] in :0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
at System.Reflection.MonoMethod.Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) <0x0022d>
at System.Reflection.MethodBase.Invoke (object,object[]) <0x0002f>
at NitroxModel.Helper.ReflectionHelper.ReflectionCall (GameInput,string,System.Type[],bool,bool,object[]) <0x000be>
at NitroxPatcher.Patches.Player_Update_Patch.Postfix (Player) <0x00244>
at (wrapper dynamic-method) Player.Update_Patch1 (object) <0x0041c>

(Filename: Line: -1)

IndexOutOfRangeException: Array index is out of range.
at Array31[System.Int32].Get (Int32 x, Int32 y, Int32 z) [0x00000] in <filename unknown>:0 at Array31[System.Int32].get_Item (Int32 x, Int32 y, Int32 z) [0x00000] in :0
at GameInput.GetBindingInternal (Device device, Button button, BindingSet bindingSet) [0x00000] in :0
at GameInput.GetInputStateForButton (Button button) [0x00000] in :0
at GameInput.GetButtonDown (Button button) [0x00000] in :0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
at System.Reflection.MonoMethod.Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) <0x0022d>
at System.Reflection.MethodBase.Invoke (object,object[]) <0x0002f>
at NitroxModel.Helper.ReflectionHelper.ReflectionCall (GameInput,string,System.Type[],bool,bool,object[]) <0x000be>
at NitroxPatcher.Patches.Player_Update_Patch.Postfix (Player) <0x00244>
at (wrapper dynamic-method) Player.Update_Patch1 (object) <0x0041c>

(Filename: Line: -1)

[Nitrox] D: Freezing escape pod rigidbody
IndexOutOfRangeException: Array index is out of range.
at Array31[System.Int32].Get (Int32 x, Int32 y, Int32 z) [0x00000] in <filename unknown>:0 at Array31[System.Int32].get_Item (Int32 x, Int32 y, Int32 z) [0x00000] in :0
at GameInput.GetBindingInternal (Device device, Button button, BindingSet bindingSet) [0x00000] in :0
at GameInput.GetInputStateForButton (Button button) [0x00000] in :0
at GameInput.GetButtonDown (Button button) [0x00000] in :0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
at System.Reflection.MonoMethod.Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) <0x0022d>
at System.Reflection.MethodBase.Invoke (object,object[]) <0x0002f>
at NitroxModel.Helper.ReflectionHelper.ReflectionCall (GameInput,string,System.Type[],bool,bool,object[]) <0x000be>
at NitroxPatcher.Patches.Player_Update_Patch.Postfix (Player) <0x00244>
at (wrapper dynamic-method) Player.Update_Patch1 (object) <0x0041c>

(Filename: Line: -1)

IndexOutOfRangeException: Array index is out of range.
at Array31[System.Int32].Get (Int32 x, Int32 y, Int32 z) [0x00000] in <filename unknown>:0 at Array31[System.Int32].get_Item (Int32 x, Int32 y, Int32 z) [0x00000] in :0
at GameInput.GetBindingInternal (Device device, Button button, BindingSet bindingSet) [0x00000] in :0
at GameInput.GetInputStateForButton (Button button) [0x00000] in :0
at GameInput.GetButtonDown (Button button) [0x00000] in :0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
at System.Reflection.MonoMethod.Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) <0x0022d>
at System.Reflection.MethodBase.Invoke (object,object[]) <0x0002f>
at NitroxModel.Helper.ReflectionHelper.ReflectionCall (GameInput,string,System.Type[],bool,bool,object[]) <0x000be>
at NitroxPatcher.Patches.Player_Update_Patch.Postfix (Player) <0x00244>
at (wrapper dynamic-method) Player.Update_Patch1 (object) <0x0041c>`

Inject NitroxPatcher into Assembly-CSharp

I would like to install this mod but I have a problem with the step: 5. Inject NitroxPatcher into Assembly-CSharp of Setting up a development environment for Nitrox
I don't really understand what to do, can someone help me ?

Server and Discord Questions

First off it said that they had a discord however they didn't leave a link to it if anyone has it pleas post it also if any of the developers are reading this and need a dedicated server i can hook you up with a test dedicated server that you would have access to 24/7 if i can get a discord and you want to talk about it i am not using my servers for anything so its up

few questions about the server program:

  1. I have everything setup client side, but on the server there are multiple Nitroxserver.exe, should I run the one in NitroxServer\bin\Debug, or NitroxServer\obj\Debug
  2. once the server is running, what is the proper command to shut it down gracefully? or should I just close the program?
  3. where is the server's copy of the world saved? or does it not keep a copy after closing.

IndexOutOfRange on Player_Update patch code

foreach (KeyBinding keyBinding in keyBindingManager.KeyboardKeyBindings)
    {
        Log.Info($"Try getting button state for: {keyBinding.Button}");
        bool isButtonDown = (bool)ReflectionHelper.ReflectionCall<GameInput>(null, "GetButtonDown", new Type[] { typeof(GameInput.Button) }, true, true, keyBinding.Button);

        if (isButtonDown)
        {
            keyBinding.Action.Execute();
        }
    }

The exception:

IndexOutOfRangeException: Array index is out of range.
    at Array3`1[System.Int32].Get (Int32 x, Int32 y, Int32 z) [0x00000] in <filename unknown>:0 
    at Array3`1[System.Int32].get_Item (Int32 x, Int32 y, Int32 z) [0x00000] in <filename unknown>:0 
    at GameInput.GetBindingInternal (Device device, Button button, BindingSet bindingSet) [0x00000] in <filename unknown>:0 
    at GameInput.GetInputStateForButton (Button button) [0x00000] in <filename unknown>:0 
    at GameInput.GetButtonDown (Button button) [0x00000] in <filename unknown>:0 
    at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&)
    at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0 
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    at System.Reflection.MonoMethod.Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) <0x0022d>
    at System.Reflection.MethodBase.Invoke (object,object[]) <0x0002f>
    at NitroxModel.Helper.ReflectionHelper.ReflectionCall<GameInput> (GameInput,string,System.Type[],bool,bool,object[]) <0x000be>
    at NitroxPatcher.Patches.Player_Update_Patch.Postfix (Player) <0x00244>
    at (wrapper dynamic-method) Player.Update_Patch1 (object) <0x0041c>

GetButtonDown on 'chat' button number 45 throws an exception because it's not added to GameInput.buttonBindings when Subnautica checks it.

  • What is the purpose of the patch?
  • Would it be better to use an Update() loop and use Unity's Input class to bind custom keyboard to actions like 'open chat window'?

Are the servers currently broken?

I got everything setup properly however I'm not actually able to join any servers, it puts me into a game but I don't get a message in the server console and if I stop the console it doesn't kick me. Am I doing anything wrong other than opening Nitrox\NitroxServer\bin\Debug\NitroxServer.exe?

Cyclops Movement

Unable to Dock vehicles from other players piloting them while another player is in the cyclops.

I'm not the only one asking this. (Installation)

OK so I'm no computer savvy so I need to ask the next: "How do I install Nitrox?" me and my friends have been mashing our heads against the wall to decrypt how to install this mod, so I am asking for help! I can't seem to be smart enough to do it myself

Mac Support

I tried leaving the zip that i unzipped and downloaded (i put the file from the zip) in almost everything data, resource, plugins, MacOs, e.g. however it did not work, i understand if you can't implement this feature, (mac compatibility is hard) but i would really really appreciate it if you could add mac support to this godsend of mod

kind regards - Gravel

Server IP?

what's the default server IP and port? IP is probably the external IP address, but whats the port?

Consistent coding style

Put a styleguide together covering both formatting (eg. settings for the built in formatter) and syntactical matters.
Below is a list of inconsistencies and changes I've noticed in the project.

Formatting:

  • Spaces between keywords and parentheses if ( vs if(.
  • Unnecessary (trailing) white space (VS removes this on format).
  • Sorting of fields and methods (dependent on access modifiers mostly).
  • Use docstrings /// instead of regular (//) comments.
    • If needed, use the right syntax to refer to variables etc.

Syntactical / formatting (mixed):

  • Unnecessary use of this.
  • Braces around one liners (and ofc method body on a separate line). Single line method expressions are OK too.
  • Parens around assignment expressions foo = (bar != none);.
  • Unused (and unordered) using statements (VS can fix this as well).
  • Unnecessary casts.
  • Write field initializers at declaration instead of in the constructor (if applicable).
    public readonly List<string> SomeThings { get; } = new List<string>(); versus assigning it in the contstructor.
  • Short notations:
    • Null propagation such as foo = bar ?? cake;.
    • Ternary if statements such as foo = bar < 0 ? bar : foo;.
    • Safe navigation operator var foo = bla?.something;.

Safe code practices:

  • As strict as possible access modifiers (to indicate usage and prevent ambiguity):
    • Use static when a method doesn't (need to) touch local variables.
    • const and readonly where possible.
    • public vs internal, with multiple libraries going on this might be a good idea.
    • private on 'unity functions' that should not be called by our code (Awake, Start, etc)
    • Remove private set; when a property is only assigned in the constructor (or directly).
    • sealed classes? I'd say that's out of scope, until we start allowing plugins and such (or build a complete modding framework).
  • Check for NRE's everywhere;
  • Especially when retrieving datastructures from game-code. The game is constantly in development, and things will change. Defensive programming practices are a must to aid in debugging and correcting these changes later on.

Naming:

  • CTS or aliases (Int vs int and so on).
  • lowerCamelCase for everything private, UpperCamelCase for everything else?

Other:

  • Use of inline functions vs defining a full function with types etc.
  • Also applies to lambda notation: private bool cake() => foo != null;.
  • Sort Compile items in csproj files; this reduces faulty decisions in merge conflicts.
  • Use file-scoped namespace declarations for new code.

And remember, it's not so much a matter of preference as it is a matter of consistency.

Compile error

Error CS1503 Argument 1: cannot convert from 'NitroxModel.DataStructures.Util.Optional<string>' to 'string' NitroxServer C:\Users\Skyte\Desktop\Nitrox\NitroxServer\Serialization\BatchCellsParser.cs 83

error compiling

Severity    Code    Description    Project    File    Line    Suppression State
Error    CS1501    No overload for method 'Enqueue' takes 2 arguments    NitroxTest    (directory)\Nitrox\NitroxTest\Model\PriorityQueueTest.cs    14    Active

ArgumentException: failed to convert parameters

i use now VS 2017 ;)
when join button clicking comes the exception.
cannot-join-server
output_log.txt

--- output_log.txt ---

ArgumentException: failed to convert parameters
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in :0
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in :0
at NitroxModel.Helper.ReflectionHelper.ReflectionCall[uGUI_MainMenu] (.uGUI_MainMenu o, System.String methodName, Boolean isPublic, Boolean isStatic, System.Object[] args) [0x00000] in :0
at NitroxClient.MonoBehaviours.Gui.MainMenu.JoinServer+d__8.MoveNext () [0x00000] in :0
at UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) [0x00000] in :0
UnityEngine.MonoBehaviour:StartCoroutine_Auto_Internal(IEnumerator)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
NitroxClient.MonoBehaviours.Gui.MainMenu.JoinServer:DoJoinServerWindow(Int32)
UnityEngine.LayoutedWindow:DoWindow(Int32)
UnityEngine.GUI:CallWindowDelegate(WindowFunction, Int32, Int32, GUISkin, Int32, Single, Single, GUIStyle)

EDIT:
okay, i found the Bug.
IEnumerator startNewGame = (IEnumerator)uGUI_MainMenu.main.ReflectionCall("StartNewGame", false, false, GameMode.Survival);

GameMode.Survival was changed to GameModeOption.Survival

Improvement: Use lidgren as backend for networking

https://github.com/lidgren/lidgren-network-gen3

About Lidgren

Lidgren uses a single UDP channel and allows specific messages to be delivered reliable, in sequence, both or neither for lowest latency.

Easy to add encryption
Local network server discovery

Why change?

Current network stack uses TCP which has poor latency for updating entity positions or in other high-frequency communication requirements. Lidgren offers more flexibility than what is currently in code so it will give an edge both in time and features.

Because there's still a lot of work to do I think it's best to change this asap.

I need help with understanding multiplayer features as-is

I would like to make this improvement myself but I'm not sure what works now and what doesn't. Connecting seems to be very manual (through console commands) and I don't have another player to test with. If someone could help me with explaining their current workflow on testing multiplayer it'll help a lot.

Research plan

  • Develop network debugging UI with statistics of the current network stack.
  • Document current networking statistics, explore edge-case situations.
  • Implement another network stack with Lidgren in a new branch.
  • Document new network stack and explore edge-case situations.
  • Research current feature list of both network stacks.
  • Compare side-by-side and decide.

Implementation plan

  1. Create branch 'feature-netcode'
  2. Create sub-project: "Nitrox.Networking".
  3. Add Lidgren as dependency, move packet and serialization classes to it.
  4. Implement NitroxClient/NitroxServer classes using Lidgren backend.
  5. Extend packet class so that method-of-deliver can be specified.
  6. Allow packets to be 'registered' so that both NitroxClient and NitroxServer can work.
  7. Test it ;)

Space For Modder Collaboration

I was just wondering if there is a place that we, as contributors to the mod, can get support or suggestions from one another. Is that just the Discord channel at the moment? Or do we have something like a slack account anywhere where we can share design ideas without needing to open an issue on the github repo?

It would be nice to have a space for collaboration that wasn't constantly polluted by users asking questions while trying to get the mod running on their machines.

Trying to build the binaires dont work :(

After the gen Failed For 4 things 4 errors appear
" Impossible d'utiliser le type 'NitroxModel.Packets.Packet' comme paramètre de type 'T' dans le type ou la méthode générique 'PriorityQueue'. Il n'y a pas de conversion de référence implicite de 'NitroxModel.Packets.Packet' en 'IPriorityQueueItem'. NitroxClient C:\Users\snayzix\Desktop\Nitrox-master\NitroxClient\Communication\DeferringPacketReceiver.cs 16
"
and

"Aucune surcharge pour la méthode 'Enqueue' n'accepte les arguments 2 NitroxClient C:\Users\snayzix\Desktop\Nitrox-master\NitroxClient\Communication\DeferringPacketReceiver.cs 30 Actif
"

Both of theses error are in french :D
See ya

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.