Skip to content

Commit

Permalink
Improve storySeed initialisation
Browse files Browse the repository at this point in the history
The storySeed no longer goes through the PRNG on init, and takes the
timestamp directly.

It also no longer uses modulo 100, which should give more variety.
  • Loading branch information
PiOverFour committed Jun 12, 2020
1 parent e8b7e1f commit 16d6046
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/engine/StoryState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,8 @@ export class StoryState{
this._turnIndices = new Map();
this.currentTurnIndex = -1;

let timeSeed = (new Date()).getTime();
this.storySeed = (new PRNG(timeSeed)).next() % 100;
let timeSeed = Date.now();
this.storySeed = timeSeed;
this.PRNG = new PRNG(timeSeed);

this._currentChoices = [];
Expand Down

0 comments on commit 16d6046

Please sign in to comment.