Moderator: OpenTTD Developers
Im playing around with the town name generator, trying to add spport for real danish town names. I have got it to work, but i do not understand the SeedChance function entirely.
The syntax could be like this:
SeedChance(0, 15, seed);
This should generate a random number between 0 and 15 from the unique town seed. But i dont understand what this does:
SeedChance(5, 15, seed); ? What difference does it make to use for example 5 instead of zero in the shift_by variable?
In specific, the town names are generated from a 32 bit seed, and the SeedChance function picks out 16 bits offset by shift_by from that 32 bit number, then scales it into the range given by the max parameter. So you have only two strictly entirely uncorrelated values possible from the seed (shift 0 and 16), but in practice you have more, depending on the max given. On the other hand, it's difficult to exploit the lower 12 or so bits of the seed value using just the SeedChance function.
Users browsing this forum: Bing [Bot] and 13 guests