Gradual Reduction in MF Effectiveness
#64
For those wondering how the game gets the initial seed (unless you use the -seed command) here it is:

SeedLo = abs( (QueryPerformanceCounter + SecondsSince1900 + 0x7c558180 + GetTickCount) * 0x2f490a95 - 0x2e330917)
SeedHi = 0x000000029a

The above is calculated with 32 bit signed calcs.

GetTickCount is the call to the windows kernel and returns the number of milliseconds since boot up of the computer if I am not mistake.

QueryPerformanceCounter is the call to the windows kernel and returns a value that is updated with the frequency given by QueryPerformanceFrequency and is systemdependant, it should be with higher precision than miliseconds I would say.

The Starting map seed (which with the -seed command will be the same as the intial game seed) comes from the initial game seed, as calculated above but instead of the QueryPerformanceCounter, the “next” SeedLo is used as the first parameter in the above formula.

When you load a single player command, the starting map seed will be set to the one saved with the character, which is the starting map seed from the game were the character was last played. So, using the -seed command and then exiting the game and then starting a new game, will give you the specific starting map seed but will have the initial game seed for other things to be random.

The next seed is calculated as follow:

Seed64 = SeedLo * 0x6ac690c5 + SeedHi

SeedLo = the lower 32 bits of Seed64
SeedHi = the upper 32 bits of Seed64

If a random value is also to be calculated, it will be calculated as follow:

Rnd[X] = SeedLo mod X


When the game initializes a new seed stream, for a new unit for example, it will update the current game seed (as shown above), and set that new seed such as:

SeedLo = SeedLo (from game after update)
SeedHi = 0x000000029a


This new stream of seeds will thus not be the same as the ongoing game ones since the SeedHi will be different.

Hope this is of any interest to someone.
There are three types of people in the world. Those who can count and those who can't.
Reply


Messages In This Thread
Gradual Reduction in MF Effectiveness - by Samka - 02-18-2004, 01:05 AM
Gradual Reduction in MF Effectiveness - by Samka - 02-18-2004, 08:11 AM
Gradual Reduction in MF Effectiveness - by Vash - 02-18-2004, 08:43 AM
Gradual Reduction in MF Effectiveness - by Jarulf - 02-18-2004, 09:52 AM
Gradual Reduction in MF Effectiveness - by lfd - 02-18-2004, 01:18 PM
Gradual Reduction in MF Effectiveness - by Vash - 02-18-2004, 03:57 PM
Gradual Reduction in MF Effectiveness - by rriggs - 02-18-2004, 04:30 PM
Gradual Reduction in MF Effectiveness - by jahcs - 02-18-2004, 09:19 PM
Gradual Reduction in MF Effectiveness - by Taem - 02-18-2004, 10:57 PM
Gradual Reduction in MF Effectiveness - by Samka - 02-18-2004, 11:36 PM
Gradual Reduction in MF Effectiveness - by Taem - 02-19-2004, 04:48 AM
Gradual Reduction in MF Effectiveness - by Samka - 02-19-2004, 05:42 AM
Gradual Reduction in MF Effectiveness - by Vash - 02-19-2004, 05:45 AM
Gradual Reduction in MF Effectiveness - by Taem - 02-19-2004, 07:55 AM
Gradual Reduction in MF Effectiveness - by Vash - 02-19-2004, 01:54 PM
Gradual Reduction in MF Effectiveness - by Jarulf - 02-19-2004, 02:43 PM
Gradual Reduction in MF Effectiveness - by Raziel - 02-19-2004, 02:46 PM
Gradual Reduction in MF Effectiveness - by adeyke - 02-19-2004, 02:48 PM
Gradual Reduction in MF Effectiveness - by Jarulf - 02-19-2004, 02:51 PM
Gradual Reduction in MF Effectiveness - by Jarulf - 02-19-2004, 03:52 PM
Gradual Reduction in MF Effectiveness - by Taem - 02-19-2004, 11:00 PM
Gradual Reduction in MF Effectiveness - by Samka - 02-20-2004, 06:56 PM
Gradual Reduction in MF Effectiveness - by Raziel - 02-20-2004, 08:36 PM
Gradual Reduction in MF Effectiveness - by Jarulf - 02-21-2004, 08:23 AM
Gradual Reduction in MF Effectiveness - by Samka - 02-21-2004, 07:32 PM
Gradual Reduction in MF Effectiveness - by Samka - 02-22-2004, 06:31 AM
Gradual Reduction in MF Effectiveness - by Jarulf - 02-22-2004, 08:34 AM
Gradual Reduction in MF Effectiveness - by Jarulf - 02-22-2004, 08:48 AM
Gradual Reduction in MF Effectiveness - by Jarulf - 02-22-2004, 05:59 PM
Gradual Reduction in MF Effectiveness - by Jarulf - 02-23-2004, 07:21 AM
Gradual Reduction in MF Effectiveness - by Taem - 02-23-2004, 07:49 AM
Gradual Reduction in MF Effectiveness - by Vash - 02-23-2004, 08:15 AM
Gradual Reduction in MF Effectiveness - by Jarulf - 02-23-2004, 11:03 AM
Gradual Reduction in MF Effectiveness - by Samka - 02-23-2004, 11:20 AM
Gradual Reduction in MF Effectiveness - by BOB2 - 02-23-2004, 12:22 PM
Gradual Reduction in MF Effectiveness - by Jarulf - 02-23-2004, 01:01 PM
Gradual Reduction in MF Effectiveness - by Raziel - 02-23-2004, 01:58 PM
Gradual Reduction in MF Effectiveness - by gekko - 02-23-2004, 03:59 PM
Gradual Reduction in MF Effectiveness - by Taem - 02-24-2004, 12:52 AM
Gradual Reduction in MF Effectiveness - by Taem - 02-24-2004, 01:06 AM
Gradual Reduction in MF Effectiveness - by Jarulf - 02-24-2004, 06:29 AM
Gradual Reduction in MF Effectiveness - by Jarulf - 02-24-2004, 07:58 AM
Gradual Reduction in MF Effectiveness - by Jarulf - 02-25-2004, 06:24 AM
Gradual Reduction in MF Effectiveness - by Jarulf - 02-25-2004, 09:26 AM
Gradual Reduction in MF Effectiveness - by gekko - 02-25-2004, 03:04 PM
Gradual Reduction in MF Effectiveness - by Jeger - 02-25-2004, 03:15 PM
Gradual Reduction in MF Effectiveness - by adeyke - 02-25-2004, 03:31 PM
Gradual Reduction in MF Effectiveness - by Jeger - 02-25-2004, 11:43 PM
Gradual Reduction in MF Effectiveness - by Jeger - 02-26-2004, 12:14 AM
Gradual Reduction in MF Effectiveness - by Jeger - 02-26-2004, 01:15 AM
Gradual Reduction in MF Effectiveness - by adeyke - 02-26-2004, 02:08 AM
Gradual Reduction in MF Effectiveness - by Jeger - 02-26-2004, 02:44 AM
Gradual Reduction in MF Effectiveness - by gekko - 02-26-2004, 04:24 AM
Gradual Reduction in MF Effectiveness - by Jarulf - 02-26-2004, 08:39 AM
Gradual Reduction in MF Effectiveness - by Jarulf - 02-26-2004, 03:54 PM
Gradual Reduction in MF Effectiveness - by Jeger - 02-26-2004, 04:17 PM
Gradual Reduction in MF Effectiveness - by Jeger - 02-26-2004, 04:26 PM
Gradual Reduction in MF Effectiveness - by adeyke - 02-26-2004, 08:37 PM
Gradual Reduction in MF Effectiveness - by Jeger - 02-26-2004, 09:18 PM
Gradual Reduction in MF Effectiveness - by Jarulf - 02-26-2004, 09:54 PM
Gradual Reduction in MF Effectiveness - by Jeger - 02-26-2004, 09:57 PM
Gradual Reduction in MF Effectiveness - by Jeger - 02-26-2004, 10:14 PM
Gradual Reduction in MF Effectiveness - by gekko - 02-27-2004, 12:30 AM
Gradual Reduction in MF Effectiveness - by Jeger - 02-27-2004, 12:51 AM
Gradual Reduction in MF Effectiveness - by Jeger - 02-27-2004, 02:51 AM
Gradual Reduction in MF Effectiveness - by GreyReaper - 03-11-2004, 06:40 PM
Gradual Reduction in MF Effectiveness - by adeyke - 03-11-2004, 08:20 PM
Gradual Reduction in MF Effectiveness - by dkass - 03-16-2004, 04:31 AM
Gradual Reduction in MF Effectiveness - by adeyke - 03-16-2004, 04:56 AM
Gradual Reduction in MF Effectiveness - by dkass - 03-16-2004, 08:08 PM
Gradual Reduction in MF Effectiveness - by dkass - 03-16-2004, 08:09 PM
Gradual Reduction in MF Effectiveness - by adeyke - 04-12-2004, 01:12 PM
Gradual Reduction in MF Effectiveness - by pmpch - 04-17-2004, 12:04 PM
Gradual Reduction in MF Effectiveness - by Thrugg - 04-19-2004, 05:50 PM
Gradual Reduction in MF Effectiveness - by AtuM666 - 04-19-2004, 11:24 PM
Gradual Reduction in MF Effectiveness - by adeyke - 04-20-2004, 12:30 AM
Gradual Reduction in MF Effectiveness - by gekko - 04-20-2004, 03:20 AM
Gradual Reduction in MF Effectiveness - by IKKE - 04-25-2004, 10:18 PM
Gradual Reduction in MF Effectiveness - by IKKE - 04-28-2004, 03:55 PM
Gradual Reduction in MF Effectiveness - by adeyke - 06-05-2004, 03:15 PM
Gradual Reduction in MF Effectiveness - by adeyke - 06-05-2004, 03:45 PM

Forum Jump:


Users browsing this thread: 4 Guest(s)