I saw once that I had twice the same soldier. They were total clones : Same name, identical stats. A glitch in the matrix, I guess.
Check if the twins have the same stats.
I saw once that I had twice the same soldier. They were total clones : Same name, identical stats. A glitch in the matrix, I guess.That's a side-effect of pseudo-random-number-generators. The same seed will produce the same sequence of numbers. So if you happen to get the exact same seed twice (which is pretty unlikely but not impossible), then all the soldier stats will be the same.
They have the exact same original stats. Which means, in effect, that I can recognize good and bad soldiers from their names.Yes? You can also do it by just looking at their soldier stats. :P
That is not good.
That's a side-effect of pseudo-random-number-generators. The same seed will produce the same sequence of numbers. So if you happen to get the exact same seed twice (which is pretty unlikely but not impossible), then all the soldier stats will be the same.As long as it doesn't stray into a Minecraft-like procedural generation (https://en.wikipedia.org/wiki/Procedural_generation) type game it shouldn't matter. Minecraft needs to be procedurally generated, OpenXcom needs to be surprisingly random.
Yes? You can also do it by just looking at their soldier stats. :POf course, but not all soldier stats are available early in the game, like the psi stats. I don't want to recognize the strength and weaknesses of individual soldiers right off the bat, just because I've seen his/her name before. It takes away some of the replay value. The unknown and unexpected is a major point of this game.
I ran a quick test and out of 1000 generated soldiers, only 5 were duplicate.There are only 484 different male Arabian names, for example, so it would be normal to get name dplicates sometimes.
#include "RNG.h"
#include <stdio.h>
int main(int argc, char** argv)
{
OpenXcom::RNG::setSeed(1000);
printf("%d\n", OpenXcom::RNG::generate(0,99999));
printf("%d\n", OpenXcom::RNG::generate(0,99999));
printf("%d\n", OpenXcom::RNG::generate(0,99999));
printf("%d\n", OpenXcom::RNG::generate(0,99999));
printf("%d\n", OpenXcom::RNG::generate(0,99999));
printf("%d\n", OpenXcom::RNG::generate(0,99999));
printf("------------\n");
OpenXcom::RNG::setSeed(1000);
printf("%d\n", OpenXcom::RNG::generate(0,99999));
printf("%d\n", OpenXcom::RNG::generate(0,99999));
printf("%d\n", OpenXcom::RNG::generate(0,99999));
OpenXcom::RNG::setSeed(OpenXcom::RNG::getSeed());
printf("%d\n", OpenXcom::RNG::generate(0,99999));
printf("%d\n", OpenXcom::RNG::generate(0,99999));
printf("%d\n", OpenXcom::RNG::generate(0,99999));
return 0;
}
This is supposed to produce 2 times the same series of 6 numbers.edit: gahh! Can't believe I didn't see it before : getSeed() returns the original seed (ie 1000 in my case) In order to actually save and restore the RNG state, the entire mt[] array should be stored in the save game, ie 2496 byte :(
The following 64-bit generator with 64 bits of state has a maximal period of 264 − 1 and fails only the MatrixRank test of BigCrush:
#include <stdint.h>
uint64_t x; /* The state must be seeded with a nonzero value. */
uint64_t next() {
x ^= x >> 12; https:// a
x ^= x << 25; https:// b
x ^= x >> 27; https:// c
return x * 2685821657736338717LL;
}