The function number: #1231
The complete error text: "Function #1231: an item with the same key has already been added."
The window affected: Class Designer
What you were doing at the time: creating ship classes via the class template feature
Conventional or TN start: TN
Random or Real Stars: Real Stars
Is your decimal separator a comma?: No
Is the bug is easy to reproduce, intermittent or a one-off?: inconsistent, yet frequent and easily reproduced
Length of the campaign: below 25 years - reduced research rate
When creating ship classes from class templates created in another game, several errors occur upon reload:
I. The capacity of civilian jump drives is always increased by a factor of 5.
II. For weapons with fractional capacitor recharge rates, the recharge rates are rounded.
III. Sometimes after creating a class from a template, when saving and loading, the error message ‘Function #1231: An item with the same key has already been added’ is displayed, and one or more of the ship classes created from ship templates no longer contain any components other than armour and crew quarters.
This occurs randomly, but can be provoked when many ship classes are created from templates at the same time.
This does not seem to be related to specific ship templates, and repeated attempts to create, save, and load a ship class from a class template to check for errors, as well as the use of backup copies, eventually lead to success in creating a ship class without the error occurring.
IV. In rare cases, a ship created from a class template has additional components from another class that was also created from a class template, while the other class contains no components except armour and crew quarters and no error messages are displayed.
DB is attached. To reproduce the mentioned bugs, simply create one or more ship classes via templates in the class design window, save and load. Though I have only encountered the fourth case two times in hundreds of attempts.