Events are triggering on my friends colony instead of mine and same for them.
Any Raid notifications I get are for my friends faction and every time they accept a quest to house people for x days, those pawns show up at my place
There never has been a desync issue so I don't think I can send any information, sry
V1.6
Label: Bug, Multifaction, 1.6, High prio
I investigated that problem a few weeks ago, but I don’t have time to finish it right now.
Problem: Storyteller of Faction A generates a letter for an incident, but the incident is executed on Faction B’s map.
Reproduction: I don’t have exact reproduction steps, but I had a save where it happened about 80% of the time. I was using Randy Random as the storyteller.
I talked about it with StillSuit here: https://discord.com/channels/524286515644203028/568070216626470922/1415419932811858144
I think part of the (or the entire) problem lies in Settlement.IncidentTargetTags.
My understanding:
Each player faction has its own storyteller. Every storyteller should send most incidents only to maps that belong to its own faction. A storyteller sends those incidents if the MapParent returns Map_PlayerHome in the IncidentTargetTags method. In version 1.6, this behavior has changed.
I think to understand how our code behaves this is a good starting point:
StorytellerPatch1 StorytellerPatch2
1.5
class Settlement
public override IEnumerable<IncidentTargetTagDef> IncidentTargetTags()
{
...
if (base.Faction == Faction.OfPlayer)
{
yield return IncidentTargetTagDefOf.Map_PlayerHome;
}
...
}
1.6
class Settlement
public override IEnumerable<IncidentTargetTagDef> IncidentTargetTags()
{
...
if (base.Faction == null || base.Faction == Faction.OfPlayer || SettlementDefeatUtility.IsDefeated(base.Map, base.Faction))
{
yield return IncidentTargetTagDefOf.Map_PlayerHome;
}
...
}
Test: I reverted the logic back to the 1.5 state, gave two people the build, and also tested it myself for a while. Both testers reported that it worked fine for them. I did encounter a strange issue: a pawn was randomly assigned to my faction but visually appeared on another faction’s map. However, the pawn wasn’t actually on that map - it was stuck somewhere in the void. Clicking on the pawn in the pawn bar moved the camera to the settlement tile on the world map instead. Unfortunately, I wasn’t paying close attention - I just let the game run, occasionally accepted quests, and checked whether the letters matched the correct map.
Solution Reverting the logic to 1.5 doesn’t seem like the right solution, since I don’t know why the new conditions were added in the first place.
Can you try logging base.Faction and Faction.OfPlayer? I suspect one of them is null, the issue is probably earlier in the codepath.
I don’t think there was a problem earlier, since I started checking from the beginning of the system (Storyteller.Tick) and this has been the first occurrence that seemed odd. Could be totally wrong though.
SettlementDefeatUtility.IsDefeated(base.Map, base.Faction) returned true in the cases where the problem occurred. We call the IncidentTargetTags() method for every faction storyteller via the faction repeater (StorytellerPatch1).
In 1.5, we only returned a player home tag when the map corresponded to the currently repeated faction. With the updated if statement, we now return a player home tag in more cases.
I’m fairly certain this is at least an issue, though I’m not sure if it’s the whole issue.
I won’t be able to dig into it further for the next few weeks :/
I will upload my fix. I must say that its from the ~month ago. Works fine so far and personally I would prefer any solution as the problem is quite annoying, if not gamebreaking.