Pokemon Platinum Trainer Data


Hello! This pastebin contains data on all the trainers in Pokemon Platinum, excluding those in the battle facilities. By and large, this is data you can find on Serebii or Bulbapedia, but here's it's more localized instead of having to sift through multiple webpages. There's also some more hidden data that you won't find elsewhere, though. First are IVs. These are lightly obscured under a property I've seen referred to as "difficulty", a value that ranges from 0 to 255, that's converted to an IV value by multiplying it by 31, then dividing by 255 and taking the quotient. All stats then get that IV value (with one exception I'll talk about later). Difficulty is pretty plainly apparent in the narc files the game uses for data, but for whatever reason most websites don't bother showing them.

What is far more obscured, however, are the natures. I've heard speedrunners refer to natures for years, but even looking at the raw data files, they're nowhere to be seen. I looked into it a bit, and it turns out nature (along with gender and ability), are generated from the Personality Value, the arbitrary value that determines shininess and Wurmple's evolution. But, this also isn't in the game's files. So how is it generated? It doesn't seem to be random, since again based off what speedrunners say the trainers' Pokemon have set natures. I won't go into detail on how I found it out (I posted a topic on ProjectPokemon about it if you're interested), but I ended up determining the algorithm used to calculate it:
  • The sum of a Pokemon's National Dex ID, Level, Difficulty, and the trainer's position in the data file (these are the numbers you see before each trainer title in the pastebin) is used as input (or "seeding") for the RNG function. Without getting too much into how pseudorandom number generation works, the result you get from the RNG function isn't actually random, rather, the game makes the input to the function change in imperceptible, seemingly random, ways. So since the input is constant every time you fight a particular trainer's pokemon, the same result is achieved every time.
  • Rather than just being used once, the RNG function is ran a number of times equal to the trainer class, which is represented internally as a number (as is basically anything). The input for the subsequent calls to the RNG function are a truncated version of the previous result.
  • Once it's done with the RNG function, it multiplies the result by 256, then adds a value depending on the trainer's gender - 120 for female, or 136 for male.
And that's it. Obvious, right? Yeah, looking into this made it clear why I've never seen this documented anywhere. Of course, it's probably just plainly there in the DP source code that has since leaked. The way this is generated has a couple effects on how abilities and gender manifest on a trainer's Pokemon:
  • Ability is determined by whether the Personality Value is even (ability 1) or odd (ability 2). But if you're observant, you'll note that it's a value multiplied by 256 (an even value), then added to by either 120 or 136, both even values. Thus, the result is invariably even, so all trainer Pokemon have their first ability.
  • You may have noted while playing Pokemon over the years that all Pokemon seem to share their trainer's gender. This is indeed how it works, though there are exceptions. Gender is determined by taking the personality value mod 256 (which in this case means the result is equivalent to the 120 or 136 added at the end), and comparing that to the Pokemon's species gender value which is a number that when compared against 256 is the percentage chance they can be female. For a standard 50/50 ratio, if this result is under 128, then the Pokemon is female (128/256 = 50% chance to be female), otherwise it's male. So a female trainer's Pokemon has a gender value of 120 which is less than 128, thus their 50/50 gender ratio Pokemon are also female. However, because the assigned trainer gender values are extremely close to the default 50/50 species gender value of 128, any Pokemon with a skewed gender ratio will instead be whatever gender they're skewed towards. A 75M/25F Pokemon for example, will have a species gender value of 64, so since 120 is higher than this even a female trainer will still end up with a male version of that Pokemon.
And natures...are essentially random. You can sift through them yourself, but there's no numerical quirks like abilities and genders that give them any sort of consistency. Cyrus's Weavile, for example, is actually Modest in the final encounter with him.

Anyways, that's the meat of the information you'll find in this pastebin you won't find elsewhere. The only other thing is AI, but this is basically meaningless until we understand how it works. I represent these as decimal values (basically, normal numbers), but it'd likely be more accurate to represent them as binary values (0s and 1s), since they're most likely a collection of flags that assign behaviors based off of what's set. But without knowing what flag does what it's basically meaningless regardless except to compare which trainers have the same AI. All I can really tell is that "1" is the "bad" AI, and "7" is the most standard "good" AI. Also note that a higher number is not necessarily better. 33, for example, is 100001, which is only 2 flags set compared to 7 which is 000111, which has 3 flags set. And even then it's possible that setting some flags may actually trigger negative behavior. Again, it's mostly meaningless without detailed knowledge of how the AI works.

All I have left to share are some oddities in the data:
  • Due to a typo, Volkner's Electivire has a difficulty of 2500 as opposed to the 250 the rest of his team has. If you put this through the difficulty formula I mentioned earlier, this gives it an IV value of 303. Obviously this is illegal, but the game has a failsafe where illegal IV values cause the IVs to get randomly regenerated. However, this is done after the Personality Value is generated, and thus uses the RNG function. And the game doesn't reset the seed/RNG input by the time this failsafe is reached, so it ends up with the same RNG input and thus result every time. Unfortunately for Volkner, the 4/3/29/18/15/19 spread it ends up with is pretty poor.
  • Trainer genders are mostly what you'd expect, but Saturn is notably female instead of male, which according to Bulbapedia is his canon gender. I tried looking up clips of Saturn on youtube from the anime, but I just got a deluge of Team Galactic AMVs??? I guess this was a thing... Anyways, there are some other examples of this in HGSS, where both Bugsy and Will are internally female. Given the examples, it's possible that GameFreak is using this to denote gender nonconformity, or it could just be a typo. Who knows.
  • There are double battle classes that have both a female and a male. In all cases, these are just treated as male.
  • There is an unused double battle class called Sis and Bro, which is a male swimmer and a female tuber. You may have seen this on TCRF.
  • There are two leftover trainer teams from DP, at slots 266 and 330. These were both trainers from Hearthome Gym. I left their names blank to denote that they don't exist in Platinum, though. On this note, I'll point out that names are not actually stored with the trainer data. I suspect it's located in the event data for the maps, but I was lazy and didn't want to learn how to find and interpret that data and assigned names to the teams manually. Given that this took 5 hours, it almost assuredly took longer than just learning something new. Oops.
  • There are a number of teams I can't seem to locate. 330 is a Beauty with a Level 19 Roselia, who as far as I can tell does not exist in DP or Platinum (there was a Beauty with a Level 17 Roselia in DP, and a Socialite with a Level 19 Roselia but neither quite match). There's also a stretch from 817 to 825 of Youngsters and Lasses with fairly mundane teams in the low 20s, but they don't seem to be used anywhere. Maybe a cut area?
 
Last edited:
Will's probably is a typo that's just carried over the years. He seems to have been added rather late into development and the first slot has been a number of different trainers; the fact his GSC rooms in both 99 & the final game were ice themed points to he was probably Lorelei at one point before she got fully replaced by Karen and unlike Koga (who also got shuffeled around, in 99 his sprite was Agatha) they just didn't change it.

Bugsy & Saturn ...well honestly my first thought was shitty in-joke. But to be more...optimistic, it's possible that both were women at one point and they were changed to male for one reason or another. The earliest Bugsy we have was more distinctly male

But a lto changes in 2 years, it's possible they had Bugsy as a girl at some point between 97 & 99 as they shuffled things around.

And Saturn might've been made Male so there was a bit of balance among the 4 Galactic admins.


Out of curiosity, is Janine "male" internally? Bulbapedia points out that she, Will, Bugsy & Saturn all have Pokemon the opposite of their gender and if the men are all "female" internally then...
 
Will's probably is a typo that's just carried over the years. He seems to have been added rather late into development and the first slot has been a number of different trainers; the fact his GSC rooms in both 99 & the final game were ice themed points to he was probably Lorelei at one point before she got fully replaced by Karen and unlike Koga (who also got shuffeled around, in 99 his sprite was Agatha) they just didn't change it.

Bugsy & Saturn ...well honestly my first thought was shitty in-joke. But to be more...optimistic, it's possible that both were women at one point and they were changed to male for one reason or another. The earliest Bugsy we have was more distinctly male

But a lto changes in 2 years, it's possible they had Bugsy as a girl at some point between 97 & 99 as they shuffled things around.

And Saturn might've been made Male so there was a bit of balance among the 4 Galactic admins.


Out of curiosity, is Janine "male" internally? Bulbapedia points out that she, Will, Bugsy & Saturn all have Pokemon the opposite of their gender and if the men are all "female" internally then...
Whats intresting is that Janine uses an all female team in HGSS while nothing changed for Will and Bugsy. Amusingly even the anime dub were confused about Saturn's gender as his voice is more feminine in his first appearence before correcting themselves in subsquent episodes.
 
I just read a part of the pastebin trainer data, I was wondering, all the trainers that don't have names and have a level 5 rattata are just unused player data right ?
 

ScraftyIsTheBest

On to new Horizons!
is a Top Contributor Alumnusis a Smogon Media Contributor Alumnus
hi uhh any idea on why lucian has different ai to the rest of the e4?
He's a Psychic-type trainer, and Psychic is associated with the mind, in particular very high intelligence and mind power. Lucian in particular is also a massive bookworm who loves reading and gaining knowledge.

In other words, I believe he intentionally has higher AI than everyone else as a means to showcase that as a Psychic-type specialist as well as a major bookworm, he is extraordinarily smart, and thus would be more intelligent and calculating in battle than the everyone else since he likely has more brain power in-universe than the other Elite Four members.
 
hi uhh any idea on why lucian has different ai to the rest of the e4?
15 is 1111 in binary which means Lucian has an extra flag set. The leaked source code helpfully provides (tr_ai.c) that this flag is called HOJO or 補助技AI/ほじょわざAI (assistive technique) and is described as 最初のターンに補助技を出す (perform assist techniques on the first turn).

This AI is set up to prefer certain moves on the first turn and is equivalent to the AI_SetupFirstTurn flag from Gen 3/the pokeemerald decompilation (which is less obtuse to read data from), probably intended for his Mr. Mime to set up a screen and similarly for the other Jupiter and Mars battles with AI 15.

As for an in universe reason, the final member of the elite four is also meant to be a big deal before you know that the champion exists, though that mainly happened in Gen 1 with only Lance getting gym leader music.
 
15 is 1111 in binary which means Lucian has an extra flag set. The leaked source code helpfully provides (tr_ai.c) that this flag is called HOJO or 補助技AI/ほじょわざAI (assistive technique) and is described as 最初のターンに補助技を出す (perform assist techniques on the first turn).

This AI is set up to prefer certain moves on the first turn and is equivalent to the AI_SetupFirstTurn flag from Gen 3/the pokeemerald decompilation (which is less obtuse to read data from), probably intended for his Mr. Mime to set up a screen and similarly for the other Jupiter and Mars battles with AI 15.

As for an in universe reason, the final member of the elite four is also meant to be a big deal before you know that the champion exists, though that mainly happened in Gen 1 with only Lance getting gym leader music.
Ah thanks for linking that! Super cool to look through.

Yeah I think it's a case where the AI value is technically higher but it's really just different to better accommodate the devs' moveset choices.
 
Thanks for doing all this work, this is a really good resource!

I was hoping to scrape the trainer data for D/P (just in case there are any changes in Platinum) and for HG/SS as well. Do you happen to have the code you used to scrape this available? Specifically the algorithms to calculate the IV and natures?
 
Thanks for doing all this work, this is a really good resource!

I was hoping to scrape the trainer data for D/P (just in case there are any changes in Platinum) and for HG/SS as well. Do you happen to have the code you used to scrape this available? Specifically the algorithms to calculate the IV and natures?
So, if memory serves, there actually is the original Diamond trainer data within Platinum. Because the trainer locations in the data change a lot, the natures are often different. For your other question, this is the code I used for converting the data (replace the filepaths as appropriate). Don't be intimidated by the size, most of it's just code written by code to decode integers into items/moves etc. I believe HGSS uses a different formatting than the Sinnoh games though so I doubt it will work, but you're free to tinker with it.
 
I want to give a huge thanks to you! I spent a lot of time getting the full pokemon stats for every mon, as well as scraping the data for DP and HG/SS, and I wouldn't have been able to get any of it done without your help.

I expanded on the data for each mon, using all the information to calculate the exact stats and exact moveset for every trainer mon, as well as the experience reward you'd get from defeating it. I ended up with a lot more data, and it's formatted in a json file for better programmatic access, so I threw up 3 files on a github repo here, if anyone is interested: https://github.com/OttoTonsorialist/pkmn_gen_four_trainer_data . I've actually been able to verify the plat data is correct, with other tools. I haven't done that verification for the other trainer files, but they should be correct as well, since they were built with the same code. There are 3 primary trainers I'm less confident about in HG/SS, primarily because I had to guess at the genders of various trainer classes for these games: Bugsy, Will, and Eusine. Bugsy and Will were both encoded as female in the original GSC games, and Eusine was not given a gender at all (despite their "Mystery Man" title). I looked at all of their teams though, and Bugsy and Will both have exclusively female pokemon, while Eusine has exclusively male pokemon, so I'm presuming the gender encoding for Bugsy and Will from GSC was carried forward to HG/SS, and Eusine was just set to male

I did end up getting stuck on two main pieces of data that I wanted to scrape, but couldn't figure out: trainer location, and money reward. Location is complicated because it seems like there are multiple ways the game can initiate a trainer battle, and I couldn't figure out all the various ways, so while I was able to scrape a few trainer locations, most are still empty. For the money, in previous gens, it was stored as a property of the trainer class. It would be a flat number for each class, which would then get multiplied by the level of the trainer's ace pokemon to get the specific reward for each individual trianer. However, I wasn't able to find any documentation on where or how the trainer class proprties are stored, so I kind of gave up on that. If you have any insight into either of those, it'd be appreciated.

Thanks again for helping me out, and I hope this additional data can be useful to someone else!
 
I want to give a huge thanks to you! I spent a lot of time getting the full pokemon stats for every mon, as well as scraping the data for DP and HG/SS, and I wouldn't have been able to get any of it done without your help.

I expanded on the data for each mon, using all the information to calculate the exact stats and exact moveset for every trainer mon, as well as the experience reward you'd get from defeating it. I ended up with a lot more data, and it's formatted in a json file for better programmatic access, so I threw up 3 files on a github repo here, if anyone is interested: https://github.com/OttoTonsorialist/pkmn_gen_four_trainer_data . I've actually been able to verify the plat data is correct, with other tools. I haven't done that verification for the other trainer files, but they should be correct as well, since they were built with the same code. There are 3 primary trainers I'm less confident about in HG/SS, primarily because I had to guess at the genders of various trainer classes for these games: Bugsy, Will, and Eusine. Bugsy and Will were both encoded as female in the original GSC games, and Eusine was not given a gender at all (despite their "Mystery Man" title). I looked at all of their teams though, and Bugsy and Will both have exclusively female pokemon, while Eusine has exclusively male pokemon, so I'm presuming the gender encoding for Bugsy and Will from GSC was carried forward to HG/SS, and Eusine was just set to male

I did end up getting stuck on two main pieces of data that I wanted to scrape, but couldn't figure out: trainer location, and money reward. Location is complicated because it seems like there are multiple ways the game can initiate a trainer battle, and I couldn't figure out all the various ways, so while I was able to scrape a few trainer locations, most are still empty. For the money, in previous gens, it was stored as a property of the trainer class. It would be a flat number for each class, which would then get multiplied by the level of the trainer's ace pokemon to get the specific reward for each individual trianer. However, I wasn't able to find any documentation on where or how the trainer class proprties are stored, so I kind of gave up on that. If you have any insight into either of those, it'd be appreciated.

Thanks again for helping me out, and I hope this additional data can be useful to someone else!
Oh, neat! I was scrolling through the HGSS data though, and there seems to be a recurring issue with reading an incorrect difficulty value, or maybe converting it incorrectly to an IV. Looking at, say, Swimmer Tucker's Cloyster, the difference between its HP and Attack is still the same as it would be if they had the same IV (9, 111 vs 102 using 31 IV as an example, 535 vs 526 in your data), which makes sense since IV is an additive factor to stats. Nature looks to be applied afterwards. So the stat calculation seems fine. It's often not the entire team, too, which is a bit strange since at least in the Sinnoh games difficulty is the property of the trainer itself, not per Pokemon, so any erroneous value there would theoretically affect the entire team. Looking at several other teams, it seems to be adding ~995 to the intended IV value sometimes, creating an obviously inflated range of 995-1026 instead of the usual 0-31. No idea why it would do that, but I'm just letting you know.
 

Users Who Are Viewing This Thread (Users: 1, Guests: 0)

Top