I know shiny generation generally has something to do with Personal Trainer ID, so maybe there's some special person out there who's just hit the jackpot on that front every single time? Would be interesting to meet him.
Three values are used to determine if a Pokémon is shiny:
- trainerID: This is the six digit ID on your trainer badge thing. It'll also show up on your Pokémon's summary page as the Original Trainer's ID No.
- trainerSecretID: Another ID number given to the trainer just like the trainerID, but never visible to the player.
- pokemonPersonalityValue: This is a much bigger number that is instead given to the Pokémon rather than the trainer. This is the number that describes everything that's unique about the individual. It's sex, nature, ability and other miscellaneous things like Unown's form.
All three of these values are combined in the below algorithm to determine if it's shiny:
trainerID ⊕ trainerSecretID ⊕ pokemonPersonalityValue[31:16] ⊕ pokemonPersonalityValue[15:0]
This creates a 16-bit value (stored as an unsigned number, so it will be a number between 0-65535). If the number happens to be below eight then it'll be shiny. This is what recreates the 1/8192 odds the generation two games established. This doesn't mean that some trainerIDs have better chances for shiny Pokémon or whaterver. All IDs are equally the same assuming the RNG algorithm doesn't repeat some values more often than others.
The game generates both the trainerID and trainerSecretID when you create a new save, but the pokemonPersonalityValue is generated whenever you trigger an encounter. If you create a new save on the exact same Nth frame someone else also created a new save, then you'd both have the same Trainer ID, and the same for a Pokémon's pokemonPersonalityValue if you encountered it on the same Nth frame as someone else also did. To stop this GF made the game more random by making the RNG use the real-time clock the cartridge now has.
But once your battery runs dry, the real-time clock will no longer work. So this more random behaviour is lost. GF removed the real-time clock from FireRed/LeafGreen and I believe those game's use a slightly different method for their RNG. It was found during the
decompilation projects of the Pokémon games that FireRed/LeafGreen had Ruby/Sapphire's RNG dummied out for the clock-less RNG used in FireRed/LeafGreen,
but when Emerald was being created the same RNG from Ruby/Sapphire was not re-implemented correctly. This is why Emerald's RNG is broken, even when the battery is not dry it does not use it in it's RNG.
Just so you know, how often you get shinies in gen 3 is determined by your seed when you start the game. That seed is kept for your entire playthru, however if your battery is dead that's apparently supposed to increase the amount of shinies you get, or at least gives you a better chance of obtaining a favorable seed. If you're having luck with shinies, then you got a blessed playthru. I can tell you right now that my old, old Emerald cart whose batteries have been dead for decades gets shinies up the ass where as my ROMhack on my GBA flashcart has gotten me none so far. Speaking of which, I do have to finish it one of these days, I only have a few legendaries to catch.
Whenever a computer needs a random number it'll use a RNG. RNGs work by taking the seed, performing some arbuatiary but consistent operations on it (a simple example would be something like multiplying the seed by 15, minus 389, mod it 43), which then creates a new seed that replaces the previous. The computer will use that new seed to do whatever it needed to appear random. Then when it needs a new random value it'll give that seed back to the RNG to create another new seed.
So the seed is set to a new value every frame, and probably set to a new value multiple times a frame. No seed is likely to give you any more or less shiny Pokémon than any other seed.
I have luck for crazy shinies. After some shenanigans in ORAS and Pokemon bank, I had to delete my save, so I decided to SR for a shiny mudkip.
Got it within an hour.
Later that day, full-odds shiny abra in the cave you meet Steven. I had a single great ball, and that's all I needed.
Years later, I was breeding my ORAS mons for a challenge for a friend, and I used my shiny alakazam. He didn't get the egg from that bunch, so I hatched it... He could've had a shiny Abra.
I believe all games including and after generation 3 have the same algorithm I mentioned above. The egg only gets it's trainerID once it hatches. So that Abra couldn't have been shiny for your friend since they would have had a different trainerID (although they could've had an ID similar enough to yours).