Skip to content

Commit

Permalink
Seed random before selecting quest
Browse files Browse the repository at this point in the history
Reseeds random state using current frame count before selecting a random quest. This should be a fairly low-impact change that helps ensure a good variety of avilable quests and a better distribution of target resources inside quest.
Intended to resolve: https://forums.dfworkshop.net/viewtopic.php?f=24&t=2186
  • Loading branch information
Interkarma committed Jun 24, 2019
1 parent 757cf3f commit 510d167
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Assets/Scripts/Game/Questing/QuestListsManager.cs
Expand Up @@ -351,6 +351,9 @@ public Quest GetSocialQuest(FactionFile.SocialGroups socialGroup, int factionId,

private Quest SelectQuest(List<QuestData> pool, int factionId)
{
// Seed random
UnityEngine.Random.InitState(Time.frameCount);

Debug.Log("Quest pool has " + pool.Count);
// Choose random quest from pool and try to parse it
if (pool.Count > 0)
Expand Down

0 comments on commit 510d167

Please sign in to comment.