How to abuse RNG to face easy trainers in Pokémon Platinum Battle Tower. Platinum Battle Tower RNG tool
First, the game performs (win_count / 7 * 24 + 1) frame advances.
The game then selects 7 trainers. It selects a pool of possible trainers based on the number of wins you'll have when reaching that trainer.
The formula used is
Idx = ((seed / 65535) & 0xFFFF) % NumberOfTrainers;
If there is only 1 possible trainer (ex: at 48 wins), then the RNG frame is not advanced.
If the selected trainer has already been selected, a new roll is performed until an unused trainer is generated.
Each trainer has a list of possible Pokémons. The same formula as the trainer is used to determine the trainer Pokémons.
If the selected Pokémon has already been selected or if it has the same item as an already selected Pokémon for that trainer, a new roll is performed until a valid Pokémon is generated.
After selecting all 3 Pokémons, there is a 2-frames advance to generate TID.
Afterwards, for each Pokémon, random PID (2-frames advance) are generated until the nature derived from the PID matches the wanted nature of the Pokémon. In average, ~12 PID generations are needed.
For example, the trainer Pokémon must have the nature Brave. The first PID results in the nature Adamant. The 2nd PID results in Timid. The 3rd PID results in Brave. PID generation is stopped. (6-frames advances)
The gender and ability of the Pokémon is derived from its PID.
After that, there is a 1-frame avance with unknown impact.
Source code for Platinum Battle Tower RNG tool