Math cleanup and optional new PRNG#476
Conversation
Signed-off-by: Thomas Rohloff <v10lator@myway.de>
Signed-off-by: Thomas Rohloff <v10lator@myway.de>
Signed-off-by: Thomas Rohloff <v10lator@myway.de>
Signed-off-by: Thomas Rohloff <v10lator@myway.de>
|
some of this change are #215, but mainly not sure if we should move to cglm for all algebra |
Signed-off-by: Thomas Rohloff <v10lator@myway.de>
Signed-off-by: Thomas Rohloff <v10lator@myway.de>
|
Could you explain more about what PRNG is? |
A PRNG is a pseudo random number generator. Different to a real random number generator it isn't really random but pseudo, meaning it uses a seed and deterministic math to get random numbers. PRNGs are normally used when the randomness doesn't need to be secure but fast. See also: https://en.wikipedia.org/wiki/Pseudorandom_number_generator |
|
Oh and in case you ask why change it? The mario kart / vanilla kart PRNG seems to be extremely simple and as a result biased towards specific numbers. This causes effects such as multiple players getting the same items in a row. With this PR it is possible to use the PrNG from the C standart library instead which is used in countless software and probably way less biased towards specific numbers. |
Signed-off-by: Thomas Rohloff <v10lator@myway.de>
THis removes some duplicated math function, removes local return values from math functions and adds the option to use the pseudo random number generator of the C library.