Dev build/Linux: modded loot piles all contain the same items [RESOLVED]
- pango
- Posts: 3358
- Joined: Wed Jul 18, 2018 6:14 pm
- Location: France
- Contact:
Dev build/Linux: modded loot piles all contain the same items [RESOLVED]
Testing AlexanderSig's recent modded lootpiles, I noticed two things:
- the mod can only change the look of newly created lootpiles. If is enable it while in a dungeon, you'll have to exit and enter the dungeon again (or another dungeon) to start seeing modded lootpiles;
- more importantly all modded lootpiles have the same content: Gamesave near the entrance of a random dungeon. A lootpile is easily reachable by following the left hand wall.
- the mod can only change the look of newly created lootpiles. If is enable it while in a dungeon, you'll have to exit and enter the dungeon again (or another dungeon) to start seeing modded lootpiles;
- more importantly all modded lootpiles have the same content: Gamesave near the entrance of a random dungeon. A lootpile is easily reachable by following the left hand wall.
- Attachments
-
- SAVE1.zip
- (422.68 KiB) Downloaded 110 times
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart
- Interkarma
- Posts: 7245
- Joined: Sun Mar 22, 2015 1:51 am
Re: Dev build/Linux: modded loot piles all contain the same items
Thanks for report. It's likely the random loot seed is being cleared when loot pile is replaced by asset injection. So every replacement ends up with the same seed and randomly generated loot within.
- pango
- Posts: 3358
- Joined: Wed Jul 18, 2018 6:14 pm
- Location: France
- Contact:
Re: Dev build/Linux: modded loot piles all contain the same items
Yes, I suspect that much too.
By the way, I later had a different lootpiles content (not sure when/why it changed), but again all the modded lootpiles of the dungeon were identical.
By the way, I later had a different lootpiles content (not sure when/why it changed), but again all the modded lootpiles of the dungeon were identical.
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart
- TheLacus
- Posts: 1305
- Joined: Wed Sep 14, 2016 6:22 pm
Re: Dev build/Linux: modded loot piles all contain the same items
I can't reproduce this issue. The save you provided has a bad positioned loot, maybe this is why you don't see it.
- TheLacus
- Posts: 1305
- Joined: Wed Sep 14, 2016 6:22 pm
Re: Dev build/Linux: modded loot piles all contain the same items
I don't think loot content is affected in any way, but i might not have experienced the bug because i currently can't find many loot treasures replaced by AlexanderSig's mod in any dungeon. I noticed your save was made with Persistent Dungeon mod enabled, did you try without it?
- pango
- Posts: 3358
- Joined: Wed Jul 18, 2018 6:14 pm
- Location: France
- Contact:
Re: Dev build/Linux: modded loot piles all contain the same items
My main hypothesis, like Interkarma, is that the mod somehow resets the random seed between each pile creation, and indirectly removes randomness. Second one would be some kind of aliasing (I click on different piles but I'm always presented with the content of the same one), but removing items from one doesn't affect the others, so this is less likely.
It was installed but not enabled, does that count?
In any case, I reinstalled with only the handpainted mod, then created two saves, one with the mod enabled (212), the other with the mod disabled (211).
Each time I reloaded SAVE1 from above, entered the dungeon, and I saved in one of those treasure-trap rooms surrounded by doors that open when you loot the triggering pile.
- Attachments
-
- SAVE212.zip
- (341 KiB) Downloaded 97 times
-
- SAVE211.zip
- (330.69 KiB) Downloaded 95 times
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart
- TheLacus
- Posts: 1305
- Joined: Wed Sep 14, 2016 6:22 pm
Re: Dev build/Linux: modded loot piles all contain the same items
Thank you for the save, now i see. When a treasure is deserialized, is first assigned to a random record id. Corresponding custom model is instantiated if available and billboard is removed, otherwise billboard material is set.pango wrote: ↑Sun Apr 14, 2019 3:24 pmIt was installed but not enabled, does that count?
In any case, I reinstalled with only the handpainted mod, then created two saves, one with the mod enabled (212), the other with the mod disabled (211).
Each time I reloaded SAVE1 from above, entered the dungeon, and I saved in one of those treasure-trap rooms surrounded by doors that open when you loot the triggering pile.
Screenshot.jpg
Code: Select all
DaggerfallLoot customLootContainer = GameObjectHelper.CreateDroppedLootContainer(GameManager.Instance.PlayerObject, key);
Code: Select all
serializableLootContainer.RestoreSaveData(lootContainers[i]);
- pango
- Posts: 3358
- Joined: Wed Jul 18, 2018 6:14 pm
- Location: France
- Contact:
Re: Dev build/Linux: modded loot piles all contain the same items
I watched Jinarra stream Daggerfall Unity 0.7.146 (modded: DREAM, Convenient Clock, Enhanced Sky, Handpainted Models, Remove Spiders, Loading Screens), he's been doing quests for some temple, taking some loot off the floor each time he came back to the temple.
He temporarily disabled "Handpainted models - Treasures" since I told him in a previous stream that that was the cause for the loot issue he noticed, but it seems the problem is not gone:
6 gold pieces, 2 holy daggers and 1 holy water:
https://www.twitch.tv/videos/434766801?t=00h09m52s
https://www.twitch.tv/videos/434766801?t=00h16m05s
https://www.twitch.tv/videos/434766801?t=00h35m49s
https://www.twitch.tv/videos/435177404?t=00h05m48s
So either it's having any model replacement enabled that triggers the issue, or they're several root causes...
He temporarily disabled "Handpainted models - Treasures" since I told him in a previous stream that that was the cause for the loot issue he noticed, but it seems the problem is not gone:
6 gold pieces, 2 holy daggers and 1 holy water:
https://www.twitch.tv/videos/434766801?t=00h09m52s
https://www.twitch.tv/videos/434766801?t=00h16m05s
https://www.twitch.tv/videos/434766801?t=00h35m49s
https://www.twitch.tv/videos/435177404?t=00h05m48s
So either it's having any model replacement enabled that triggers the issue, or they're several root causes...
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart
- Interkarma
- Posts: 7245
- Joined: Sun Mar 22, 2015 1:51 am
Re: Dev build/Linux: modded loot piles all contain the same items
I'd love to take a looks at this soon. Going through some other stuff right now that's burning a lot of time and energy. Will try to have this sorted as part of June release.
- pango
- Posts: 3358
- Joined: Wed Jul 18, 2018 6:14 pm
- Location: France
- Contact:
Re: Dev build/Linux: modded loot piles all contain the same items
Any models replacement mod triggers the bug.
As you suspected, the problem is MeshReplacement.ImportCustomFlatGameobject() resetting the random seed.
As you suspected, the problem is MeshReplacement.ImportCustomFlatGameobject() resetting the random seed.
Code: Select all
diff --git a/Assets/Scripts/Utility/AssetInjection/MeshReplacement.cs b/Assets/Scripts/Utility/AssetInjection/MeshReplacement.cs
index 2c43e4c6..5a2be103 100644
--- a/Assets/Scripts/Utility/AssetInjection/MeshReplacement.cs
+++ b/Assets/Scripts/Utility/AssetInjection/MeshReplacement.cs
@@ -117,8 +117,10 @@ namespace DaggerfallWorkshop.Utility.AssetInjection
var iObjectPositioner = go.GetComponent<IObjectPositioner>();
if (iObjectPositioner == null || iObjectPositioner.AllowFlatRotation)
{
+ Random.State oldState = Random.state;
Random.InitState((int)position.x);
go.transform.Rotate(0, Random.Range(0f, 360f), 0);
+ Random.state = oldState;
}
// Add NPC trigger collider
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart