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 11, 2020
1 parent fc667bd commit 74182fb
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.previousRandom = 0;

this._currentChoices = [];
Expand Down

0 comments on commit 74182fb

Please sign in to comment.