Skip to content

Evolutionary tree can stop working due to "World history is out of order" #6032

Open
@hhyyrylainen

Description

@hhyyrylainen

We got a report that the evolutionary tree can fail in this way:

ERROR: World history is out of order, expected generation 13 but got 14
ERROR: Evolutionary tree failed to build with error: System.Collections.Generic.KeyNotFoundException: The given key '13' was not present in the dictionary.
ERROR:    at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
ERROR:    at AutoEvo.GenerationRecord.GetFullSpeciesRecord(UInt32 speciesID, Int32 currentGeneration, Dictionary`2 generationHistory) in /home/hhyyrylainen/Projects/Thrive/src/auto-evo/records/GenerationRecord.cs:line 48
ERROR:    at GameWorld.<>c__DisplayClass64_0.<BuildEvolutionaryTree>b__1(KeyValuePair`2 s) in /home/hhyyrylainen/Projects/Thrive/src/general/GameWorld.cs:line 919
ERROR:    at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
ERROR:    at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector)
ERROR:    at GameWorld.BuildEvolutionaryTree(EvolutionaryTree tree) in /home/hhyyrylainen/Projects/Thrive/src/general/GameWorld.cs:line 918
ERROR:    at ThriveopediaEvolutionaryTreePage.RebuildTree() in /home/hhyyrylainen/Projects/Thrive/src/thriveopedia/pages/ThriveopediaEvolutionaryTreePage.cs:line 97

To me this looks like a problem in some code that updates the generation history and that in turn then surfaces as an error with the evolutionary tree not working.

The symptom of this should now just be (with a workaround):

Generation history is missing a generation, this shouldn't happen. Skipping generation 13 while looking for full record of species 193
Generation history is missing a generation, this shouldn't happen. Skipping generation 13 while looking for full record of species 165
Generation history is missing a generation, this shouldn't happen. Skipping generation 13 while looking for full record of species 110
Generation history is missing a generation, this shouldn't happen. Skipping generation 13 while looking for full record of species 186
Generation history is missing a generation, this shouldn't happen. Skipping generation 13 while looking for full record of species 199
Generation history is missing a generation, this shouldn't happen. Skipping generation 13 while looking for full record of species 77
Generation history is missing a generation, this shouldn't happen. Skipping generation 13 while looking for full record of species 163
Generation history is missing a generation, this shouldn't happen. Skipping generation 13 while looking for full record of species 174

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    Low priority bugs / issues

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions