Hi all, I currently play on a server where the rate for achieving a socket via met spam at Artisan Wind is set at a base rate of 0.1% + (Number of Met Spammed)/3000. With lucky time, the base rate increases to 0.3%. However, the number of sockets being created seems to be very low throughout the server. I've personally spammed around 3,000 and a couple with around 5,000 before they got one. It may be down to bad luck, but this feels a bit off. (For those with maths background, assuming a binomial distribution with the probability of success at 0.1%, the probability of achieving at least one socket in 3000 mets is 95%. Given that the rate is supposed to increase the more mets you spam, it follows that over 3,000 mets, the probability of success must be even higher.) I don't have access to the code but from my interaction with the developer, the code that does the socketing works something like this: if ((Role.Core.PercentSuccess(client.Player.BlessTime > 0 ? (GLOBAL.LUCKY_TIME_SOCKET_RATE + spamRate) : (Global.SOCKET_RATE+ spamRate)))
{
// Add socket to equipment
} public static bool PercentSuccess(double _chance)
{
return Program.GetRandom.NextDouble() * 100 < _chance;
}
if (clock > Program.ResetRandom)
{
Program.GetRandom = new FastRandom(Convert.ToInt32(randomDate.Ticks.ToString().Remove(randomDate.Ticks.ToString().Length / 2));
Program.ResetRandom = Time32.Now.AddMinutes(30);
}
public FastRandom(int seed)
{
SyncRoot = new object();
Reinitialize(seed);
}
public void Reinitialize(int seed)
{
lock (SyncRoot)
{
x = (uint)seed;
y = Y;
z = Z;
w = W;
}
}
public double NextDouble()
{
lock (SyncRoot)
{
uint t = (x ^ (x << 11));
x = y; y = z; z = w;
return (REAL_UNIT_INT * (int)(0x7FFFFFFF & (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)))));
}
} The implementation seems similar to the Redux Source (see https://github.com/luckymouse0/Redux-Conquer-Online-Server/blob/master/Redux/Network/GameServer.cs and https://github.com/luckymouse0/Redux-Conquer-Online-Server/blob/master/Redux/Common.cs), except Redux uses a customised ThreadSafeRandom. But without access to the code and not having much knowledge about multithreading/CO servers, I'm a bit stuck with further questions to ask/consider. I've done some testing by creating my own FastRandom class and running a for-loop to spam mets. I ran 100 trials spamming 3000 mets with a base rate of 0.1% each time and I've always created a socket. With lucky time boosting the base rate to 0.3%, I would be reasonably confident to get a socket. So the area of suspicion for me is how the FastRandom was implemented/works. I'm wondering whether it's possible for the NextDouble to return the same number when called in succession?