rwmt / Multiplayer

Zetrith's Multiplayer mod for RimWorld
MIT License
478 stars 96 forks source link

Anomaly DLC #444

Open Zetrith opened 5 months ago

Zetrith commented 5 months ago

Issue tracking bugs and unsynced features from the Anomaly DLC.

SokyranTheDragon commented 5 months ago

Copied from #429:

RimWorld.GameConditionManager+MapBrightnessTracker:Tick uses Time.deltaTime to change the map's brightness. This is then used by RimWorld.GameConditionManager in MapBrightness, BrightnessChanging, and DarknessVisible properties.

I believe that this will cause some issues: - MapBrightness is used by RimWorld.ThoughtWorker_SwallowedByDarkness and RimWorld.GameCondition_UnnaturalDarkness - BrightnessChanging is used by RimWorld.WeatherDecider

So I believe we'll need to replace the call to Time.deltaTime in here with something else that's safe for MP.

Should be fixed by #453

SokyranTheDragon commented 4 months ago

RimWorld.CompObelisk_Abductor:GenerateLabyrinth seems to desync due to using LongEventHandler.QueueLongEvent with doAsynchronously set to true.

Just to clarify - the desync happens due to the map that was generated being different for each of the players.

SokyranTheDragon commented 4 months ago

RimWorld.UndercaveMapComponent:MapComponentTick uses current map checks, after which it calls RNG. We'll need to push/pop RNG (or make a different patch to fix it).

All the RNG ticks are graphical FX only.

SokyranTheDragon commented 4 months ago

Addendum to the previous comment I made:

Majority of what happens in RimWorld.UndercaveMapComponent:MapComponentTick is graphical or sound effects. However there's an exception to this.

When a player is specifically looking at the map containing this component, and the cave is currently collapsing, it will cause rocks to spawn on the map (Verse.RoofCollapserImmediate:DropRoofInCells). This specific call is found after 2 current map checks (one of them being most likely redundant).

I see 3 possible solutions here:

SokyranTheDragon commented 3 months ago

This is most likely a non-Anomaly issue, but dropping it here as I only noticed it on anomaly entities.

The additional graphic attachments (at least that's what I assume those are) are disconnected from the pawn and instead drawn quite far away from where they're supposed to be. Converting the same save file to SP and testing displays the proper graphics.

MP example ![NoctolMP1](https://github.com/rwmt/Multiplayer/assets/36712560/31eb6361-4d45-46fb-83d8-3d5681602650) ![NoctolMP2](https://github.com/rwmt/Multiplayer/assets/36712560/fd0e2dde-4a8d-4992-8194-1e2c3f7c5e52)
SP example ![Noctol1](https://github.com/rwmt/Multiplayer/assets/36712560/43c9ea36-85a9-43fd-9f21-235f5b60ca90) ![Noctol2](https://github.com/rwmt/Multiplayer/assets/36712560/d4d4ac9e-4d4a-457a-bb87-47d82dac4b22)
SokyranTheDragon commented 3 weeks ago

A potential issue with Multifaction, which I've mentioned in #496, is that the state of anomaly is global rather than local (GameComponent_Anomaly). This will cause some issues with Anomaly in Multifaction, like only having 1 monolith (the GameComponent only stores one of them if more were to be spawned), only 1 player being able to experience Anomaly ending (since, again, this is tied to the monolith and its map).