      */
     public function setSeed (seed :uint) :void
     {
-        seed = uint(seed ^ multiplier);
+        x[0] = seed;
+        for (var i :int = 1; i < N; i++) {
+            x[i] = imul(1812433253, x[i - 1] ^ (x[i - 1] >>> 30)) + i;
+            x[i] &= 0xffffffff;
+        }
+        p = 0;
+        q = 1;
+        r = M;
     }
 
     /**


        if (n == 0) return int(next(32));

        var bits :int, val :int;
        do {
            bits = int(next(31));

package com.threerings.util
{

/**
 * A seedable pseudorandom generator of the Mersenne Twister variety, with an extremely
 * long period. Note that this is not a cryptographically sound generator.
 * This implementation is based on one found at --
 *    http://onegame.bona.jp/tips/mersennetwister.html
 * An explanation of the algorithm can be found at --
 *    http://en.wikipedia.org/wiki/Mersenne_twister
 */
public class Random
{
    /**
