Guessing IVs on Generation 3 early

Exarion
Cooltrainer
Posts: 249
Joined: Thu Jul 17, 2014 10:07 am

Re: Guessing IVs on Generation 3 early

Post by Exarion » Mon Apr 20, 2015 7:24 am

If Emerald RNG manip is like Sapphire, hitting the same frame doesn't always give you the same Mudkip, because there's variance in how fast the RNG progresses. Mountebank told me this variance was about 10 frames, which was consistent with my results in runs. In any case, each trainer ID will be different, so we shouldn't lock ourselves into a set number of frames.
Twitch channel: http://www.twitch.tv/exarionu
Pokemon Red speedrunning guide: http://pastebin.com/CkVA5yvJ

speedfaces
Bug Catcher
Posts: 22
Joined: Wed Apr 15, 2015 3:35 am

Re: Guessing IVs on Generation 3 early

Post by speedfaces » Mon Apr 20, 2015 8:17 am

speedfaces wrote:I do see what you mean about Abra being a complete dick. If only there were some way we could analyze the RNG to get an Abra more consistently...

Trashing the old contents of this post to ask something more valuable. So how exactly can I determine the cutoff point for "runnable?" It looks like it's pretty varied depending on a number of factors. I don't know all of the things about Emerald that would make one set of IVs runnable and one not. Right now I have >= 6 spe and no -atk nature as hard rules that give pretty big clusters, but obviously we want harder criteria than that. I can try to infer some other rules from your examples, or you (and other runners) could give me some more rules that you think would be useful that I can plug into my code. Pretty much any information is useful since I think I'll have to check factors against one another in quite a number of ways for this.
Quoting my old post since I changed most of its contents while you were replying I think; whoops!
Exarion wrote:If Emerald RNG manip is like Sapphire, hitting the same frame doesn't always give you the same Mudkip, because there's variance in how fast the RNG progresses. Mountebank told me this variance was about 10 frames, which was consistent with my results in runs. In any case, each trainer ID will be different, so we shouldn't lock ourselves into a set number of frames.
Judging by what roushmore said, a 5-10 frame window will be fairly consistently doable even with that variance. Just gimme some rules I can plug in and I'll get to work figuring out what methods will produce the most runs.

User avatar
Amoeba
Cooltrainer
Posts: 280
Joined: Thu Apr 24, 2014 12:26 am
Contact:

Re: Guessing IVs on Generation 3 early

Post by Amoeba » Mon Apr 20, 2015 9:10 am

speedfaces wrote:That's been fixed.
Thank you! Your work is greatly appreciated~

In regards to finding clusters, exarion basically gave a great run down of the stats we look for a couple of posts ago, but the cut off points are technically debatable. I'd argue that a competitive run would now have to do at least torrent from winona, so that requires at least a speed IV of 9(? correct me if I'm wrong on this), preferably 11 to skip the carbos. Attack would likely have to be above 20IV (I see exa mention 18 in his previous post, not sure how bad 12 atk is but I'm fairly certain there's some significant time loss with it). Sp.atk basically doesn't have a minimum, as they're all runnable, but it is definitely the stat that saves a lot of time with higher IVs.
~

Exarion
Cooltrainer
Posts: 249
Joined: Thu Jul 17, 2014 10:07 am

Re: Guessing IVs on Generation 3 early

Post by Exarion » Mon Apr 20, 2015 9:13 am

Creating too many hard rules would remove a lot of good Mudkips that have one weakness. For example, this Mudkip is amazing despite having bad Speed:

Nature: Naughty
HP: 31
ATK: 31
DEF: 31
SA: 31
SD: 31
SPD: 5

The only hard rule I would set -- and even this is debatable -- is no -Attack natures or <18 IV neutral Attack.

Everything else could be done with a scoring system, although this would be incredibly difficult to optimize because of variables such as Hidden Power and IV thresholds. Also, you would have to figure out a way to link natures to IVs. For example, 0-2 IV Sp. Def is really bad with a -Sp. Def nature because Rival 2's Grovyle does 40-48 dmg, up from 34-40 at 3 IV. But with a neutral nature, 0-2 IV Sp. Def isn't much worse than 3 IV.

A simpler scoring system like the one below would allow an efficient search, but it would include some unrunnable Mudkips:

Nature = (assign a number to each nature that isn't -Attack)
HP = IV * 1.5
ATK = IV * 5
DEF = IV * 1.5
SA = IV * 3.5
SD = IV * 1
SPD = IV * 3
Hidden Power = Type * (Power - 50)
Type = 0 if anything except Ice or Rock; 1 if Rock; 1.5 if Ice
Twitch channel: http://www.twitch.tv/exarionu
Pokemon Red speedrunning guide: http://pastebin.com/CkVA5yvJ

Exarion
Cooltrainer
Posts: 249
Joined: Thu Jul 17, 2014 10:07 am

Re: Guessing IVs on Generation 3 early

Post by Exarion » Mon Apr 20, 2015 9:16 am

Amoeba wrote:cut off points are technically debatable. I'd argue that a competitive run would now have to do at least torrent from winona, so that requires at least a speed IV of 9(? correct me if I'm wrong on this), preferably 11 to skip the carbos. Attack would likely have to be above 20IV (I see exa mention 18 in his previous post, not sure how bad 12 atk is but I'm fairly certain there's some significant time loss with it). Sp.atk basically doesn't have a minimum, as they're all runnable, but it is definitely the stat that saves a lot of time with higher IVs.
You need 3 IV and 1 Carbos to outspeed Mightyena at Lv. 40, and you don't really need to outspeed Golbat (just Potion or Oran before; Wing Attack does ~17 dmg).

I mention 18 Attack IV because anything lower adds 2 turns to the first Aqua Pooch fight.
Twitch channel: http://www.twitch.tv/exarionu
Pokemon Red speedrunning guide: http://pastebin.com/CkVA5yvJ

User avatar
Amoeba
Cooltrainer
Posts: 280
Joined: Thu Apr 24, 2014 12:26 am
Contact:

Re: Guessing IVs on Generation 3 early

Post by Amoeba » Mon Apr 20, 2015 11:08 am

Exarion wrote:You need 3 IV and 1 Carbos to outspeed Mightyena at Lv. 40, and you don't really need to outspeed Golbat (just Potion or Oran before; Wing Attack does ~17 dmg).

I mention 18 Attack IV because anything lower adds 2 turns to the first Aqua Pooch fight.
Ohh, I got it in my head that the mightyena was the highest threshold.
I'm pretty much in agreement with the atk over 18 (I'd personally not run 18-20, but if it is runnable my opinion is irrelevant) but I'd argue adding in more than 3 iv neutral on speed. Torrent strats are always faster, and that requirement is so basic that it shouldn't really be an issue.
~

speedfaces
Bug Catcher
Posts: 22
Joined: Wed Apr 15, 2015 3:35 am

Re: Guessing IVs on Generation 3 early

Post by speedfaces » Mon Apr 20, 2015 2:41 pm

Rather than assigning a number to each nature (that isn't -atk,) what if we just multiply the scores of the nature it benefits and hurts by some factor (2 and .5?) Might benefit +atk natures too much, but this method isn't going to be much of an exact science anyways - it's mainly just to reduce resets and this should give a range with a lowish chance of resetting. After that I can work on getting a cutoff method that doesn't kill too many runs and gives more optimal results. Alternatively I could just add flat bonuses for Mudkips with IVs over the cutoffs rather than completely ignoring the ones below cutoffs. Check back later tonight and I should have something posted.

Editing in some findings for cutoff method, hope I don't snipe a reply again:
My current goal is to find windows with a length of 5 or higher which have at least 50% acceptable Mudkips. I think that's an acceptable goal that should, with practice and correct timing, get resets down a significant amount. My method of doing so is to find all the frames that will result in a good Mudkip and then count the differences between each frame. If the difference is less than 4, I add it to a chain. If a chain looks like [3, 2, 1], it refers to a series of frames like *xx*x*, where the *s are good Mudkips and the x's are bad ones.

Good news or bad news, depending on some factors: with my current rules, the RNG looks really clumpy. For example, here's some of the output for a test ID 13769:

Code: Select all

3: [1, 2, 1], 45x, 13x, 1: [2], 23x, 1: [2], 9x, 11x, 16x, 8x, 16x, 13x, 25x, 15x, 4x, 9x, 1: [1]
Which would look like **x**, then 58 xs with only 1 *, and so on. So the clumps are easy enough to identify this way. The bad news is that this does not result in very many windows over 5 frames within the 800 frames or so we're searching. The good clusters I extracted from that ID between 7700 and 8500 looked like this:

Code: Select all

**x**
*xx*xx**
***x*
*xx*x**
That's already sort of thin, so I wouldn't want to get too much more restrictive than I am already, but it seems workable. For reference, my current rules (which come from the FAQ and my interpretation of suggestions in this thread, feel free to correct me if I'm missing or overshooting the relevant cutoffs) are:

Code: Select all

*No -ATK natures.
*ATK should be at least 20
*Speed-neutral and +speed natures need at least 6 speed IVs
*-Speed natures need at least 20 speed IVs
*SPA IVs should be greater than 20 or the nature should be +SPA
I think this is about as restrictive as I can make the rules and still have it relatively easy to hit the window, so any restrictions on defensive stats would need to be offset with some relaxing of the ATK/SPA/SPE rules.

Exarion
Cooltrainer
Posts: 249
Joined: Thu Jul 17, 2014 10:07 am

Re: Guessing IVs on Generation 3 early

Post by Exarion » Mon Apr 20, 2015 10:10 pm

I would loosen the rules a bit:
- Any +Speed IV is fine
- Any Sp. Atk IV is fine except -Sp. Atk nature with <22 IV

Do you mind posting some clusters that you're getting with your method? Since this isn't an exact science, it would be good to run the results by current runners, and if we could suggest adjustments if we find any clusters that we wouldn't use.
Twitch channel: http://www.twitch.tv/exarionu
Pokemon Red speedrunning guide: http://pastebin.com/CkVA5yvJ

speedfaces
Bug Catcher
Posts: 22
Joined: Wed Apr 15, 2015 3:35 am

Re: Guessing IVs on Generation 3 early

Post by speedfaces » Mon Apr 20, 2015 10:59 pm

Sure thing. Here's the output of 3 runs with some test values over the frame range 7700-8500 with the rule changes you suggested: http://pastebin.com/MHEGpYKJ (EDIT: results in old pastebin were poorly formatted and incomplete; fixed.)

Should be fairly self-explanatory but it basically shows you the length of the cluster (the frames it starts and ends on.) The lines between the ones starting with "Cluster" show the Mudkips it finds there. Do those Mudkips look runnable?

Exarion
Cooltrainer
Posts: 249
Joined: Thu Jul 17, 2014 10:07 am

Re: Guessing IVs on Generation 3 early

Post by Exarion » Tue Apr 21, 2015 1:43 am

Every Mudkip in that pastebin looks runnable except:

8337: [27, 21, 13, 23, 8, 6] careful Bug 45
7850: [7, 20, 7, 11, 0, 6] hardy Bug 48

So it looks like the system works. At this stage, I'd like to try some RNG manip in actual runs. Is this doable? I'm envisioning a program in which you insert your trainer ID and see a list of good clusters from 7700 to 8500. Then you decide which cluster to aim for while you mash through the next 2 minutes of intro cutscenes.
Twitch channel: http://www.twitch.tv/exarionu
Pokemon Red speedrunning guide: http://pastebin.com/CkVA5yvJ

speedfaces
Bug Catcher
Posts: 22
Joined: Wed Apr 15, 2015 3:35 am

Re: Guessing IVs on Generation 3 early

Post by speedfaces » Tue Apr 21, 2015 2:15 am

Sure thing, I'll get you a console .jar tonight if possible. I'm out taking care of some animals right now so I don't have my laptop, but check back in a few hours. Mind telling me what makes those in particular bad? I'd imagine it's the low defensive stats on one.

Exarion
Cooltrainer
Posts: 249
Joined: Thu Jul 17, 2014 10:07 am

Re: Guessing IVs on Generation 3 early

Post by Exarion » Tue Apr 21, 2015 3:53 am

Awesome. Those Mudkips are bad because their Attack is barely runnable and the other stats are below-average. You wouldn't necessarily lose the run because of this, but you'd lose time, and the odds of getting a better Mudkip are high enough that it's more efficient to just reset.
Twitch channel: http://www.twitch.tv/exarionu
Pokemon Red speedrunning guide: http://pastebin.com/CkVA5yvJ

speedfaces
Bug Catcher
Posts: 22
Joined: Wed Apr 15, 2015 3:35 am

Re: Guessing IVs on Generation 3 early

Post by speedfaces » Tue Apr 21, 2015 5:05 am

Alright, here's the cluster JAR: https://mega.co.nz/#!YxhGCDgR!L2D9b2Ezb ... On3UfkHHdU
You need to run it from command line. I'm assuming you're on Windows - here's what it should look like: http://imgur.com/UOhdqFb

Let me know if the frame range needs adjustment; I'm not sure if these are right (the 7700 mark is just assuming it takes about 150 frames to check the ID which is probably wrong.) For removing those, I'll probably add a rule for low-attack Mudkips that their def*hp and spd*hp (and/or speed?) need to be somewhat acceptable if they don't have positive natures in either of those, but that isn't implemented in the above program.

Oh, as for making a program that is useable - I'll eventually have some sort of system for determining the best cluster to aim for (even if it's just you telling the program to prefer larger window size vs. prefer better average stats.) Then I'll have it print all the possible Mudkips inside that window with their stats adjusted to level 5 values, with a * next to the ones deemed runnable - essentially putting the functionality of my two programs together to some extent. That way runners will know immediately whether or not they've grabbed one of the Mudkip that meets all the selection criteria.

Exarion
Cooltrainer
Posts: 249
Joined: Thu Jul 17, 2014 10:07 am

Re: Guessing IVs on Generation 3 early

Post by Exarion » Tue Apr 21, 2015 11:02 am

Frame range seems good. +Attack natures with IVs of 3-19 should be added.

I think expanding the width of clusters will help. It's tough to hit a small window of frames when it's different every time (can't practice to get good like in Sapphire). I would love to see clusters of ~30 with at least 50% runnable Mudkips.
Twitch channel: http://www.twitch.tv/exarionu
Pokemon Red speedrunning guide: http://pastebin.com/CkVA5yvJ

speedfaces
Bug Catcher
Posts: 22
Joined: Wed Apr 15, 2015 3:35 am

Re: Guessing IVs on Generation 3 early

Post by speedfaces » Tue Apr 21, 2015 2:38 pm

I can try to write something to do a meta-analysis of the results once clusters are formed that tries to group close ones with loosened chain link width requirements, but I've got two assignments and a few hours of sleep to catch up on before that. Check back maybe tomorrow and I'll try to get something with better frame windows. I assume you're having trouble hitting any Mudkips generated in the 5-15 sized clusters the current program finds?

E: Ooh, there's a bit of a knapsack problem here I think - or some variant of it, anyways, in determining the order to try merging clusters. Fortunately the input set is small so factorial runtime isn't bad, but I'm still gonna look for a way around it because CS major Kappa Eeh nevermind I just sucked at algorithms it's not that hard.

Exarion
Cooltrainer
Posts: 249
Joined: Thu Jul 17, 2014 10:07 am

Re: Guessing IVs on Generation 3 early

Post by Exarion » Tue Apr 21, 2015 11:46 pm

Yeah, it's a lot harder to hit frames when you're aiming for a specific hundredth of a second (like 2:42.83 rather than 2:43.00). It'll be easier with practice, but not as easy as Sapphire. And a great Mudkip is more useful in Sapphire than in Emerald, so aiming for large clusters should be fine (although a small cluster of God Mudkips would still be worth it).
Twitch channel: http://www.twitch.tv/exarionu
Pokemon Red speedrunning guide: http://pastebin.com/CkVA5yvJ

User avatar
roushmore917
Schoolkid
Posts: 40
Joined: Thu Jul 31, 2014 8:14 am

Re: Guessing IVs on Generation 3 early

Post by roushmore917 » Wed Apr 22, 2015 1:19 am

I'm actually finding my method to work quite well for me.

When I've been doing my runs with my new method, I find that I can hit my frame roughly 1 out of 5-6 GOOD tries at it (i.e. when i don't absolutely blank out and forget what i'm doing), but it has more to do with needed full concentration on each and every reset.

speedfaces
Bug Catcher
Posts: 22
Joined: Wed Apr 15, 2015 3:35 am

Re: Guessing IVs on Generation 3 early

Post by speedfaces » Wed Apr 22, 2015 1:57 pm

roushmore917 wrote:I'm actually finding my method to work quite well for me.

When I've been doing my runs with my new method, I find that I can hit my frame roughly 1 out of 5-6 GOOD tries at it (i.e. when i don't absolutely blank out and forget what i'm doing), but it has more to do with needed full concentration on each and every reset.
I'm finding that with my ruleset right about 1 in 5 or 1 in 4 (depending on how restrictive the rules are) Mudkips are runnable anyways. So the goal is to get a significant enough improvement on those odds to make RNG manipulation worth using. If you're having to reset 5 times anyways, you're not getting many resets saved by the prediction.

Code: Select all

TID 13769: 159 total good Mudkips out of 800 : 19.875%
TID 01234: 176 total good Mudkips out of 800 : 22.0%
TID 12345: 177 total good Mudkips out of 800 : 22.125%
Ninja edit: Exarion's suggestion to add a rule that +atk natures need only 3 atk IVs adds a little less than 5% to these numbers, as expected. So 1 in 5 odds is actually a slight drop over just normally resetting (assuming perfect knowledge of the Mudkip's IVs, which my previous program should usually provide anyways.)

speedfaces
Bug Catcher
Posts: 22
Joined: Wed Apr 15, 2015 3:35 am

Re: Guessing IVs on Generation 3 early

Post by speedfaces » Wed Apr 22, 2015 4:19 pm

Sorry for the double post, but here's another update to my program: https://mega.co.nz/#!IhZ2xQKb!JxJQaGhuz ... MZvcxJML_I
Example output: http://imgur.com/HMdiFFo

So basically what's going on here is that it finds the two (adjacent) clusters and their linking "void" with the largest size that also satisfies the "richness" constraint. "Richness" just means the likelihood of picking a good Mudkip if you're inside that frame window. For this program, I used 45%, though when I add a UI I'll let the user input that. It prints all the Mudkips (with a *** at the end if it's a good one,) then it prints their stats at level 5 so you can easily tell if you've got one that's been deemed runnable.

Note - I still haven't figured out how I want to get rid of ones with mediocre attack and nothing else to make up for it, so some of the "runnable" ones might be sorta bad. But this should be good enough for anyone who wants to test it out while I finish something up.

Also note, my example output is actually a relatively small window. TID 01234 gives a 39-frame window, TID 12345 gives a 35-frame window. So it will obviously have a significant amount of variance between runs but should help get resets down closer to 50%.

Also also, let me know if this is becoming too specific to Emerald and I'll move it to that subforum.

Exarion
Cooltrainer
Posts: 249
Joined: Thu Jul 17, 2014 10:07 am

Re: Guessing IVs on Generation 3 early

Post by Exarion » Wed Apr 22, 2015 11:09 pm

Looks good. I think what might be best in the end -- and tell me if this isn't possible -- is to allow the runner to adjust the criteria for finding the "best" cluster. There could be options for "smallest acceptable window" and "worst acceptable Mudkip."

So a runner like me (who doesn't like resetting and doesn't mind taking average Mudkips) could make the smallest window 8 frames and allow 25% of Mudkips. A runner like Roush (who doesn't mind resetting and has higher standards for Mudkips) could make the window 4 frames and allow only 15% of Mudkips.

Also, while the Lv. 5 stats might be helpful for new runners, I think they make the cluster harder to read for experienced runners, who already know the IV ranges for every possible Lv. 5 stat. So having an option to turn off Lv. 5 stats would be nice.

Also, would it be possible to add a frame to time converter? When I tried this manipulation in runs two days ago, the hardest part was figuring out which hundredth of a second I needed to aim for, and then trying to hit that hundredth. If the program could show the time next to the frame, that would allow the runner to spend more time analyzing the Mudkips (in order to decide where to aim within the cluster).

Thanks for all the work you've put into this. Seems like we're making a lot of progress.
Twitch channel: http://www.twitch.tv/exarionu
Pokemon Red speedrunning guide: http://pastebin.com/CkVA5yvJ

speedfaces
Bug Catcher
Posts: 22
Joined: Wed Apr 15, 2015 3:35 am

Re: Guessing IVs on Generation 3 early

Post by speedfaces » Thu Apr 23, 2015 12:04 am

Sure, that all makes sense. I was wondering if I could get your help with the frame->time conversion, though. I don't know when the frames start ticking relative to when the timer starts.

Exarion
Cooltrainer
Posts: 249
Joined: Thu Jul 17, 2014 10:07 am

Re: Guessing IVs on Generation 3 early

Post by Exarion » Thu Apr 23, 2015 12:55 am

I believe the frames start ticking when you select "OK" after putting in your trainer name. However, I'm not sure how the frames progress from that point. I think there is some variance in whether it advances 1 or 2 frames at a time, which is based on things like NPC movement. Anyone else have a good answer to this?
Twitch channel: http://www.twitch.tv/exarionu
Pokemon Red speedrunning guide: http://pastebin.com/CkVA5yvJ

speedfaces
Bug Catcher
Posts: 22
Joined: Wed Apr 15, 2015 3:35 am

Re: Guessing IVs on Generation 3 early

Post by speedfaces » Thu Apr 23, 2015 1:59 am

Exarion wrote:I believe the frames start ticking when you select "OK" after putting in your trainer name. However, I'm not sure how the frames progress from that point. I think there is some variance in whether it advances 1 or 2 frames at a time, which is based on things like NPC movement. Anyone else have a good answer to this?
I assume someone like MKDasher or another emu wizard would have a pretty good idea, but it could be hacked using my old program. Just check Trainer ID, grab Mudkips, mark the time you grabbed when you watch the recording, and look at the frame it's on. I doubt I can do the movement well enough to find the starting time/frame matchup myself very quickly, though. I'm really bad at games.

E: Based on my limited understanding, I believe that using start menu effects frame rate, which is why I think there's going to be significant variance.

MKDasher
Schoolkid
Posts: 41
Joined: Fri May 02, 2014 5:31 pm

Re: Guessing IVs on Generation 3 early

Post by MKDasher » Thu Apr 23, 2015 5:47 pm

Frames start counting when your trainer name's screen fades off. Then RNG advances only once each frame except for a few cases:

- Whenever a NPC moves, RNG advances one extra cycle.
- When you close a menu (bag, pokemon, trainer menu), RNG advances one extra cycle. It doesn't when you open it.
- Just before you appear inside the truck (during the fade off), RNG advances around 40-43 extra cycles.

The variance between each attempt is usually less than 10, so it should be possible to do a frame -> time conversion with trial and error on GBA (Emulator timing isn't accurate enough I guess).

User avatar
roushmore917
Schoolkid
Posts: 40
Joined: Thu Jul 31, 2014 8:14 am

Re: Guessing IVs on Generation 3 early

Post by roushmore917 » Thu Apr 23, 2015 10:28 pm

I've found that my variance in timing is usually between 55-65 frames... so I usually just make my final input about .9 or .8 seconds early on timer.

Post Reply

Return to “Generation 3”

Who is online

Users browsing this forum: No registered users and 1 guest