jojobear13 / shinpokered

Mostly-vanilla hack of Pokémon Red/Blue focused on bugfixes and trainer ai
209 stars 42 forks source link

Tiny request regarding Old Rod. #255

Closed DiabloStorm closed 12 months ago

DiabloStorm commented 1 year ago
  • The Old Rod now randomly acts as a Good rod 50% of the time.

Would it be possible to implement a toggle to turn this off?

The reasoning is purely personal preference, as I think goldeen/seaking are immensely less relevant than Magikarp/Gyarados.

I'm trying to DV farm a magikarp and all these goldeen are just getting in the way. (yes I'm ignoring that seller that gives me the 'karp with DVs skewed higher, I don't feel like using that, or m.gene, or punnett square, it feels too much like cheating as I want to find my own with the intention of potentially transferring to gen 2 where the DV battle this game provides isn't present)

Anyway, if this were to change, I'll likely have found my magikarp before then, but having more options is generally nice.

DiabloStorm commented 1 year ago

Yeah... bgb00007 (3) quite literally minutes after posting lol

jojobear13 commented 1 year ago

The current dev build reworks some things.

Here is how it’s working in 1.23.11.

The Old Rod can fish up two kinds of pokemon (depending on the current map).

  • Magikarp or Goldeen
  • Magikarp or Poliwag

This works by expanding the fishing list.

What if I expanded the old rod a little more so that some maps will only give magikarp?

Let me see if I can make it so that holding B during the fishing delay hooks magikarp only.

EDIT: Oh hey, that works pretty good. If I press and hold B within about a second of using the old rod, it will only hook magikarps. It pairs nicely with the hotkey for fishing by holding A+B and pressing SELECT.

DiabloStorm commented 1 year ago

That's alright, and so was your previous (crossed out) idea. The previous one could be expanded to regain the previous function of good rod also. I admittedly have not fished much up until now with various rods (within this hack anyway) but my understanding is that it's an expanded list of 8 for good rod, which in my specific circumstance, if i was looking for a specific pokemon with specific dvs, the encounters would be more saturated than before with pokemon you aren't looking for. If there's similar value in the original super rod then maybe that too.

I also fished in the secret diglett cave hoping something was there, but nope. Maybe a prime area for your crossed out idea to avoid disturbing the other areas? Or maybe it should be not hidden and more accessible. I'll leave it to your discretion. Or...

Secret idea inside You could make it so that there is a chance to fish dratini from there that can learn fly as dragonite, as per that other suggestion thread. first time fishing there: "There doesn't seem to be anything here." 2nd time "There still doesn't seem to be anything here." 3rd time "..." and then maybe dratini show up on attempts 4+? idk. seems like something could be done with the water in there, ~~maybe post E4.~~ actually, thinking about it, you can't access there until you have surf (and have thus gone through safari zone anyway where dratini are) maybe just alter the capture rate so it's not an easy option vs safari zone. Considering the surfing pikachu/ss anne tournament you kinda already did this concept. You just alter the capture rate (skewing towards harder to capture?) and have it so that it can learn fly? (Based on the new capture rate)
Side question Was anything changed with dv spreads for fished pokemon? I ask because it's either my hunting technique, luck, or possibly the game, but it takes so much longer to get nice DVs for fished pokemon. After dv hunting many pokemon, Staryu by far took the longest (multiple days) and I still kinda ended up with "Eh, it's usable here" These 4 are the only ones with 11+ in the relevant stats when I really wanted 13+ XD ![staryu](https://user-images.githubusercontent.com/63818362/215294276-7e29c4a0-a44f-44a4-92f5-d6c8f97273ad.png) I'm just hoping something wonky isn't happening around the rt 20/missingno areas where pokemon like Staryu (and now i'm after horsea) are basically limited to. Fishing inherently takes longer, but I've even tried the areas where I can literally ride a bike on full speed to get encounters. (inside seafoam islands to try and bypass the fishing wait) I'm hoping, besides the changes I'm aware of (all 65535 DVs possible, m.gene, punnett square, gift/prize DV skew, post E4 safari zone dv skew, L100 chansey) everything else was left vanilla? Speaking of which, what went into unlocking all 65535 DVs? Did changing this affect odds more than one should expect? I wish I knew more about this, but I see tidbits of info on smogon, pokemon like gengar and golem were unable to be acquired with perfect DVs "legally" it seems? IDK if there were any others or if you know more about this in detail. Unrelated but, I just thought of this...why was fishing removed from Lorelai's area? I was actually going to use it to save on potions and use recover but discovered the fish were removed, was it to prevent that? lol
jojobear13 commented 1 year ago

Okay, so here is how things work in Vanilla:

Unrelated but, I just thought of this...why was fishing removed from Lorelai's area? I was actually going to use it to save on potions and use recover but discovered the fish were removed, was it to prevent that? lol

See my bold above. Lorelei's area works with Old and Good rods because they generate encounters straight from their execution, but her map doesn't have a Super Rod group assigned to it.

It really looks to me that Gamefreak spent all their effort on implementing the Super Rod and the other two were afterthoughts.

Here's how it works in my dev build as of commit adbdd98595eeea80918322ebb44fd1caf774877b:

Was anything changed with dv spreads for fished pokemon?

No. Fished pokemon are treated the exact same as wild encounters except for some slightly different battle text. RNGesus giveth and RNGesus taketh away.

I'm hoping, besides the changes I'm aware of (all 65535 DVs possible, m.gene, punnett square, gift/prize DV skew, post E4 safari zone dv skew, L100 chansey) everything else was left vanilla?

Yeah, I think that's everything.

Speaking of which, what went into unlocking all 65535 DVs?

Trashing Gamefreak's RNG function and implementing something else. Here is all the code that Vanilla uses to get a pseudo-random number. There is also a video by Crystal_ that explains in detail. Basically, it reads the Gameboy's divider register for a random value and then subtracts that from its last value to get a second random value that quickly becomes uncorrelated. It's fast, it's light on memory, and it's "good enough" assuming that there is some entropic factor between updates (like the time between button presses) and you think that people will never figure out that DVs exist (reasonable in a time before widespread datamining of games on the internet). The problem is that successive calls for random numbers with no entropy in-between quickly make the results settle into a predictive pattern where certain outcomes become impossible.

For a long time the solution I had was to switch to the RNG engine used in the Polished Crystal rom hack by Rangi42. It worked well, but I felt it was a little too over-engineered for my purposes. For example, there's this whole feature it had (which I never activated) that queues-up random numbers so that you cannot scum with save states. As of the v1.23.09 beta, I switched to a Marsaglia XOR-Shift RNG method that was adapted by Patrik Rak for Z80-style CPUs and released into public domain. It's a much lighter, faster, and more streamlined method that uses four different seed values.

For seed values, I read four HRAM locations when the game first starts. On real hardware, these values on first boot are random due to the nature of semiconductor physics (even being affected by the ambient temperature). Some emulators, like BGB, replicate this by populating the emulated RAM with its own pseudo-random number generator. Most emulators don't and just zero it all out on startup (breaks things because all-zero seeds are not valid), so I made sure to always change a seed value of $00 to $01.

DiabloStorm commented 1 year ago

Interestingly smogon had a link to a chart and a tool showcasing area "encounter slots" (rates?) and now i'm wondering if someone somewhere compiled something like this for gen 2 because now I'm curious if there are limitations there as well but I can't find any resources, and any attempt to google up "encounter rates" for gen 2 seemingly doesn't yield the type of "encounter rate" i'm referring to here.

Mkay, I guess I just needed to search encounter slots. derp. Now to find a similar tool to see dv spreads tho...

jojobear13 commented 1 year ago

The "Hold B" solution is now in commit adbdd98595eeea80918322ebb44fd1caf774877b

As for gen 2, smogon has some chatter about it also having the same issue.

jojobear13 commented 1 year ago

beta patches 1.23.12 are uploaded which addresses this issue and a bunch of others made since Nov 2022.