Jump to content

sb the great

Member
  • Posts

    4
  • Joined

  • Last visited

Reputation

12 Good

About sb the great

  • Birthday 10/15/1993
  1. I figured it out! The big thing that helped me out was realizing the assembly was in RAM, so I could edit instructions fairly easily with cheats. Since I knew R6 was where the PID was stored, I replaced the final instruction that adds the gender constant with one that stored whatever I wanted in R6. Then I could just catch a trainer Pokemon and look at its PID to find out what the value was. I first found out that the Trainer information that's part of the Level+Species+Difficulty+Trainer sum is their slot in trdata, not an address. So the Fishermen in my first post would just be 174 and 175. I then found out that R4 was some address, R5 was 0x34, but what really mattered was that R4+R5+0x29 was where the trainer class was located in RAM. With that in mind, the loop, outside of the PRNG call, doesn't actually do anything but iterate a number of times equal to the trainer class. So obviously the magic was happening with the PRNG call. I couldn't find it in the disassembly on github, but looking at in Desmume's disassembler: PRNG To be honest, I couldn't exactly parse what the values involved here were, other than that the loading from the program counter+offset should be constants since PC should always be the same at a given instruction, but thankfully RNG is one of the most well-documented aspects of Pokemon. From Bulbapedia: result = 0x41C64E6D * seed + 0x00006073 This lined up with what I saw in the disassembler. As for what the seed was, there's a branch to SetPRNGSeed right after the sum of Level+Species+Difficulty+Trainer ID is calculated, so that seemed pretty clear. And indeed, that's what the initial seed was. For when the function is ran multiple times, the subsequent seeds are the low 4 bytes of the result function. The low 2 bytes are then shifted away as each PRNG call ends, and that's how the middle two bytes of trainer PID are calculated. The only thing I'm not sure of is where the higher (anything after the lowest 2) bytes of the PRNG result go. They're gone in the end for the PID, but as far as I can tell nothing the instructions do get rid of them. I feel like it has something to do with the shifts, since there's 3 (Right, Left, Right, all 16 bits), but afaik that should only remove the last 2 bytes. Still, it's not important for finding out the PID. To summarize how this works: The lowest byte is either 0x78 or 0x88 depending on the trainer's gender - 0x78 for female, 0x88 for male. This causes Pokemon to be gendered the same as their owner unless they have any sort of existing gender ratio, in which case it's whatever gender they're skewed to. It also causes all NPC Pokemon to have their first ability. The middle two bytes are calculated by taking the sum of Level, Species, Difficulty, and Trainer ID, and using that to seed the PRNG function, which is called a number of times equal to the trainer class. The PRNG uses the function result = 0x41C64E6D * seed + 0x00006073, with the low 4 bytes being used to seed the next call. The result is then shifted right 2 bytes. For the final PID middle bytes result, discard anything but the lowest 2 bytes. The highest byte is always 0. (I do wonder if Gen 3 uses the same algorithm, since it has the same PRNG calculation)
  2. Hello, I don't know if this is documented anywhere, but recently I have been trying to find out how Platinum generates PIDs for NPC trainers during the main game. I've mainly been examining Pokemon caught with a catch trainer code, some light hex editing on trpoke/data, and looking at the disassembly. So far, I've made the following observations: The lowest byte is either 0x78 or 0x88 depending on the trainer's gender - 0x78 for female, 0x88 for male. This causes Pokemon to be gendered the same as their owner unless they have any sort of existing gender ratio, in which case it's their preference. It also causes all NPC Pokemon to have their first ability. The highest byte is always 0. The middle two bytes are where it's more complex. It seems the sum of species, difficulty, level, and trainer location (not sure if the trainer number or memory address) is used: On the same trainer, a 250 difficulty Armaldo (species 348) has the same PID as a 200 difficulty Staraptor (species 398). On the same trainer, a Level 31 Combee (species 415) has the same PID as a Level 48 Staraptor (species 398). A Fisherman (trainer 175 in the disassembly) with a Level 42 Gyarados has the same PID as another Fisherman's (trainer 174) Level 43 Gyarados. When any of these factors is changed by 1, the value of the middle bytes is incremented (or possibly decremented by its ffff-complement) by a near-constant amount (like, plus or minus 1). If it reaches 0 or ffff, it loops around. This leads me to believe that the previous sum is multiplied by some value, but I cannot parse what. I have noticed that this increment seems to be determined by solely the trainer class as far as the trainer information is concerned. A Fisherman turned into a Rival class (no other modifications) is incremented by the same amount with each Level/Species/Difficulty/Trainer change as an actual fight against the Rival is. Looking into the disassembly seems to verify a lot of these observations: ldrb r0, [r0, #0x0] @ MainGameData_NPCTrainer_Class + r5*0x34 MainGameData_NPCTrainer_Size bl Function_20793ac cmp r0, #0x1 bne branch_207940a mov r0, #0x78 str r0, [sp, #0x14] b branch_207940e branch_207940a: @ 207940a :thumb mov r0, #0x88 str r0, [sp, #0x14] This preceding code assigns either 0x78 or 0x88 and stores that on the stack, which is definitely the eventual gender byte. branch_2079440: @ 2079440 :thumb ldrh r0, [r7, #TrPkmn0_Species] mov r1, #0x3f lsl r1, r1, #10 and r1, r0 asr r2, r1, #10 @ I think the point of all this shifting and anding is to clear the higher bits (that have no legal reason to exist) on the species? It shouldn't affect the value for any legal Pokemon. add r1, sp, #0x64 strb r2, [r1, #0x3] ldr r1, =0x3ff ldrh r2, [r7, #TrPkmn0_0] @ This data is definitely the difficulty. and r0, r1 lsl r0, r0, #16 ldrh r1, [r7, #TrPkmn0_Lvl] lsr r0, r0, #16 str r0, [sp, #0x34] @ Storing the should-be unaffected species on the stack ldr r0, [sp, #0x38] @ NPCTrainerDataAdress add r2, r2, r1 @ Difficulty+Level ldr r1, [sp, #0x34] @ Retrieving the species ldr r0, [r0, #0x18] @ Getting some offset of the "NPCTrainerDataAddress", I presume the location based on my observations add r1, r1, r2 @ (Difficulty+Level)+Species add r0, r0, r1 @ (Difficulty+Level+Species)+Trainer something str r0, [sp, #0x58] @ Sum stored on the stack bl SetPRNGSeed add r0, r4, r5 add r0, #0x29 ldrb r0, [r0, #0x0] @ MainGameData_NPCTrainer_Class + r5*0x34 (this comment is from the disassembly) mov r6, #0x0 cmp r0, #0x0 ble branch_207948c branch_207947a: @ 207947a :thumb bl PRNG str r0, [sp, #0x58] add r0, r4, r5 add r0, #0x29 ldrb r0, [r0, #0x0] @ MainGameData_NPCTrainer_Class + r5*0x34 .hword 0x1c76 @ add r6, r6, #0x1 cmp r6, r0 blt branch_207947a branch_207948c: @ 207948c :thumb ldr r0, [sp, #0x58] @ Retrieving the earlier sum after...something is done to it lsl r1, r0, #8 @ Left shifting to clear the lowest byte ldr r0, [sp, #0x14] @ Retrieving the gender value add r6, r1, r0 @ Adding that gender value to the middle bytes I am pretty sure this is where the process ends, but as you can tell by the lack of comments, the middle branch confuses me. Based on my limited understanding of assembly, I think loops like this are used to simulate multiplication as I theorized earlier, but there's an actual multiplication instruction so I assume it is more complex than that. The big issue is that even looking at the whole file, I am having trouble keeping track of what r4 and r5 should contain at this point, or if there any significance to 0x29 (an offset? idk) or if it's just being used as a constant. I'm also not sure if there's any significance to PRNG being called every time in the loop since iirc this is how player PIDs are generated, but the trainer PIDs don't seem to be random. Writing this out, I realize it's a lot, but I think I'm close and I'm hoping someone more familiar with assembly and Pokemon internally can crack this final bit. Or this has already been discovered and I've wasted a lot of time. For verification purposes, some observed PIDs: 200 Difficulty Level 48 Staraptor on League Barry (Empoleon team, #481): 0x00877488. Level 46: 0x000ae788. Level 47: 0x00c92e88. Level 49: 0x0045ba88 200 Difficulty Level 48 Staraptor on Elite Four Aaron (#261): 0x00e0fb88, Level 49: 0x00b6ec88 200 Difficulty Level 48 Staraptor on Elite Four Bertha (#262): 0x007b1578. Level 47: 0x00a11e78 0 Difficulty Level 43 Gyarados on Fisherman (#175): 0x0079fc88. Level 42: 0x001f2488 0 Difficulty Level 43 Gyarados on Fisherman (#174): 0x001f2488. Level 42: 0x00c44c88
  3. I calculated estimations of Zoroarks and Rankrusu's base stats from stats screens we've gotten from CoroCoro. These are the most important ones since we get all their stats, but the base HP of various pokemon can also be calculated from battle screens where the player is using them (there are far too many of these to post, unfortunately). It's not an exact science, but every pokemon we saw in pre-release DP could have its base HP calculated precisely using the same method (assuming it had a 31 HP IV/0 EVs). However, pokemon seem to be changing their HP stats all the time in these BW screenshots (though it could just be them using different pokemon with different IVs). Still, they're fairly accurate estimations.
  4. Yeah, Motor Drive is an awesome ability, but as is, Rotom-A being the premier electric type (which, obviously, is subject to change, but given its Rapid Spin immunity and amazing set of resistances, I'd have a hard time seeing it leave OU) makes it hard to abuse when its hard for Electric types to have a way to deal with it. It is worth noting that Shimama is very small and could therefore evolve and get a good secondary type to give it good secondary STAB and resistances to help it overcome this problem. Electric/Dark would REALLY help it, I think, and it's really the only secondary typing I could see it getting. That being said, if it remains pure electric, while I'll definitely look at it closely, I see it having a difficult time overcoming Electivire's problems without learning something like Ice Beam or having over 100 base speed. Also, however Shimama turns out, when speculating competitive uses for it, definitely stay away from Choice items. Motor Drive's main strength is that it allows the user to emulate a Choice Scarf boost without the annoying move lock or wasting a turn. This lets it sweep up more offensive teams that rely on speed to stop threats. However, if you use Choice Specs, then even an offensive team can stop you right in your tracks with a pokemon that resists Electric. This is why Life Orb or Expert Belt make much better alternatives. Though, Electivire's main problem is that offensive teams generally Scarf'd pokemon that can still outspeed Electivire after the Motor Drive boost, teams in the middle of the spectrum generally have a wall that can stop Electivire comfortably, and stall teams just decimate Electivire with entry hazards and Electivire finding its Motor Drive boost useless versus them. It also has some trouble getting said boost in the first place...but hey, that's why it's near the bottom of the OU list! Rankurusu is my favorite new pokemon of the batch, and also my #1 pokemon to watch out for competitively atm. Using my amazing stat calculating skills, I calculated an estimate of its base stats on smogon (http://www.smogon.com/forums/showpost.php?p=2823136&postcount=18760). Both the 108 HP/85 SpD and 120 SpA interest me greatly. That is a lot of special survivability, although pure Psychic unfortunately has very few useful special resistances (hopefully they'll have a special fighting pokemon that ISN'T very good physically too!), but it should be fairly adept at taking neutral hits as well, especially when you consider passive damage immunity. Also, while not a staple of the type, pure Psychic means Recover is a decently plausible move for it to learn, which would help it greatly on the defensive front. The other reason I'm stoked for it is the 120 SpA, which helps it on the defensive end by allowing it to threaten more pokemon more easily and subsequently prone to taking less hits. But offensively? Magic Guard gives Life Orb recoil immunity, and it's pretty much guaranteed to learn STAB Psychic. This alone already solves the main problem of Life Orb Clefable has- non-existent STAB from its higher attacking stat. The vast majority of Psychic types also happen to learn Thunderbolt and Shadow Ball (actually I think every Psychic type learns Shadow Ball) which would improve Rankurusu's coverage from its 120 base Spa boosted with Life Orb. It's also pretty much guaranteed to learn Calm Mind, though that might be better with Leftovers than Life Orb. However, weakness to Pursuit is really annoying, and base 25 speed is just awful, being outsped by pretty much every wall. Hopefully Rankurusu can also learn Focus Blast to keep Pursuiters away. Anyways, with movepool knowledge being almost entirely limited atm, that's about all I can say about Rankurusu... Hihidaruma and to a lesser extent Wooguru also have me hyped up due to Encourage. I don't think that the "secondary effects" it mentions will include recoil damage from Flare Blitz and Brave Bird, much to many people's dismay, but unlike a lot of the people who seem dismissive of the ability if it wouldn't do that, I still see a lot of potential in it. I think Hihidaruma will be a much better user of it than Wooguru of it though, because I most fire moves have some chance of burn attached to it (yes, even Flare Blitz, but I'd like to reiterate that I believe the recoil damage would still be present), and let's be realistic- do you honestly care about losing Fire Blast's 10% burn chance? While a lot of people are assuming something ridiculous like a 50% boost (that's far too large of a boost for giving up something so small...), even something like a 20% boost would still be well worth the trade off of burn chances. On the topic of Hihidaruma, it might also learn ThunderPunch/Ice Punch (if they bring back the tutors) which would also be boosted by Encourage. Wooguru I'm much less excited about because I'm having trouble thinking of Normal/Flying moves with added effects (browsing through serebii's pokedex I see...SecretPower and Sky Attack? lol), but depending on new moves it could make good use of it. Also, it looks epic. Zoroark I'm also hyped up for due to Illusion. Stat-wise, it's not impressive (I've estimated the base stats to be around 56 HP/94 Atk/48 Def/114 SpA/56 SpD/94 Spd), but it's got a decent stat build to lead off with, and coincidentally, that's also where I think Illusion will be the easiest to abuse. This is because, you are otherwise restricted in what you can proficiently masquerade as due to entry hazards (for instance, a "Flygon" taking Spikes damage might raise a red flag to your opponent), and I believe what's in your second party slot switches around constantly (although I might be wrong and it the party has its default state and recalculates order based solely from that), making it difficult to use Illusion effectively. But yeah, back to leading off. Ignoring Illusion, it could Taunt slower leads (I think Taunt is a dark type staple move), and most likely learn Sucker Punch or maybe Quick Attack, either allowing it to live up to the old "Break the sash and win with priority" anti-lead mantra. Of course, Weavile can do this already, so Illusion is the main strength of Zoroark's leading capabilities. First off, while difficult to predict right now for obvious reason, you'd definitely need your Illusion to be of a pokemon that commonly leads so as not to look suspicious. There are a couple types of pokemon I'd look at to copy (ideally pokemon that fall into more than one of these categories). The type of pokemon I'd look for is something that doesn't learn Taunt but doesn't threaten the slower set-up leads offensively. An example in the current metagame of this would be Mamoswine. This would prompt said slower leads to set up whatever they want thinking there's no harm in doing so, but then you surprise them with Taunt. I'd also look for something that is slow, defensive and sets up entry hazards, like Bronzong. Bronzong is pretty much a Taunt magnet, but if you're using Zoroark in actuality, you can take advantage of this and just attack+priority move kill pokemon like Azelf. The last type of pokemon I'd look for is something that Zoroark can complement type-wise, such as Machamp. While it beats Azelf anyways, some people might just Psychic+switch out versus it (since SR isn't up yet you might be able to set it up yourself late or explode). but if you're using Zoroark, you can make Azelf's Psychic attempt useless as you nerf it while it accomplishes nothing. While the actual leads for B/W will most likely be fairly different, once it settles down there should still be pokemon that fit into these types of molds for fun with Illusion. Also, while not directly relevant to leading, because there are stat screens of Zorua and Zoroark, as well as a battle between the two of them where Night Burst is used, an estimate that is exponentially prone to error can be made on its power. I calculated this a while back, and got that Night Burst was around 100 BP before STAB. Hopefully it actually stays around that high! Koromori gets a VERY handy ability in Unaware. There are 2 ways to take advantage of Unaware- one, you can be defensive enough to switch in on stat boosting pokemon with added security of negating their boosts, or two, you can use it to make revenge killing Dragon Dancing pokemon much easier. Unfortunately, Flying is one of the worst defensive typings in the game imo, with very bad Rock (which is especially bad with SR), Ice, and Electric weaknesses, although Fighting resistance and Ground immunity are fairly handy, and Bug to a lesser extent. It's not totally unsalvageable, but Psychic also happens to be the one of the worst defensive typings as well, because it possesses very few resistances (to make matters worse, its most useful resistance, Fighting, is already shared by Flying) and is weak to Dark and more specifically, Pursuit. So yeah, I don't think Koromori is going anywhere defensively. But offensively is where I see potential. If it has over 100 base speed, it would be able to outspeed every Dragon Dancer without the need for a Choice Scarf, which is huge. Psychic and Flying are both decent offensive types, and if the Heat Wave tutor comes back (for whatever reason, it's a staple on Flying-types), then Koromori will definitely have a lot of revenge killing potential. I think a Life Orb set with Roost would be best, and a Choice Band/Specs set could also be usable. Overconfidence (I think even serebii said on the main page that this was a better translation of the ability, so you might want to update the OP with that) seems really good. However, a lot of its potential hinges on whether or not Meguroko learns Pursuit. If it does, then it will be a fantastic ability, since it can just switch into anything weakened and then hopefully clean house with a free attack boost. If not, then your opponent is free to switch out the weakened pokemon and switch to something that walls Meguroko. Not to say it would be useless without Pursuit, considering your opponent's good Meguroko switch-in could be dead or weakened, as well as what would probably be the most reliable Meguroko counter independently of any new pokemon being Skarmory, which makes Magnezone a great accessory to Meguroko. Also, Meguroko would need to be fast to take advantage of Overconfidence, or else it would just be easily revenge killed, though it could still wreak havoc on more defensive teams. We've also seen a scan of Meguroko's HP, and I calculated it to be around base 38 (though in the Pokemon Sunday footage it had an extra 12 HP...?), which sounds bad, but I think it's a good thing since it means Meguroko is probably more offensively oriented which allows for better synergy with Overconfidence. Desukan is the last pokemon I want to talk about. I think pretty much everyone agrees that it will be a Ghost type, but the secondary type is debated a lot. Personally, I think it looks like a Rock type, and that's what I'll assume it is for my speculation. From how it looks, Desukan appears to be a defensive pokemon, and while its low HP would seem to contradict this (~base 46), remember what defensive Ghost pokemon we currently have- Rotom-A, Dusknoir, and Spiritomb. The highest base HP of these pokemon is 50. So yeah. Anyways, first good thing about Desukan is Rapid Spin immunity. However, if it's Ghost/Rock, I don't think it'll be as good at blocking Rapid Spin as the other ghosts due to being weak to Starmie's Surf, so Desukan's place on a team would probably be decided by its other merits. First off, no other Ghost would get Sandstorm immunity, which is very handy since the defensive Ghosts don't get good recovery moves. It would also get the special defense boost in Sandstorm, which would be where Desukan would get most of its advantages over its Ghost brethren. This would hopefully allow it to become a spinner that could fulfill some extra tasks, such as countering Infernape. Hopefully Desukan actually has good stats, since I do like it a lot. in b4 tl;dr
×
×
  • Create New...