HTs on Global/Clone bug: Difference between revisions

From Hattrick
Jump to navigationJump to search
Giggsip (talk | contribs)
No edit summary
m Alphabet
Line 1: Line 1:
[[Category:HT's on Global]]  
[[Category:HT's on Global|Clone bug]]  
[[Category:Bugs]]  
[[Category:Bugs]]  
{{forum_message|
{{forum_message|

Revision as of 16:46, 29 November 2005


Keywords: (Clone bug), (Youth pull)
From: HT-Mattias (3391068.32) as reply to (3391068.6)
To: GetAssista 22-06-2005, at 01:39
He-he, nice! Must be indeed some time seed in YP RNG

You are correct. The bug that creates the clones is that when two players make a youth pull within the same 3 milliseconds, the same random seed will be used. Therefore the players will be identical. This does not happen often, but with 600,000 active players it does happen sometimes.

We will fix this bug shortly.

Keywords: (Clone bug), (Youth pull)
From: HT-Mattias (3391068.36) as reply to (3391068.35)
To: Grischenko 22-06-2005, at 01:58
You are correct. We will construct the seed out of the time and the team number, so that all youth pulls get a unique seed.
Keywords: (Clone bug), (Youth pull)
From: HT-Mattias (3391068.52) as reply to (3391068.37)
To: ballord 22-06-2005, at 11:23
Should that really prevent clones from being pulled? I think in some way that's impossible. Like, let's say you use time divided by team id to get the random seed. Well, in that case different times could, divided by proportional team ids, result in the same seed.

The trick is to construct a seed not by dividing time by teamID, but rater in this way: time*C+teamID, where C is a number that is larger than the largest teamID. This will always create a unique seed.

Keywords: (Clone bug), (Youth pull)
From: HT-Mattias (3391068.53) as reply to (3391068.46)
To: _Diegol_ 22-06-2005, at 11:25
Maybe that seed will make some teams more propitious to pull better players than others.

No, the random function is random enough, so that won't be the case.

Keywords: (Clone bug), (Youth pull)
From: HT-Mattias (3391068.84) as reply to (3391068.71)
To: Ratsia 23-06-2005, at 02:44
It is correct that the first number (and arguably another few numbers) after reseeding typically has a detectable link to the seed.

To counter that, we call the random function a couple of times to "shuffle the deck" before we start using the numbers.

Due to the parallel nature of Hattrick, where many youth pulls can happen simultaneously, the practical solution is to reseed every time. And to make sure that we have a unique seed.

Regarding your fear that the random generator might only use the last few bits of the seed, let me assure you that we have made sure that in fact the whole seed is used.

We have made a statistical analysis of the youth pulls, and the distribution is in fact very random and is shaped as we want it.

Now, the change we have made (implemented tonight), only affects the selection of the seed. The way the player skills are calculated is unchanged. So the only difference will be the fact that there will be no more clones, since the same seed will not be used twice in the future.