Git Product home page Git Product logo

nebula's Issues

Add missing contribution information about how to link the game DLLs

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.

If player disconnects during the running animation, exception is raised on the server

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 

Git clone command wrong in wiki

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 Dyson Sphere object

Sync the Dyson sphere and all its components when a player joins the server.

Current status:

  • Initial Dyson Sphere synchronization
  • Real-time Synchronization of Dyson Swarm orbits planning (Finished, PR ready)
  • Real-time Synchronization of Dyson Sphere structure planning (Finished, PR ready)
  • Synchronize Realtime Sail Bullets (Finished, PR ready)

I am creating this just for tracking purposes since I just start to work on it.

Synchronization of Statistics

I am opening this for tracking purposes since I have started to work on this.

The following needs to be implemented:

  • Player should request statistic data when statistic window is opened.
  • Server should send periodical updates to the client.
  • When a player closes the window, the server will stop sending the updates.

Following statistics data needs to be synchronized:

  • Production of products
  • Consumption of products
  • Power generation
  • Power demand
  • DysonSphere construction
  • Research hashing

Player gets teleported to the sun

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.

Factories are never unloaded

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.

GameHistoryData Synchronization (research,recipes,bonuses,features)

I am opening this issue for tracking purposes. I have started to work on this.
Basically, it is the synchronization of GameHistoryData class.

Progress:

  • Initial research synchronization (getting finished techs from the host)
  • Initial mecha stats/bonuses synchronization
  • Real-time research synchronization [progress - when player contribute to the research from the mech inventory]
  • Real-time research synchronization [unlocking of techs]
  • Sync of features (if sailing or warping is enabled / can design Dyson sphere)
  • Sync of available recipes
  • Sync of bonuses from techs
  • Sync of tech queue
  • Real-time sync of tech queue
  • Real-time sync of pausing and resuming tech queue
  • Sync of pinned stars / planets
  • Real-time sync of star / planet pinning

sinking under the terrain bug

terrain_bug.mp4

Steps i did beofre this happened:

  • client travels to the planet, then leaves again into space. (this way FactoryData is received and stored locally)
  • host travels there, places building (not sure if its only triggered by ILS)
  • client comes back, tadaa

This may be caused by FlattenTerrain() which ic called when the building is placed.

Labs are not linked together when stacked

During our playthrough:

  1. Client create and stack research labs
  2. Client set the bottom lab recipes
  3. Host only have the recipes set for the bottom lab the other one on top are not linked together

labs

Interaction with Buildings Synchronization

I am creating this for tracking purposes since I have started to work on it.

ToDo:

  • Assembler interactions
  • Furnace interactions
  • Research station interactions
  • Rafinery interactions
  • Particle collider interactions
  • Railgun interactions
  • Launching silo interactions
  • Receiver interactions
  • Splitter interactions
  • Power Generator interactions
  • Inserter interactions
  • Miner interactions
  • Fluid storage interactions
  • Power Exchanger interactions

Host and all clients stucks on loading screen when client with different ProtocolVersion connects.

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 

Trash System Synchronization

I am creating this for tracking purposes since I am started to work on it.

To do:

  • Initial synchronization of all items that were being dropped when a player connects.
  • Realtime synchronization of items removal (expiration, player pick it up)
  • Real-time synchronization of items being dropped.

Storage System Synchronization

I am creating this for tracking purposes since I have started to work on it.

To Do:

  • Initial Storage sync, when player click on the storage
  • Sending real-time updates of the storage that is currently opened for the user.
  • synchronize icons of the storages
  • synchronize events from other players

Sync buildings build during gameplay to other players

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:

  • buildings get placed for each player on the same planet
  • terrain is flattened for each player on the same planet if needed
  • miners connect to the same veins.
  • power generators register as generators to the power system, consumer register as consumer.

video preview

How dsp record data?

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);
			}

image

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]);
	}
}

image

Sync Player Effects

sync the important visual and sound effects.

  • #33 blocks part of tests that need to be done to complete this

Current status:

  • sparkles are synced
  • thrusters are mostly synced
  • thruster audio effect synced on planet and space
  • mining electric audio effect synced
  • footsteps visuals and audio synced
  • vegetation collide sound effect synced
  • landing sound effect synced
  • warp visuals/audio (needs some optimization)

Whats missing:

  • clean up code

Transfer planet mesh when loading in

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.

LangVersion in the project

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.

NullReferenceException after joining the game with planetary stations

This exception is thrown every FixedUpdate() call to the player who has joined the game. Seems to be caused by the stations.
Error Message

  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:

  1. You can use mine savegame
  2. Launch the game normally as a single-player and from [Esc] game menu host the game.
  3. Join the game with the second player and observe the error.

Colors for the Local Player does not work since the refactor

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.

Entity / Building syncing

I'm reworking the entity placement code to be able to syncronize the entitypools / prebuildpools indices.

Local Planet

  • Local Entity Prebuild Preview
  • Local Entity Creation
  • Local Entity Destruction
  • Local Entity Upgrade

Remote Planet

  • Remote Entity Prebuild Preview
  • Remote Entity Creation
  • Remote Entity Destruction
  • Remote Entity Upgrade

Weird planet moving when loading factory data from server

weird.mp4

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

  • It seems like the weird planet movement starts when ArrivePlanet() or RequestLoadPlanetFactory() (this is where we patch and the request gets triggered) gets called.
  • It seems like planet comes back to normal after 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.

LocalPlayer.SetReady() is called too fast

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)

Game pause on the host is not synced with clients

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.

Prebuilds get desynced when there is at least 2 clients with host.

During our playthrough:

  1. The create the game
  2. Client 1 connects
  3. Client 2 connects
  4. Both client 1 and 2 add a couple of buildings
  5. Host starts to receive prebuild id that is not tracked in the prebuildRequest dictionnary.

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

Saving player's data

I am creating this for tracking purposes since I have started to work on it.

The following needs to be finished:

  • Every player will generate key pair for identification.
  • Host will store the last position and color of the player.
  • Host will store player's inventory.
  • Host will store other info such as (mecha energy, sand count, etc.)
  • Host will create a separate .server save-file with info about all players.

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.