NebulaModTeam / nebula

A multiplayer mod for the game Dyson Sphere Program
GNU General Public License v3.0
836 stars 124 forks source link

[Headless] The host seems unaware of clients threat generation. #685

Closed AlienXAXS closed 2 months ago

AlienXAXS commented 3 months ago

Hi, I have been noticing a weird thing when hosting a game via the headless client.

If I were to shoot a relay, I see the threat go up and reset back when the next sync tick happens. Clients do not seem to sync their generated threat back to the host.

threat_weird

I also noticed that when base components / enemies /etc are destroyed, the main Space Hive does not gain any threat. I moved my save to a non-headless Graphic-enabled server and it syncs as expected.

TLDR:

  1. Threat generated by clients when attacking a relay (only tested Relays) while connected to a headless server does not increase the threat on the headless host.
  2. When enemy buildings are destroyed by connected clients, threat doesnt increase.
  3. Threat works normally when the host has the game loaded fully (not a headless)
AlienXAXS commented 3 months ago

Just to add to this, it seems that if a client attempts to generate threat on a planet where the host mecha is not. The threat generated is less than intended.

AlienXAXS commented 3 months ago

After some debugging, I reverted one of your patches to make the host mecha not be dead while running headless. https://github.com/NebulaModTeam/nebula/blob/master/NebulaPatcher/Patches/Dynamic/Dedicated_Server_Patch.cs#L43

This line was set to be isAlive = True, while I understand this causes some more issues down the line of enemies / turrets etc attempting to fire upon the invisible host mecha, this does indeed fix the threat issue.

Also, you need to patch out UICommunicatorIndicator._OnLateUpdate within Dedicated_Server_Patch as this throws an Object Reference error most likely due to there being no UI.