nebulamodteam / nebula Goto Github PK
View Code? Open in Web Editor NEWA multiplayer mod for the game Dyson Sphere Program
License: GNU General Public License v3.0
A multiplayer mod for the game Dyson Sphere Program
License: GNU General Public License v3.0
The project does not come with the game DLLs, so you need to copy the game DLLs to the Libs/ folder. Then you need to drag all the Unity related DLLs to the DowgradeDll.exe executable that is in the Lib/ folder. Else you will have a lot of issues when running the code in the actual game.
This is really hard to reproduce, but sometimes when I disconnects with the client while running I will get this error on the host:
NullReferenceException: Object reference not set to an instance of an object
at WebSocketSharp.WebSocket.get_Url () [0x00000] in <filename unknown>:0
at NebulaModel.Networking.NebulaConnection.SendPacket[PlayerAnimationUpdate] (NebulaModel.Packets.Players.PlayerAnimationUpdate packet) [0x00000] in <filename unknown>:0
at NebulaHost.Player.SendPacket[PlayerAnimationUpdate] (NebulaModel.Packets.Players.PlayerAnimationUpdate packet) [0x00000] in <filename unknown>:0
at NebulaHost.PlayerManager.SendPacketToAllPlayers[PlayerAnimationUpdate] (NebulaModel.Packets.Players.PlayerAnimationUpdate packet) [0x00000] in <filename unknown>:0
at NebulaHost.MultiplayerHostSession.SendPacket[PlayerAnimationUpdate] (NebulaModel.Packets.Players.PlayerAnimationUpdate packet) [0x00000] in <filename unknown>:0
at NebulaWorld.LocalPlayer.SendPacket[PlayerAnimationUpdate] (NebulaModel.Packets.Players.PlayerAnimationUpdate packet) [0x00000] in <filename unknown>:0
at NebulaWorld.MonoBehaviours.Local.LocalPlayerAnimation.Update () [0x00000] in <filename unknown>:0
When it's dark and two player are standing beside each other, they don't receive lighting from each other, making the other player very dark.
When a client builds an entity, the item is not substracted from their inventories.
In the wiki, on the "Setting up a decelopment environment" the git clone command says:
git clone https://github.com/your-github-name/nebula.git --recursive
while it should be:
git clone https://github.com/hubastard/nebula.git --recursive
Sync the Dyson sphere and all its components when a player joins the server.
Current status:
I am creating this just for tracking purposes since I just start to work on it.
I am opening this for tracking purposes since I have started to work on this.
The following needs to be implemented:
Following statistics data needs to be synchronized:
When a client joins a game where the landing pod is already destroyed, a landing pod is still created for the client the is joining the game.
When you host a game and join the game with the second game instance before the first one could fully load the game one of the players gets teleported to the sun.
Not sure if that only happens to me so it would be good if someone could confirm this, tested on the master branch.
To be able to host a mid / late game for our test we should add a "host game" button in the esc game menu.
Currently factories are requested as-needed from the host.
However, they are only ever loaded, and never unloaded, even if the player were to leave the system/planet.
Therefore, we need to implement a system to unload the factories when it is no longer required for a non-host player to have them loaded in. This can include cessation of events etc being sent/received once implemented.
I am opening this issue for tracking purposes. I have started to work on this.
Basically, it is the synchronization of GameHistoryData class.
Progress:
Steps i did beofre this happened:
FactoryData
is received and stored locally)This may be caused by FlattenTerrain()
which ic called when the building is placed.
I am creating this for tracking purposes since I have started to work on it.
ToDo:
As suggested by #resinate on discord, we could add a setting when you host your game to make new players spawn at a random planets, it will need to be a planet that as all the resources needed for a "first planet".
The proof of concept was sending the player position and animation update as fast as possible. But this will be too much for the server. So instead I need to limit the position update to 20 times per seconds and add client side interpolation.
If you change the ProtocolVersion
to 1 in the HandshakeRequest
server denies the client to connect but does not resume the loading screen and does not send notification packet to the other clients to resume.
Below is also an exception that is raised on the server-side:
NullReferenceException: Object reference not set to an instance of an object
at WebSocketSharp.WebSocket.get_Url () [0x00000] in <filename unknown>:0
at NebulaModel.Networking.NebulaConnection.SendPacket[HandshakeResponse] (NebulaModel.Packets.Session.HandshakeResponse packet) [0x00000] in <filename unknown>:0
at NebulaHost.Player.SendPacket[HandshakeResponse] (NebulaModel.Packets.Session.HandshakeResponse packet) [0x00000] in <filename unknown>:0
at NebulaHost.PacketProcessors.Session.HandshakeRequestProcessor.ProcessPacket (NebulaModel.Packets.Session.HandshakeRequest packet, NebulaModel.Networking.NebulaConnection conn) [0x00000] in <filename unknown>:0
at NebulaModel.Networking.Serialization.NetPacketProcessor+<>c__DisplayClass34_0`2[NebulaModel.Packets.Session.HandshakeRequest,NebulaModel.Networking.NebulaConnection].<SubscribeReusable>b__0 (NebulaModel.Networking.Serialization.NetDataReader reader, System.Object userData) [0x00000] in <filename unknown>:0
at NebulaModel.Networking.Serialization.NetPacketProcessor.ReadPacket (NebulaModel.Networking.Serialization.NetDataReader reader, System.Object userData) [0x00000] in <filename unknown>:0
at NebulaModel.Networking.Serialization.NetPacketProcessor.ProcessPacketQueue () [0x00000] in <filename unknown>:0
at NebulaHost.MultiplayerHostSession.Update () [0x00000] in <filename unknown>:0
With the advent of #74, we now have a good first pass at synchronizing entity creation. We should now look at synchronizing removing entities.
This is an issue to track the work on players names appearing over their heads
To clean up the code, I should add a proper playerJoin packet that will make each client spawn the remote player model.
I am creating this for tracking purposes since I am started to work on it.
To do:
Once #76 is merged, I should update the wiki to reflect the changes done to the project setup.
I am creating this for tracking purposes since I have started to work on it.
To Do:
If one player places a building other players need to see the same and need to be able to interact with it as if they had build it by them self.
Current status:
dsp save file is very heavy
I think the analysis of the save file
using (BinaryWriter binaryWriter = new BinaryWriter(fileStream))
{
binaryWriter.Write('V');
binaryWriter.Write('F');
binaryWriter.Write('S');
binaryWriter.Write('A');
binaryWriter.Write('V');
binaryWriter.Write('E');
binaryWriter.Write(0L);
binaryWriter.Write(4);
binaryWriter.Write(GameConfig.gameVersion.Major);
binaryWriter.Write(GameConfig.gameVersion.Minor);
binaryWriter.Write(GameConfig.gameVersion.Release);
binaryWriter.Write(GameMain.gameTick);
binaryWriter.Write(DateTime.Now.Ticks);
if (GameMain.data.screenShot != null)
{
int num = GameMain.data.screenShot.Length;
binaryWriter.Write(num);
binaryWriter.Write(GameMain.data.screenShot, 0, num);
}
else
{
binaryWriter.Write(0);
}
GameMain.data.Export(binaryWriter);
long position = fileStream.Position;
fileStream.Seek(6L, SeekOrigin.Begin);
binaryWriter.Write(position);
}
next i see GameData.Export
public void Export(BinaryWriter w)
{
w.Write(2);
w.Write(this.gameName);
this.gameDesc.Export(w);
w.Write(GameMain.gameTick);
this.preferences.CollectComplete();
this.preferences.Export(w);
this.history.Export(w);
w.Write(this.hidePlayerModel);
w.Write(this.disableController);
this.statistics.Export(w);
w.Write((this.localPlanet == null) ? 0 : this.localPlanet.id);
this.mainPlayer.Export(w);
w.Write(this.factoryCount);
this.galacticTransport.Export(w);
for (int i = 0; i < this.factoryCount; i++)
{
this.factories[i].Export(w);
}
w.Write(this.dysonSpheres.Length);
for (int j = 0; j < this.dysonSpheres.Length; j++)
{
if (this.dysonSpheres[j] != null)
{
w.Write(1);
this.dysonSpheres[j].Export(w);
}
else
{
w.Write(0);
}
}
}
and view GameDesc .Export
public void Export(BinaryWriter w)
{
w.Write(2);
w.Write(this.galaxyAlgo);
w.Write(this.galaxySeed);
w.Write(this.starCount);
w.Write(this.playerProto);
w.Write(this.resourceMultiplier);
int num = this.themeIds.Length;
w.Write(num);
for (int i = 0; i < num; i++)
{
w.Write(this.themeIds[i]);
}
}
Right now when the host disconnect, all the clients crashes.
Steps to reproduce:
sync the important visual and sound effects.
Current status:
Whats missing:
Currently when a user joins and the factory is loaded, the mesh of the planet is not transferred - this means that various parts of the factory appear to be underground to non-host players.
Right now, when the client quit the game gracefully (esc menu -> Quit button). The client is prompt with an unexpected disconnect
popup that ask if you want to reconnect or quit. This popup should only be shown for server disconnection issues not when the client wants to quit the game.
Currently, the project is using the default langversion (C# 3), but the langversion can be upgraded to at least C# 7.3 without any problems at least, and this includes the ability to use ref locals
.
With ref locals
you can avoid the penalty of struct copies and other stack copies, that could add up in the context of a multiplayer computation.
This should be as simple as adding <LangVersion>7.3</LangVersion>
to the csproj files.
This exception is thrown every FixedUpdate() call to the player who has joined the game. Seems to be caused by the stations.
at StationComponent.InternalTickRemote (Int32 timeGene, Double dt, Single shipSailSpeed, Single shipWarpSpeed, Int32 shipCarries, .StationComponent[] gStationPool, .AstroPose[] astroPoses, VectorLF3 relativePos, Quaternion relativeRot, Boolean starmap, System.Int32[] consumeRegister) [0x00000] in <filename unknown>:0
at PlanetTransport.GameTick (Int64 time, Boolean isActive) [0x00000] in <filename unknown>:0
at PlanetFactory.GameTick (Int64 time) [0x00000] in <filename unknown>:0
at GameData.GameTick (Int64 time) [0x00000] in <filename unknown>:0
at GameMain.FixedUpdate () [0x00000] in <filename unknown>:0
Steps to reproduce:
Since the "host" refactor, the local player colors does not seems to be applied anymore. I looked at it quickly, the method that sets the colors is called and it looks like it is modifying the material but it must be reverted after is game loaded because there is no color change for the local client. Remote clients looks to be fine.
We should not display the reconnection message if you haven't connected successful with the host first.
I'm reworking the entity placement code to be able to syncronize the entitypools / prebuildpools indices.
During our playthrough, a client was able to stack 6 labs even if the the limit was 3.
Afaik this is due to loading the PlanetFactory
from the server. It does not happen for Player 1 (the hosting one) or if you disable this feature for the others.
The error that pops up in the corner is fixed by this patch
ArrivePlanet()
or RequestLoadPlanetFactory()
(this is where we patch and the request gets triggered) gets called.LoadingPlanetFactoryMain()
finished atleast one of its steps (not sure if it comes back sometime after the last step or sometime inbetween).ModelingPlanetMain()
is only called once when you load the game, so its unlikely that the cause is in there.uPosition
of player and planet do not change significantly between the weird movement of the planet.GameMain.mainPlayer.transform.position
does change from 0 0 0
before the request to some coordinates after the request, but does not change when the planet comes back to normal. I dont think its related to this either.Tested on master branch.
The LocalPlayer.SetReady()
should be called only once the local player that is syncing is done loading the game. Right now it is called immediatly while processing the HandshakeResponse
packet so the game is unpause while the client is in the loading screen.
Also, we should pause the syncing player once the player is done loading the game before he calls the LocalPlayer.SetReady(), that way he would receive the "SyncComplete" packet at the same time as the other players when the server knows that every syncing players are done loading the game (because there could have more than 1 player loading at the same time)
When the host pauses the game (by pressing ESC) the game tick will stop which causes desync on all clients, since their game tick will continue increasing. I think it is needed to sync the game pause or completely remove pausing the game when navigating to the menu.
During our playthrough:
You will see a warning like this on the host that will repeat overtime since the client will try to BuildFinally
the prebuild forever:
BuildEntityRequest received does not have a corresponding PrebuildRequest with the id 20 for the planet 104
Currently with the changes introduced by #74 belts do not connect when placed, there is just a round dot on the ground.
I am creating this for tracking purposes since I have started to work on it.
The following needs to be finished:
.server
save-file with info about all players.A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.