2 ms·
Spoiler: Rogue just implements its own Linear Congruential Generator. #define RN (((seed = seed*11109+13849) & 0x7fff) >> 1) I've poked around in a couple
by suprjami 2mo ago
Spoiler: Rogue just implements its own Linear Congruential Generator.
#define RN (((seed = seed*11109+13849) & 0x7fff) >> 1)
I've poked around in a couple of libraries from this time. At least QuickBasic and QuickC also implemented an LCG (not the same one either). So a 1980s PRNG from Microsoft just gave you an LCG with different constants.
I would not be surprised if other contemporaries like glibc, Borland, Watcom, Lattice, etc all did the same. Or did they do something else/better?
- avadodin 2mo agoThank you. I think the algorithm used and the seeding method are very relevant in procedurally generated games like Rogue, Elite and Minecraft so I was disappointed when the author just used Random(). And yes I could have read the code or remembered a previous time whence I might have learnt the same bit of information but instead I read the article.