Git Product home page Git Product logo

nebula's Introduction

Nebula Multiplayer Mod GitHub Release Nightly Build Build - Win x64

An open-source, multiplayer mod for the game Dyson Sphere Program.

Download Prerelease

Build - Win x64 Note: This is the bleeding edge build, for the more stable build see below. You can use this one if you want to try out the latest development builds, which may contain bugs and unfinished work.

You will also need some extra steps to get this installed, see 2nd point in "How can I play this mod?".

FAQ

Where can I get mod support?

Please join our Discord Server and ask your question in the support channel. We have a really nice community that will be able to answer your questions.

How can I play this mod?

Please do keep in mind that this mod is still in heavy development, it may still contains bugs.

API Documentation

This mod has an API, that makes it easier for other mod developers to make their mods compatible with Nebula. If you are a mod developer and you want your mods to be compatible, follow the instructions here. Also you can always join our Discord Server for help with using the API.

Chat

The chat window can opened/closed using Alt + Backtick (configurable in Settings - Multiplayer - Chat). Type /help to view all commands. Also in settings is an option to disable the chat window from automatically opening when a message is received.

What is the current status?

Major refactors will happen while the project grows or game updates. Join the Discord Server if you want to see to latest state of our development. Check Wiki for overview of features.

The multiplayer mod now supports Dark Fog combat mode in the latest game version (0.10.30.x).
Most of the battle aspects are sync, only few features are still WIP.

List of peace mode syncing features
  • Server / Client communication
  • Custom Multiplayer menu in-game
  • Player Movement syncing on Planet
  • Player Movement syncing in Space
  • Player VFX syncing (jetpack, torch, ...)
  • Player SFX syncing (footsteps sound, torch sound, ...)
  • Players appearances syncing
  • Game Time (UPS) syncing
  • Universe settings syncing
  • Client planet loading from server
  • Planet vegetation mining syncing
  • Planet resources syncing
  • Build preview syncing
  • Entity creation syncing
  • Entity desctruction syncing
  • Entity upgrade syncing
  • Dyson spheres syncing
  • Researches syncing
  • Factories statistics syncing
  • Containers inventory syncing
  • Building Interaction syncing
  • Belts interaction syncing (pickup, putdown)
  • Trash (dropped items) syncing
  • Interstellar Station syncing
  • Drones events syncing
  • Foundation syncing (terrain deformation)
  • Server state persistence
  • Power network syncing (charger and request power from dyson sphere)
  • Warning alarm syncing
  • Broadcast notification syncing
List of combat mode syncing features
  • Sync settings of new building (BAB, turrets)
  • Sync combat settings
  • Sync DF ground enemy create/destroy events (factory.enemyPool)
  • Sync DF ground units activate/deactivate event
  • Sync DF space enemy create/destroy events (spaceSector.enemyPool)
  • Sync DF space units activate/deactivate events
  • Sync DF planet base exp level and threat
  • Sync DF space hive exp level and threat
  • Sync loot and loot filter table
  • Sync mecha shooting weapons
  • Sync mecha bombing
  • Sync mecha death and respawn animation
  • Sync mecha personal shield to block projectiles
  • Sync DF base awake events (player lock with weapon, player nearby, under attack)
  • Sync DF base threat and launch assault event
  • Patch DF unit to search for nearest alive mecha (sensor range)
  • Patch DF turret to search for nearest alive mecha (attack when within attack range or counterattack)
  • Sync the hatred targets changes so DF units are attacking the same target
  • Sync building repair drone (imperfect)
  • Sync building kill event (server fully authorized)
  • Sync building reconstruct event
  • Sync DFRelay ArriveBase/ArriveDock/LeaveBase/LeaveDock events
  • Sync Remove base pit event
  • Sync TryCreateNewHive, DispatchFromHive events
  • Sync hive realize and open/close preview events
  • Sync DF hive awake events (player lock with weapon, player nearby, under attack)
  • Sync DF hive threat level and launch assault event
  • Patch DF unit to search for nearest alive mecha (sensor range)
  • Patch DF turret to search for nearest alive mecha (attack when within attack range or counterattack)
  • Show base/hive/relay invasion events in chat
  • Sync kill stats
  • Sync Dark Fog communicator (aggressiveness and truce)
  • Show remote mecha combat drone fleet animation
  • Show remote mecha spacecraft fleet animation
  • Show ground-to-space attacks animation on client for remote planets (missile turrets, plasma cannon)
  • Show space-to-ground attacks animation for remote planets (lancers invading with sweep laser and bomber)

How can I contribute?

Please join our Discord Server to ask if someone is already working on the task that you want to do. Once, you are done with your modification, simply submit a pull request. Contribution documentation can be found here: Wiki.

How can I support the team?

If you like what we do and would like to support us, you can donate through our Patreon. Thanks for the support <3

nebula's People

Contributors

ajh16 avatar alienxaxs avatar antfightclub avatar baldie-dev avatar cutestnekoaqua avatar hubastard avatar jon-myrstad avatar killerkarnickel avatar limoka avatar mattsemar avatar mmjr-x avatar mushroom avatar needix avatar nogtnohappy avatar phantomgamers avatar reousa avatar shad0wlife avatar sk7725 avatar slappy826 avatar sp00ktober avatar starfi5h avatar therealmarine avatar therzok avatar tobiasgeys avatar zzarek 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

nebula's Issues

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

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.

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.

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.

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.

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.

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

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 

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.

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

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

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.

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.

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

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.

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 

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.

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

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.

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

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

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

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.

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.

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)

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

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.