TAS Instruction

TASVideos supports CoffeeTools, a TAS tool for UFO 50, for submissions and UserFiles. Refer to the link for more information.

General Information

RNG

Although CoffeeTools displays the seed value in floating point, the actual value used for computation is converted to an integer (TODO: probably truncated, needs checking). The seed never goes above 10,000,000 (TODO: what is the tight bound?).
The mechanism, as well as interval random and shuffling, is described in the following port in Rust:
pub struct Rng {
    s1: u64,
    s2: u64,
}

impl Rng {
    pub fn new(seed: u64) -> Self {
        let mask = 1431655765;
        let s1 = 1253089769 ^ (seed & mask);
        let s2 = 2342871706 ^ (seed & !mask);
        let mut rng = Rng { s1, s2 };
        // When the RNG gets a new seed, it's immediately rolled 20 times for some reason.
        for _ in 0..20 {
            rng.roll();
        }
        rng
    }

    pub fn roll(&mut self) -> u64 {
        self.s1 = (65192 * (self.s1 & 65535)) + ((self.s1 & 4294901760) >> 16);
        self.s2 = (64473 * (self.s2 & 65535)) + ((self.s2 & 4294901760) >> 16);
        (((self.s1 & 65535) << 16) + self.s2) & 4294967295
    }

    pub fn roll_int(&mut self, l: u64, r: u64) -> u64 {
        let val = self.roll();
        let numerator = (r - l + 1) * val;
        l + numerator / 4294967296
    }

    pub fn shuffle<T>(&mut self, vals: &mut [T]) {
        let mut i = vals.len();
        while i > 1 {
            i -= 1;
            let j = self.roll_int(0, i as u64) as usize;
            vals.swap(i, j);
        }
    }
}

Individual Game Resources

See below for individual games.
Expand/Collapse collapse-content-_f7d952bd0aab4dfc90fb485bb83ec362

GameResources/PC/UFO50 last edited by feos 13 days ago
Page History Latest diff List referrers View Source