Terasology / DynamicCities

Cities that get fancy!
18 stars 14 forks source link

City minimap details replicating incorrectly on clients #66

Open AndyTechGuy opened 4 years ago

AndyTechGuy commented 4 years ago

When using DynamicCities in multiplayer, there are key differences in the minimap displays between the host and a client player:

image image Left: Minimap of the hosting player Right: Minimap of a client player with the same position & zoom

Normally in singleplayer, the two parts of the city minimap (the district overlay and the city centre indicator) load in when the player first enters the area of the city. However when a client enters the city, this console warning message appears:

No SettlementCache found! Unable to create district overlay

This console log originates from this line in MinimapOverlaySystem. The information that places the overlays on the minimap comes from a SettlementsCacheComponent attached to a global settlement cache entity, which is created in the SettlementCachingSystem. This console log shows that the settlement cache entity is only present on the server. This entity has a NetworkComponent attached, meaning that it should theoretically be replicating to all clients, but it is not replicating for an unknown reason.

These minimap issues can be fixed in one of two ways:

  1. Figure out why the entity containing the SettlementsCacheComponent isn't replicating to clients; if the entity was replicating then the system would work as intended even on multiplayer.

  2. Use network events instead of components to communicate overlay information. This route should be used only after exhausting the first route.

skaldarnar commented 4 years ago

Thanks for this detailed report - it should give enough clues on where to start investigation.