Faction ID's getting scrambled

Announcements, support questions, and discussion for Love/Hate.
Post Reply
dancinggoat23
Posts: 29
Joined: Mon Mar 02, 2020 1:44 pm

Faction ID's getting scrambled

Post by dancinggoat23 »

Hi Tony

I'm seeing an intermittent issue with the faction database. I haven't been able to reproduce it reliably, and my project is huge, so I know troubleshooting is problematic. However, I'm hoping that perhaps you have a suggestion as to how I might resolve the issue.

When I call the method GetAffinity(), it in turn drills down in code to eventually call FindRelationshipTraitRecursive(). At times, this method will go into a recursive loop and bail out with the warning

Love/Hate: FindRelationshipTrait exceeded max parent search depth

When I break on that line and look at the m_factionIDLookup table, I see a mismatch between the value stored in the "Key" field and the "id" in the corresponding faction value field. I've attached a screenshot of one of those mismatches. Note that "Key" is set to 20, but the id is set to 11. This causes the code to return the wrong faction when performing a lookup, and then the parents of the incorrect faction are recursed, eventually bailing on the warning.

If there's something I can send you besides the entire project, let me know and I'll gladly do so. Thanks!
Attachments
Screen Shot 2020-09-26 at 12.10.52 PM.png
Screen Shot 2020-09-26 at 12.10.52 PM.png (136.72 KiB) Viewed 2664 times
dancinggoat23
Posts: 29
Joined: Mon Mar 02, 2020 1:44 pm

Re: Faction ID's getting scrambled

Post by dancinggoat23 »

Here's the actual faction entry that causes infinite recursion. Note that the key is 10, and the id of the value is 20. The parent array contains the id 10, so looking up the parent returns the child once again.
Attachments
Screen Shot 2020-09-26 at 12.16.37 PM.png
Screen Shot 2020-09-26 at 12.16.37 PM.png (106.73 KiB) Viewed 2663 times
dancinggoat23
Posts: 29
Joined: Mon Mar 02, 2020 1:44 pm

Re: Faction ID's getting scrambled

Post by dancinggoat23 »

I followed up by exporting my faction database and examined it. The export appears to show the same issue, in that although in the admin UI my faction members have the correct parents, the export shows the incorrect faction names for parents. I'm attaching a screenshot showing what's in the inspector. Here's what in the factions.csv. The last line shows that the parents for "The Lady of the Island" are listed as "Unseelie Court" and "Fishing Village", whereas the screenshot shows the parents as "Seelie Court" and "Green Council" (the correct values).

ID,Name,Description,Preset,Color,%Judge Parents,Openness,Imagination,Artistic Interests,Emotionality,Adventurousness,Intellect,Liberalism,Conscientiousness,Self-efficacy,Orderliness,Dutifulness,Achievement-striving,Self-discipline,Cautiousness,Extraversion,Friendliness,Gregariousness,Assertiveness,Activity Level,Excitement-seeking,Cheerfulness,Agreeableness,Trust,Morality,Altruism,Cooperation,Modesty,Sympathy,Neuroticism,Anxiety,Anger,Depression,Self-consciousness,Immoderation,Vulnerability,Parents
-1,Monk,,1,0,0,60,60,55,30,10,50,25,40,15,42,45,20,25,15,5,15,5,0,0,-5,15,25,35,40,10,25,50,35,15,-30,-30,0,20,15,10
12,Monastery,,0,0,0,81.8,56.4,62.3,12.7,4.9,55.5,16.5,44.8,28.2,41.8,40.9,7.5,30.7,21.2,-14.9,26.7,3.9,-13.3,-21.2,-31.5,24.4,37,44.8,45.6,15.7,33.8,22,40.9,7.1,-76.3,-66.1,-78.7,15.7,-67.6,-55.9
13,Fishing Village,,0,2,0,22.8,-8.7,-14.2,16.5,-42.5,21.2,-6.3,29.1,33,16.5,27.5,-9.4,22,10.2,-3.9,-11.8,-9.4,25.3,-22,-10.2,9.4,-14.9,-6.3,19.7,14.2,48,-22,-12.6,14.9,7.9,-6.3,10.2,18.1,10.2,-13.4
1,Green Council,,0,5,0,-22,43.3,37,-12.6,18.1,47.2,8.7,40.1,18.1,-15.7,46.4,-11.8,26.7,15.7,-12.6,-16.5,-29.9,44.8,3.9,-26.7,5.5,-11.8,-11.8,26,12.6,29.9,-30.7,9.4,0,-19.7,11,-14.2,-22.8,26.7,-12.6
2,Wildlanders,,0,10,0,-14.9,-5.5,11,68.4,47.2,-8.7,-12.6,-19.7,35.4,-38.5,12.6,-14.2,14.2,8.6,-33,-23.6,-36.2,32.3,32.3,-32.3,16.5,-12.6,-63.7,-37.8,-10.2,7.1,-48.8,-22.8,-55.9,16.5,24.4,-30.7,-48,19.7,9.4
3,Lords of Earthly Fire,,0,3,0,-39.3,-29.1,17.3,43.3,-28.3,9.4,-24.4,52.7,40.9,18.1,40.1,-4.7,24.4,31.5,-37.8,-32.3,-36.2,48.8,11,-33.8,12.6,-19.7,-40.1,35.4,-38.5,19.7,21.2,-27.5,0,-27.5,34.6,-33,-19.7,0,14.2
4,Underworld,,0,1,0,-41.7,-9.4,11,24.4,-11.8,29.1,-9.4,18.9,38.5,19.7,22.8,3.9,32.3,19.7,-33,-15.7,-32.3,44.1,11.8,-15.7,7.1,-16.5,-37.8,35.4,5.5,24.4,-33.8,-18.9,0,12.6,23.6,-18.1,-22.8,-16.5,-42.5
8,Children of Gaia,,0,6,0,14.9,4.7,40.1,30.7,12.6,0,0,49.6,32.3,20.5,40.9,4.7,20.5,20.5,-11,-8.7,7.1,-6.3,22,-18.9,12.6,-10.2,4.7,-16.5,9.4,11,12.6,18.1,-18.9,15.7,26.7,13.4,-15.7,12.6,48
9,Seelie Court,,0,4,0,18.9,66.1,50.3,18.1,41.7,37.8,11.8,43.3,39.3,-10.2,33.8,14.9,22.8,10.2,-7.1,13.4,8.7,23.6,29.1,17.3,26,4.7,-11.8,34.6,27.5,24.4,-7.9,-14.9,3.9,14.9,17.3,-7.1,-8.7,21.2,15.7,Lady of the Flame
21,Seelie Guardian,,0,0,10.7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,Unseelie Court
10,Unseelie Court,,0,7,10.7,-35.4,60.6,44.8,38.5,30.7,30.7,-21.2,19.7,34.6,-14.9,16.5,22.8,14.9,22.8,-14.2,-22.8,15.7,36.2,21.2,26.7,16.5,-20.5,-23.6,-9.4,-10.2,16.5,-29.1,-16.5,9.4,15.7,40.1,7.1,-13.4,21.2,14.9,Lady of the Flame
20,Unseelie Guardian,,0,7,10.7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,Unseelie Guardian
11,Winged Choir,,0,9,10.7,21.2,33,22,26.7,23.6,8.7,-8.7,7.1,29.9,4.7,28.3,-8.7,17.3,25.2,12.6,18.9,18.9,25.2,37.8,22.8,16.5,12.6,22.8,0,0,11.8,9.4,-11,15.7,21.2,21.2,7.9,-14.9,-8.7,40.1
14,The Sidhe,,0,0,10.7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
15,The Guests,,0,0,10.7,-34.4,48.9,39.7,11.5,42,31.3,2.3,-22.2,19.1,-32.1,-16.8,6.9,35.1,-16,-3.1,22.9,3.1,35.9,-12.2,-13,-35.9,-12.2,-23.7,-12.2,7.6,-6.1,-15.3,-30.6,13,-12.2,14.5,-20.6,-8.4,15.3,-13.8
16,Lady of the Flame,,0,0,10.7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,Wildlanders
17,The Alchemist,,0,0,10.7,60,60,55,30,10,50,25,40,15,42,45,20,25,15,5,15,5,0,0,-5,15,25,35,40,10,25,50,35,15,-30,-30,0,20,15,10,The Sidhe
18,The Maker,,0,0,10.7,60,60,55,30,10,50,25,40,15,42,45,20,25,15,5,15,5,0,0,-5,15,25,35,40,10,25,50,35,15,-30,-30,0,20,15,10,The Sidhe
19,The Lady of the Island,,0,0,10.7,-1.55,54.7,43.65,2.75,29.9,42.5,10.25,41.7,28.7,-12.95,40.1,1.55,24.75,12.95,-9.85,-1.55,-10.6,34.2,16.5,-4.700001,15.75,-3.55,-11.8,30.3,20.05,27.15,-19.3,-2.75,1.95,-2.400001,14.15,-10.65,-15.75,23.95,1.55,Unseelie Court,Fishing Village
Attachments
Screen Shot 2020-09-26 at 12.34.02 PM.png
Screen Shot 2020-09-26 at 12.34.02 PM.png (139.03 KiB) Viewed 2662 times
dancinggoat23
Posts: 29
Joined: Mon Mar 02, 2020 1:44 pm

Re: Faction ID's getting scrambled

Post by dancinggoat23 »

...and here's the faction database asset.

Code: Select all

%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
  m_ObjectHideFlags: 0
  m_CorrespondingSourceObject: {fileID: 0}
  m_PrefabInstance: {fileID: 0}
  m_PrefabAsset: {fileID: 0}
  m_GameObject: {fileID: 0}
  m_Enabled: 1
  m_EditorHideFlags: 0
  m_Script: {fileID: 11500000, guid: a188b433183989440a69ac3b2d2e653a, type: 3}
  m_Name: TLE Faction Database
  m_EditorClassIdentifier: 
  personalityTraitDefinitions:
  - name: Openness
    description: General appreciation for art, emotion adventure, and variety
  - name: Imagination
    description: 
  - name: Artistic Interests
    description: 
  - name: Emotionality
    description: 
  - name: Adventurousness
    description: 
  - name: Intellect
    description: 
  - name: Liberalism
    description: 
  - name: Conscientiousness
    description: Self-discipline, duty, and meeting outside expectations
  - name: Self-efficacy
    description: 
  - name: Orderliness
    description: 
  - name: Dutifulness
    description: 
  - name: Achievement-striving
    description: 
  - name: Self-discipline
    description: 
  - name: Cautiousness
    description: 
  - name: Extraversion
    description: Engagement with the external world, interacting with people
  - name: Friendliness
    description: 
  - name: Gregariousness
    description: 
  - name: Assertiveness
    description: 
  - name: Activity Level
    description: 
  - name: Excitement-seeking
    description: 
  - name: Cheerfulness
    description: 
  - name: Agreeableness
    description: Considerate, kind, generous, trusting and trustworthy, helpful
  - name: Trust
    description: 
  - name: Morality
    description: 
  - name: Altruism
    description: 
  - name: Cooperation
    description: 
  - name: Modesty
    description: 
  - name: Sympathy
    description: 
  - name: Neuroticism
    description: Tendency to feel anger, anxiety, or depression
  - name: Anxiety
    description: 
  - name: Anger
    description: 
  - name: Depression
    description: 
  - name: Self-consciousness
    description: 
  - name: Immoderation
    description: 
  - name: Vulnerability
    description: 
  relationshipTraitDefinitions:
  - name: Affinity
    description: (Required)
  presets:
  - name: Monk
    description: 
    traits:
    - 60
    - 60
    - 55
    - 30
    - 10
    - 50
    - 25
    - 40
    - 15
    - 42
    - 45
    - 20
    - 25
    - 15
    - 5
    - 15
    - 5
    - 0
    - 0
    - -5
    - 15
    - 25
    - 35
    - 40
    - 10
    - 25
    - 50
    - 35
    - 15
    - -30
    - -30
    - 0
    - 20
    - 15
    - 10
  factions:
  - id: 12
    name: Monastery
    description: 
    color: 0
    parents: 
    traits:
    - 81.8
    - 56.4
    - 62.3
    - 12.7
    - 4.9
    - 55.5
    - 16.5
    - 44.8
    - 28.2
    - 41.8
    - 40.9
    - 7.5
    - 30.7
    - 21.2
    - -14.9
    - 26.7
    - 3.9
    - -13.3
    - -21.2
    - -31.5
    - 24.4
    - 37
    - 44.8
    - 45.6
    - 15.7
    - 33.8
    - 22
    - 40.9
    - 7.1
    - -76.3
    - -66.1
    - -78.7
    - 15.7
    - -67.6
    - -55.9
    relationships:
    - factionID: 13
      inheritable: 1
      traits:
      - 43
    - factionID: 1
      inheritable: 1
      traits:
      - 36.4
    - factionID: 2
      inheritable: 1
      traits:
      - 17.4
    - factionID: 3
      inheritable: 1
      traits:
      - 14.1
    - factionID: 4
      inheritable: 1
      traits:
      - 4.1
    - factionID: 8
      inheritable: 1
      traits:
      - 24
    - factionID: 9
      inheritable: 1
      traits:
      - 20.7
    - factionID: 10
      inheritable: 1
      traits:
      - -20.7
    - factionID: 11
      inheritable: 1
      traits:
      - 13.1
    percentJudgeParents: 0
  - id: 13
    name: Fishing Village
    description: 
    color: 2
    parents: 
    traits:
    - 22.8
    - -8.7
    - -14.2
    - 16.5
    - -42.5
    - 21.2
    - -6.3
    - 29.1
    - 33
    - 16.5
    - 27.5
    - -9.4
    - 22
    - 10.2
    - -3.9
    - -11.8
    - -9.4
    - 25.3
    - -22
    - -10.2
    - 9.4
    - -14.9
    - -6.3
    - 19.7
    - 14.2
    - 48
    - -22
    - -12.6
    - 14.9
    - 7.9
    - -6.3
    - 10.2
    - 18.1
    - 10.2
    - -13.4
    relationships:
    - factionID: 12
      inheritable: 1
      traits:
      - 46.3
    - factionID: 1
      inheritable: 1
      traits:
      - 24.8
    - factionID: 8
      inheritable: 1
      traits:
      - 14.9
    - factionID: 9
      inheritable: 1
      traits:
      - 7.4
    percentJudgeParents: 0
  - id: 1
    name: Green Council
    description: 
    color: 5
    parents: 
    traits:
    - -22
    - 43.3
    - 37
    - -12.6
    - 18.1
    - 47.2
    - 8.7
    - 40.1
    - 18.1
    - -15.7
    - 46.4
    - -11.8
    - 26.7
    - 15.7
    - -12.6
    - -16.5
    - -29.9
    - 44.8
    - 3.9
    - -26.7
    - 5.5
    - -11.8
    - -11.8
    - 26
    - 12.6
    - 29.9
    - -30.7
    - 9.4
    - 0
    - -19.7
    - 11
    - -14.2
    - -22.8
    - 26.7
    - -12.6
    relationships:
    - factionID: 12
      inheritable: 1
      traits:
      - 33.2
    - factionID: 13
      inheritable: 1
      traits:
      - 5.8
    - factionID: 2
      inheritable: 1
      traits:
      - 42.2
    - factionID: 3
      inheritable: 1
      traits:
      - 7.4
    - factionID: 4
      inheritable: 1
      traits:
      - 7.4
    - factionID: 8
      inheritable: 1
      traits:
      - 32.3
    - factionID: 9
      inheritable: 1
      traits:
      - 24.8
    - factionID: 10
      inheritable: 1
      traits:
      - -21.5
    - factionID: 11
      inheritable: 1
      traits:
      - 10.8
    percentJudgeParents: 0
  - id: 2
    name: Wildlanders
    description: 
    color: 10
    parents: 
    traits:
    - -14.9
    - -5.5
    - 11
    - 68.4
    - 47.2
    - -8.7
    - -12.6
    - -19.7
    - 35.4
    - -38.5
    - 12.6
    - -14.2
    - 14.2
    - 8.6
    - -33
    - -23.6
    - -36.2
    - 32.3
    - 32.3
    - -32.3
    - 16.5
    - -12.6
    - -63.7
    - -37.8
    - -10.2
    - 7.1
    - -48.8
    - -22.8
    - -55.9
    - 16.5
    - 24.4
    - -30.7
    - -48
    - 19.7
    - 9.4
    relationships:
    - factionID: 12
      inheritable: 1
      traits:
      - 19
    - factionID: 1
      inheritable: 1
      traits:
      - 38.9
    - factionID: 3
      inheritable: 1
      traits:
      - -13.2
    - factionID: 4
      inheritable: 1
      traits:
      - 8.3
    - factionID: 8
      inheritable: 1
      traits:
      - 33.1
    - factionID: 9
      inheritable: 1
      traits:
      - 24.8
    - factionID: 10
      inheritable: 1
      traits:
      - 24
    - factionID: 11
      inheritable: 1
      traits:
      - 31.4
    percentJudgeParents: 0
  - id: 3
    name: Lords of Earthly Fire
    description: 
    color: 3
    parents: 
    traits:
    - -39.3
    - -29.1
    - 17.3
    - 43.3
    - -28.3
    - 9.4
    - -24.4
    - 52.7
    - 40.9
    - 18.1
    - 40.1
    - -4.7
    - 24.4
    - 31.5
    - -37.8
    - -32.3
    - -36.2
    - 48.8
    - 11
    - -33.8
    - 12.6
    - -19.7
    - -40.1
    - 35.4
    - -38.5
    - 19.7
    - 21.2
    - -27.5
    - 0
    - -27.5
    - 34.6
    - -33
    - -19.7
    - 0
    - 14.2
    relationships:
    - factionID: 12
      inheritable: 1
      traits:
      - 9.9
    - factionID: 1
      inheritable: 1
      traits:
      - 0
    - factionID: 2
      inheritable: 1
      traits:
      - 5
    - factionID: 4
      inheritable: 1
      traits:
      - 28.1
    - factionID: 8
      inheritable: 1
      traits:
      - 15.7
    - factionID: 9
      inheritable: 1
      traits:
      - 4.1
    - factionID: 10
      inheritable: 1
      traits:
      - 24
    - factionID: 11
      inheritable: 1
      traits:
      - -14.9
    percentJudgeParents: 0
  - id: 4
    name: Underworld
    description: 
    color: 1
    parents: 
    traits:
    - -41.7
    - -9.4
    - 11
    - 24.4
    - -11.8
    - 29.1
    - -9.4
    - 18.9
    - 38.5
    - 19.7
    - 22.8
    - 3.9
    - 32.3
    - 19.7
    - -33
    - -15.7
    - -32.3
    - 44.1
    - 11.8
    - -15.7
    - 7.1
    - -16.5
    - -37.8
    - 35.4
    - 5.5
    - 24.4
    - -33.8
    - -18.9
    - 0
    - 12.6
    - 23.6
    - -18.1
    - -22.8
    - -16.5
    - -42.5
    relationships:
    - factionID: 12
      inheritable: 1
      traits:
      - 18.2
    - factionID: 1
      inheritable: 1
      traits:
      - 7.4
    - factionID: 2
      inheritable: 1
      traits:
      - 18.2
    - factionID: 3
      inheritable: 1
      traits:
      - 41.4
    - factionID: 8
      inheritable: 1
      traits:
      - 21.5
    - factionID: 9
      inheritable: 1
      traits:
      - -9.9
    - factionID: 10
      inheritable: 1
      traits:
      - 28.1
    percentJudgeParents: 0
  - id: 8
    name: Children of Gaia
    description: 
    color: 6
    parents: 
    traits:
    - 14.9
    - 4.7
    - 40.1
    - 30.7
    - 12.6
    - 0
    - 0
    - 49.6
    - 32.3
    - 20.5
    - 40.9
    - 4.7
    - 20.5
    - 20.5
    - -11
    - -8.7
    - 7.1
    - -6.3
    - 22
    - -18.9
    - 12.6
    - -10.2
    - 4.7
    - -16.5
    - 9.4
    - 11
    - 12.6
    - 18.1
    - -18.9
    - 15.7
    - 26.7
    - 13.4
    - -15.7
    - 12.6
    - 48
    relationships:
    - factionID: 12
      inheritable: 1
      traits:
      - 54.6
    - factionID: 13
      inheritable: 1
      traits:
      - 9.1
    - factionID: 1
      inheritable: 1
      traits:
      - 33.9
    - factionID: 2
      inheritable: 1
      traits:
      - 36.4
    - factionID: 3
      inheritable: 1
      traits:
      - 10.8
    - factionID: 4
      inheritable: 1
      traits:
      - 20.7
    - factionID: 9
      inheritable: 1
      traits:
      - 15.7
    - factionID: 10
      inheritable: 1
      traits:
      - 21.5
    - factionID: 11
      inheritable: 1
      traits:
      - 13.2
    percentJudgeParents: 0
  - id: 9
    name: Seelie Court
    description: 
    color: 4
    parents: 0e000000
    traits:
    - 18.9
    - 66.1
    - 50.3
    - 18.1
    - 41.7
    - 37.8
    - 11.8
    - 43.3
    - 39.3
    - -10.2
    - 33.8
    - 14.9
    - 22.8
    - 10.2
    - -7.1
    - 13.4
    - 8.7
    - 23.6
    - 29.1
    - 17.3
    - 26
    - 4.7
    - -11.8
    - 34.6
    - 27.5
    - 24.4
    - -7.9
    - -14.9
    - 3.9
    - 14.9
    - 17.3
    - -7.1
    - -8.7
    - 21.2
    - 15.7
    relationships:
    - factionID: 12
      inheritable: 1
      traits:
      - 47.2
    - factionID: 13
      inheritable: 1
      traits:
      - 18.2
    - factionID: 1
      inheritable: 1
      traits:
      - 26.5
    - factionID: 2
      inheritable: 1
      traits:
      - 23.2
    - factionID: 3
      inheritable: 1
      traits:
      - 8.3
    - factionID: 4
      inheritable: 1
      traits:
      - -8.3
    - factionID: 8
      inheritable: 1
      traits:
      - 28.1
    - factionID: 10
      inheritable: 1
      traits:
      - -45.5
    - factionID: 11
      inheritable: 1
      traits:
      - 14.9
    percentJudgeParents: 0
  - id: 21
    name: Seelie Guardian
    description: 
    color: 0
    parents: 09000000
    traits:
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    relationships: []
    percentJudgeParents: 10.7
  - id: 10
    name: Unseelie Court
    description: 
    color: 7
    parents: 0e000000
    traits:
    - -35.4
    - 60.6
    - 44.8
    - 38.5
    - 30.7
    - 30.7
    - -21.2
    - 19.7
    - 34.6
    - -14.9
    - 16.5
    - 22.8
    - 14.9
    - 22.8
    - -14.2
    - -22.8
    - 15.7
    - 36.2
    - 21.2
    - 26.7
    - 16.5
    - -20.5
    - -23.6
    - -9.4
    - -10.2
    - 16.5
    - -29.1
    - -16.5
    - 9.4
    - 15.7
    - 40.1
    - 7.1
    - -13.4
    - 21.2
    - 14.9
    relationships:
    - factionID: 12
      inheritable: 1
      traits:
      - -19.9
    - factionID: 1
      inheritable: 1
      traits:
      - -18.2
    - factionID: 2
      inheritable: 1
      traits:
      - 16.424988
    - factionID: 3
      inheritable: 1
      traits:
      - 29
    - factionID: 4
      inheritable: 1
      traits:
      - 24.8
    - factionID: 8
      inheritable: 1
      traits:
      - 21.5
    - factionID: 9
      inheritable: 1
      traits:
      - -63.7
    - factionID: 16
      inheritable: 1
      traits:
      - 9.436701
    - factionID: 11
      inheritable: 1
      traits:
      - 15.7
    percentJudgeParents: 10.7
  - id: 20
    name: Unseelie Guardian
    description: 
    color: 7
    parents: 0a000000
    traits:
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    relationships: []
    percentJudgeParents: 10.7
  - id: 11
    name: Winged Choir
    description: 
    color: 9
    parents: 
    traits:
    - 21.2
    - 33
    - 22
    - 26.7
    - 23.6
    - 8.7
    - -8.7
    - 7.1
    - 29.9
    - 4.7
    - 28.3
    - -8.7
    - 17.3
    - 25.2
    - 12.6
    - 18.9
    - 18.9
    - 25.2
    - 37.8
    - 22.8
    - 16.5
    - 12.6
    - 22.8
    - 0
    - 0
    - 11.8
    - 9.4
    - -11
    - 15.7
    - 21.2
    - 21.2
    - 7.9
    - -14.9
    - -8.7
    - 40.1
    relationships:
    - factionID: 12
      inheritable: 1
      traits:
      - 37.2
    - factionID: 1
      inheritable: 1
      traits:
      - 48
    - factionID: 2
      inheritable: 1
      traits:
      - 24.633566
    - factionID: 3
      inheritable: 1
      traits:
      - -14.1
    - factionID: 4
      inheritable: 1
      traits:
      - -16.5
    - factionID: 8
      inheritable: 1
      traits:
      - 24
    - factionID: 9
      inheritable: 1
      traits:
      - 19
    - factionID: 16
      inheritable: 1
      traits:
      - 23.9783
    - factionID: 10
      inheritable: 1
      traits:
      - 22.3
    percentJudgeParents: 10.7
  - id: 14
    name: The Sidhe
    description: 
    color: 0
    parents: 
    traits:
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    relationships: []
    percentJudgeParents: 10.7
  - id: 15
    name: The Guests
    description: 
    color: 0
    parents: 
    traits:
    - -34.4
    - 48.9
    - 39.7
    - 11.5
    - 42
    - 31.3
    - 2.3
    - -22.2
    - 19.1
    - -32.1
    - -16.8
    - 6.9
    - 35.1
    - -16
    - -3.1
    - 22.9
    - 3.1
    - 35.9
    - -12.2
    - -13
    - -35.9
    - -12.2
    - -23.7
    - -12.2
    - 7.6
    - -6.1
    - -15.3
    - -30.6
    - 13
    - -12.2
    - 14.5
    - -20.6
    - -8.4
    - 15.3
    - -13.8
    relationships:
    - factionID: 12
      inheritable: 1
      traits:
      - 5.9
    - factionID: 13
      inheritable: 1
      traits:
      - 24.9
    - factionID: 1
      inheritable: 1
      traits:
      - -16
    - factionID: 2
      inheritable: 1
      traits:
      - 6.7500424
    - factionID: 3
      inheritable: 1
      traits:
      - 32.1
    - factionID: 4
      inheritable: 1
      traits:
      - 14.4
    - factionID: 8
      inheritable: 1
      traits:
      - -14.4
    - factionID: 9
      inheritable: 1
      traits:
      - -7.2
    - factionID: 16
      inheritable: 1
      traits:
      - 1.828925
    - factionID: 10
      inheritable: 1
      traits:
      - -36.1
    - factionID: 11
      inheritable: 1
      traits:
      - 27.3
    - factionID: 14
      inheritable: 1
      traits:
      - 0
    percentJudgeParents: 10.7
  - id: 16
    name: Lady of the Flame
    description: 
    color: 0
    parents: 03000000
    traits:
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    relationships:
    - factionID: 12
      inheritable: 1
      traits:
      - 53
    percentJudgeParents: 10.7
  - id: 17
    name: The Alchemist
    description: 
    color: 0
    parents: 0c000000
    traits:
    - 60
    - 60
    - 55
    - 30
    - 10
    - 50
    - 25
    - 40
    - 15
    - 42
    - 45
    - 20
    - 25
    - 15
    - 5
    - 15
    - 5
    - 0
    - 0
    - -5
    - 15
    - 25
    - 35
    - 40
    - 10
    - 25
    - 50
    - 35
    - 15
    - -30
    - -30
    - 0
    - 20
    - 15
    - 10
    relationships: []
    percentJudgeParents: 10.7
  - id: 18
    name: The Maker
    description: 
    color: 0
    parents: 0c000000
    traits:
    - 60
    - 60
    - 55
    - 30
    - 10
    - 50
    - 25
    - 40
    - 15
    - 42
    - 45
    - 20
    - 25
    - 15
    - 5
    - 15
    - 5
    - 0
    - 0
    - -5
    - 15
    - 25
    - 35
    - 40
    - 10
    - 25
    - 50
    - 35
    - 15
    - -30
    - -30
    - 0
    - 20
    - 15
    - 10
    relationships: []
    percentJudgeParents: 10.7
  - id: 19
    name: The Lady of the Island
    description: 
    color: 0
    parents: 0900000001000000
    traits:
    - -1.55
    - 54.7
    - 43.65
    - 2.75
    - 29.9
    - 42.5
    - 10.25
    - 41.7
    - 28.7
    - -12.95
    - 40.1
    - 1.55
    - 24.75
    - 12.95
    - -9.85
    - -1.55
    - -10.6
    - 34.2
    - 16.5
    - -4.700001
    - 15.75
    - -3.55
    - -11.8
    - 30.3
    - 20.05
    - 27.15
    - -19.3
    - -2.75
    - 1.95
    - -2.400001
    - 14.15
    - -10.65
    - -15.75
    - 23.95
    - 1.55
    relationships:
    - factionID: 12
      inheritable: 1
      traits:
      - 45
    percentJudgeParents: 10.7
  traitInheritanceType: 0
  relationshipInheritanceType: 0
  nextID: 1
dancinggoat23
Posts: 29
Joined: Mon Mar 02, 2020 1:44 pm

Re: Faction ID's getting scrambled

Post by dancinggoat23 »

Further digging into the code and debugging reveals that the array index correlates with the incorrect factions. That is, when I look at the factions[] array in the database in memory, I see that the factions at indices 1 & 9 (which correlate with the faction IDs for the parents of the "Lady of the Island") those are the indices for the "Fishing Village" and the "Unseelie Court", both of which are found when exporting the database and, presumably, when using it at runtime. So I'm picking through to see if there is code that is using the array index by mistake rather than the faction ID. Haven't found it yet...
dancinggoat23
Posts: 29
Joined: Mon Mar 02, 2020 1:44 pm

Re: Faction ID's getting scrambled

Post by dancinggoat23 »

Found one of the issues, I believe. In FactionDatabaseImportExportCSVWindow.cs on line 267, the parent ID is used as an index in the factions array, rather than performing a search for the matching faction key:

Code: Select all

                    for (int j = 0; j < faction.parents.Length; j++)
                    {
                        row.Add(db.factions[faction.parents[j]].name);
                    }
I believe it *should* be:

Code: Select all

                    for (int j = 0; j < faction.parents.Length; j++)
                    {
                        row.Add(db.GetFaction(faction.parents[j]).name);
                    }
or something of the sort.

Continuing to dig...
User avatar
Tony Li
Posts: 22098
Joined: Thu Jul 18, 2013 1:27 pm

Re: Faction ID's getting scrambled

Post by Tony Li »

Hi,

Thanks for providing the detailed analysis. Yes, that certainly appears to be a bug with the CSV export. I'm sorry about the bug. I hope you can straighten out the mixed IDs in the CSV file and import a corrected version back into your faction database. I'll post a patch fix by end of day tomorrow.
dancinggoat23
Posts: 29
Joined: Mon Mar 02, 2020 1:44 pm

Re: Faction ID's getting scrambled

Post by dancinggoat23 »

Thanks! Glad I can help! No worries; these things happen. I think there might be another one lurking somewhere in the deserializer, as when I load a character with a Faction Member component, the in-memory representation has an incorrect faction object in the faction field, though the faction ID field on the GameObject is correct. I never used the exporter before today (for debugging), so I think it’s unlikely that the bug I found also loads the incorrect faction data in the GameObject... but I could be wrong.

Cheers
Dave
dancinggoat23
Posts: 29
Joined: Mon Mar 02, 2020 1:44 pm

Re: Faction ID's getting scrambled

Post by dancinggoat23 »

After fixing the code in my local setup, I believe all my remaining problems stemmed from the ridiculous fact that I was loading a saved game with the bad data. Argh. Once I dumped the saved game, things appeared to work perfectly well. I'll let you know if I see any other issues...

Thanks!
User avatar
Tony Li
Posts: 22098
Joined: Thu Jul 18, 2013 1:27 pm

Re: Faction ID's getting scrambled

Post by Tony Li »

Hi,

This patch contains the changes that will be in the next update. I only made a fix similar to what you proposed in your post above (with some extra error checking) and a trivial change to the Import tab's "Name (#)" field, changing it to Name Column (#)" to help remind users how those fields work.

LH_CSVExportPatch_2020-09-27.unitypackage
Post Reply