So far this happens only after loading a prior dungeon save. When looting a body, any item (other than gold) clicked on throws a duplicate item UID error. The item is also destroyed at the time.
Exiting and re-entering dungeon appears to solve this, as does starting a new game. I've attached a save to reproduce. Hack away at some enemies and loot their bodies afterwards.
Not sure if this is related to changes in item lists, or has been present for a while. Going to back-test against some older versions to see if this is a regression or not.
Edit: Can confirm problem exists in older builds. Treating this as my issue and will look into this when I can.
81 - Duplicate Item UID [resolved]
- Interkarma
- Posts: 7247
- Joined: Sun Mar 22, 2015 1:51 am
81 - Duplicate Item UID [resolved]
- Attachments
-
- SAVE89.zip
- (74.73 KiB) Downloaded 152 times
- Midknightprince
- Posts: 1324
- Joined: Fri Aug 11, 2017 6:51 am
- Location: San Antonio TX
- Contact:
Re: (Live Code) - Duplicate Item UID
@Interkarma
Yeah, this happend to me.
I thought I was imagining things .
You're awesome dude
Yeah, this happend to me.
I thought I was imagining things .
You're awesome dude
Check out my YouTube Channel!
-
- Posts: 379
- Joined: Fri Oct 07, 2016 10:41 am
Re: (Live Code) - Duplicate Item UID
Looks like the problem has existed since my implementation of enemy equipment (commit bf6b282).
In the save game I'm testing, the duplicate uIDs of the equipment from the enemy are the same as the uIDs of magic items in the player character's inventory. Does that bring anything to mind Interkarma? Why does the item collection for the loot container of the corpse have the uIDs of the player's inventory in it, I wonder. Should uIDs be unique globally or just within a single item collection?
In the save game I'm testing, the duplicate uIDs of the equipment from the enemy are the same as the uIDs of magic items in the player character's inventory. Does that bring anything to mind Interkarma? Why does the item collection for the loot container of the corpse have the uIDs of the player's inventory in it, I wonder. Should uIDs be unique globally or just within a single item collection?
-
- Posts: 379
- Joined: Fri Oct 07, 2016 10:41 am
Re: (Live Code) - Duplicate Item UID
The problem seems to only happen on the first game loaded after starting DF Unity. If you load the save after loading another save, or load the same save twice, the problem doesn't happen.
- Interkarma
- Posts: 7247
- Joined: Sun Mar 22, 2015 1:51 am
Re: (Live Code) - Duplicate Item UID
UIDs should be globally unique. The only way to obtain a UID also increments to the next UID automatically, and the current UID position is saved with the player's game.
This error happens only when saving inside a dungeon then loading that save again. It doesn't happen if you do a full dungeon clear within a single session (i.e. after entering dungeon from outside). My feeling is the enemy equipment might not be serialized/deserialized properly, causing it to pick up a bad UID on load somehow. I'm about to hit the sack in the next 30 minutes or so, feeling a bit tired to chase this down further tonight. I'll take another look after work tomorrow.
Thank you for locating the commit where problem started.
This error happens only when saving inside a dungeon then loading that save again. It doesn't happen if you do a full dungeon clear within a single session (i.e. after entering dungeon from outside). My feeling is the enemy equipment might not be serialized/deserialized properly, causing it to pick up a bad UID on load somehow. I'm about to hit the sack in the next 30 minutes or so, feeling a bit tired to chase this down further tonight. I'll take another look after work tomorrow.
Thank you for locating the commit where problem started.
- Interkarma
- Posts: 7247
- Joined: Sun Mar 22, 2015 1:51 am
Re: (Live Code) - Duplicate Item UID
OK this should be fixed now in live code. There were two main problems:
I've also changed enemy saving so they are always saved. This is first part of a larger fix for enemies respawning on load and duplicate loadIDs.
- Enemy's own loot was being equipped but the DaggerfallUnityItem was not added to their item collection. While the equip table stores items at runtime, it's just serialized as a list of UIDs into loot collection. I've fixed this now so enemy's personal loot is added to their loot collection, which automatically transfers to corpse loot container on death (no need for any extra handling for this).
- Second issue was that enemy loot collection and equip table was not being serialized. I've made sure this is done now.
I've also changed enemy saving so they are always saved. This is first part of a larger fix for enemies respawning on load and duplicate loadIDs.