hey peeps! thanks for the additional context for lorelei’s AI, actually had no idea that line of code that disregards type effectiveness 40% of the time was meant as a patch for Red/Blue - had not seen the pikasprey vid on lorelei either before this so thanks for the recommendation, was a fun watch! my research is almost always done from the speedrunning perspective primarily so I appreciate you guys filling me in on the full picture. regardless, hope you enjoyed the video!
Yeah, the youtuber by the name of Pikasprey Yellow made a video covering the issue with Lorelei's AI in pokemon red/blue if you do specific things. Here is the link to that video here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-CClsivwN8aw.html I do want to say that I am not some alt account of Pikasprey trying to plug his video or whatnot. I just think that it is a good video which goes over exactly why this change was made to Lorelei in Pokemon Yellow
@@dontspikemydrink9382the text box that states if an attack is super effective or not very effective is bugged in Gen1. It only takes the first type of dual types into account. So a poison/grass type being hit by a poison move will get the text "not very effective", while a grass/poison type will get the text "super effective". But the damage calculation is done correctly, so it's only the text that's bugged
Lorelei's AI modification is actually a patch added in Yellow to prevent a potential softlock where if you send out a fighting- or poison-type pokemon her AI will start spamming rest because it sees that psychic is super effective. Since RBY trainers never run out of PP if your only pokemon is of those types and isn't able to do enough damage to KO the Dewgong before rest's sleep duration ends you'll be locked in an unwinnable battle.
@@jaybeans981 Either they didn’t know how to implement that, were worried that if they did that it’d cause more glitches, or they just didn’t have enough space.
To clarify, it's only a softlock if you use the move Rage That makes the user automatically attack either until it's knocked out or the fight is won, with the player unable to control anything else, so if it can't take out Lorelei's Dewgong, and likewise it won't take out the user, the player is softlocked Otherwise, as long as the player doesn't have every single one of their Pokemon meet the criteria [Poison or Fighting, too weak to take out Dewgong, and knowing Rage], worst case scenario is they can just have all their Pokemon be knocked out from Struggle, because PP is only infinite for the AI, not the players And on that note, I should also mention Rage's PP only depletes from the initial use, it will not deplete further as the move goes on, and the only way to use a point of Rage without getting locked into it is if it misses the initial hit, usually due to the 1/256 Miss bug Another RU-vidr, Pikasprey, has actually made a whole video about this softlock and how, because of that miss quirk, you could _technically_ escape this with an amount of luck so low it's mathematically considered impossible
5:07 it’s to prevent an infinite battle from occurring. If one were to fight Lorelei with a pure fighting type in R/B, she would be locked into rest, which if the fighting type uses Rage, causes a softlock.
Not true, you can miss rage every turn due to the 1 in 256 glitch so technically it’s not a softlock. The odds would be between 256^20 and 256^32 depending on PP Up usage, but it’s mathematically possible nonetheless :)
Could it have been to prevent dugong from being locked into rest? I do remember as a child using poison pokemon against anyone with rest since they will just let me set up as they spam rest since it reads it as psychic vs poison, but that could also just be me remembering it wrong 20+ years later.
partly correct. pikasprey explained in his video a good way that if a poison or fighting type gets trapped in an endless move like rage the battle is basically endless. the video: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-CClsivwN8aw.html
There's other videos that get into this more, but yes. By the time they made Yellow, they realized how nonsensical the "good AI" was, but it wasn't causing any major problems except for Lorelei getting into an infinite loop of resting _forever_ against the player if they're using a poison type, causing a softlock.
Many people here have already identified the reason Lorelei was given this quirk: it's because if a Fighting or Poison type Pokémon is brought in, Dewgong will only Rest, potentially soft locking the game if the player uses Rage. That being said, I feel like there are better ways Game Freak could have fixed this than a random chance of ignoring type effectiveness. A better idea might have been to just exempt status moves from the type effectiveness check altogether, at the AI level where certain turns give status moves priority. They might have had to tweak the AI so there are multiple status turns, rather than just turn 2, but that would have been a more elegant fix.
I don't know anything about coding so I could be way off on this but my assumption is that their wasn't enough space on the Gameboy color cartridges to add a more elegant fix so they resorted to this messy fix instead.
@@theaconite1400 there wasn't enough room, but it wasn't the cartridges fault, the team working on gen 1 were just worse at optimising their code than the B team in gen 8. That's why GSC was able to fit twice the content, they learnt how to make their code less bulky and also improved their organisation structure to make it so that they could do things much faster (and not screw up the type effectiveness chart).
@@theapexsurvivor9538 Not quite twice the content. Kanto was kinda stripped compared to RBY and it used a lot of the resources that were already in Gen 2. Also, Gen 1 was made as a passion project done by the team in their spare time... and they didn't have a lot of spare time and they had to rush in the very end or their hard work would be dumped.
Good AI was likely removed from Surge's Raichu to make it easier to defeat when you are using a Pikachu. Good AI was likely removed from trainers like Blaine and Sabrina to prevent them from using some truly terrible moves over and over. Blaine with Good AI will have his Arcanine spam Reflect against Psychic and Fighting types. But without Good AI he has a chance to attack and do damage! Sabrina's Alakazam would only use recover if you sent a Psychic type in against it if she had good AI. So removing the AI from these trainers actually makes them slightly stronger (but less predictable) in the majority of cases. Lorelei's Dewgong is given this modification to prevent the softlock that Pikasprey Yellow discussed awhile ago. As Rest is a Psychic move Dewgong will only use it against Fighting Pokemon and if you save in her chamber and can't knock Dewgong out then you can never leave. Having the Dewgong use other moves allows the player to eventually progress.
@@ladyriethegoldendelmo5441bear in mind that Pokémon Yellow was made to capitalise on the anime, so the developers expected players to try to imitate Ash and use Pikachu on every battle despite being a terrible choice. To keep Pikachu in a protagonist role in the game, they nerfed some fights to make it seem less weak than it actually is
As for Sabrina, I say being random is not really to her benefit. Sabrinas only good moves on her two Pokemon (I am not counting Abra) is psychic, with psywave being hot garbage. Add in the fact that she uses X Defense and Sabrina only has a 20% chance to use her only threatening move on the player. Having fast but frail Pokemon, every turn for Sabrina counts and she has in other words an 80% chance of wasting it. Thankfully, in gen 2, they fixed the AI and made it much more intricate, with it often now checking for the most damaging move possible among many other things which would have been a godsend for Sabrinas AI or any other trainer for that matter.
The reason for the special AI for Surge in Yellow is because he wouldn't use Electric attacks against Pikachu but they wanted that as an option. Lorelei had the special moves because she would always use rest against poison types
Someone may have already posted this, but this fix was implemented because Lorelei got enraged by a Primape and got really drunk because Dewgong was asleep.
The easiest way to have fixed the 'AI thinking status moves are attacks' issue would be to make all status moves Normal type, that way the Rest lock would never occur. Likewise, and with a bit more code, all status moves are given special flags that state non-damaging, and the AI will prioritize damaging moves.
I wonder how Pokemon are assigned each of their movesets. If moves are organized or distributed on a pattern or formula, maybe making them Normal Types would prevent some Pokemon from learning them. It would also mean an AI would never use Status on a Ghost type.
It doesn't even need to be that complicated. The game already checks whether attacks are actually damaging when determining whether to avoid not-very-effective moves (only avoid them if there is an available damaging move of a different type). There's no room to add a flag for non-damaging moves, but there doesn't need to be- it just checks whether the move has 0 base power.
@@Soumein Learnsets were/are designed by hand, so no issues there. Besides, Gen 1 was kind of notorious for incredibly shallow movepools- most, if not all, pokemon learn at least one normal type move.
This brings me to a question I've been thinking: Why do healing/self-buff moves have a type in the first place? If the move targets only the pokemon that uses it, the type shouldn't matter in any situation. is it just for flavor or is there an actual reason?
Nice video! I like the edits - they're very smooth and nice to look at! Speedrunners holding more and more information about the technical aspects of Pokémon games is probably worth to document more, I feel. I know they have, like, Google Docs on some stuff, but still - nothing wrong with an organized wiki of sorts!
I was doing a Pidgeotto solo run and losing to Lorelei over and over, but then I started to notice her using Rest on most 2nd turns and made a strategy around that, use Fly to avoid first hit, 3x Agility for badge boosts, the knock out her team with Double Edge.
Same, I been recently trying to see how low level you can beat the Red/Blue Elite 4 with each pokemon solo and itemless, and realized that when I also got to the Pidgeys. Exploiting that with Fly, Dig, or Sub to get free setup turns became essential to winning with some pokemon.
I thought it was common knowledge that this was put in to prevent the Rest softlock, but it's good to see all the different AI levels explained all at once. Gen 1 is truly… special.
I've heard that the reason some gym leaders had their AI downgraded in Yellow was actually to make them harder. "Good" AI in these games actually tends to be very predictable and exploitable. (See Lance spamming Agility whenever a poison type is in front of him.)
Maybe instead of tinkering with the AI, the developers should have just switched out some moves, which they did anyway for the most part, with Dragonite for example having now all the hard hitting moves of Blizzard, Fireblast, Thunder and Hyper Beam in Yellow instead of Agility. They also switched out some TM's, giving Giovanni the always useful Earthquake TM instead of the nigh useless move Fissure. Sadly, Sabrinas remains stuck with the TM Psywave, a contender for one of the worst moves in the game that clutters her Pokemons moveset.
Recently I saw the ai in silver version do something really really confusing and stupid. I was fighting Karen she had gengar on the field and I had a xatu who used fly against it and was now in the air. She then decided to switch out her gengar which could of ko'ed xatu with shadowball when it landed but instead she decided to switch out into vilepume, which was ohko'ed as soon as it was sent out.
2:58 -- which backs up a point about computers I make. "All queries are answered in the order in which they are received" That's pretty much how all computers work
@@SnoFitzroy it's still hard to softlock. you need a psychic weak pokemon with rage and then also be unable to defeat dewgong with it or any other team member until you're eventually forced to click rage so that you can never struggle to death.
This actually isn’t a bug. This is actually a patch added to yellow in order to fix a nasty situation that could sometimes happen in gen 1. Like you said in the video, the AI has a list that determines what moves are super effective, but the AI doesn’t take into account whether or not that move actually does damage or not. For example the AI will always use the move Withdraw on a rock type Pokémon because water is super effective on rock Pokémon. Even though it doesn’t actually do damage. Because lorelei is one of the few trainers that you can actually re-battle and also one of the elite four members her AI was changed to fix a specific problem that could happen because of that type chart. You see, if you were to enter Lorelei’s battle with a fighting type Pokémon, then the AI would use the type chart to see that psychic is super effective against fighting. And dewgong has rest witch is a psychic type move. So because the AI only sees psychic moves as valid and doesn’t take into account that rest doesn’t do damage the AI will just spam rest. And that might not be so bad but unfortunately there are two other gen 1 things that make it a problem. First is that unlike modern games, in generation 1 of Pokémon, trainer’s Pokémon don’t use PP in battle. Unlike the player who has a limited number of each move per Pokémon the AI can use there moves infinitely and never run out of them. That means that dewgong will never stop using rest and will never run out of rest PP ether. This alone could make the fight impossible if you can’t deal enough damage before dewgong heals with rest. But because you can switch Pokémon that should never happen, right? Well here is another gen 1 specific thing. The move rage works differently in gen 1 compared to all other generations. In generation 1 if you use the move rage in battle it will be continuously used until ether the opponent faints or the user faints. And rage doesn’t consume PP except on the first turn that it’s used….I think you can probably figure out what would happen if a fighting type Pokémon was put against dewgong with rage active? Because rage doesn’t consume PP and nether does dewgong, and because rest is All that dewgong will use. It is possible to soft lock the game into an infinite battle where nether side can win. Because rage isn’t powerful enough to faint dewgong and dewgong will never attack the rage user, It seems that the developers were actually aware that this could happen and that is why they added an exception to Lorelei’s AI specifically. Yes, this can happen with other trainers but for many of them you need specific setups or stats. Plus you can’t re-battle any other trainers except the elite four so the chances of someone soft locking any other battles was really low. But because lorelei is one of the few trainers that you can re-fight and that she is also one of the most powerful trainers In the game. It made sense why the developers would want to prevent her from accidentally soft locking the game. I hope my explanation was helpful, I tried my best to explain it based on what I know of generation 1 Pokémon mechanics.
I'm very surprised you just left it at "it's a mystery" when it seems pretty clear that it's a quick patch to keep her from getting locked into spamming Rest.
I wish you had explained WHY this is the case. Not just say "there's a weird piece of code" without giving any context for what the developers were thinking when they added that code. Seems like other people in the comments know why it's like that. Generally I enjoy your content but I do feel like sometimes you do not go into enough detail and context which often is what makes videos like this actually engaging and interesting. If this was a 10 minute video explaining the potential softlock it would be way, way better. Instead it's honestly not very interesting as presented. I say this constructively! I'm a subscriber, just want you to be the best you can be.
appreciate the feedback! yeah, i guess i just chalked it up to a weird gen 1 coding quirk since the 2nd turn status move rule seemed odd as well. had no idea about the pikasprey vid or I definitely would’ve included more context!
I remember some weird/cool thing, that occured during "Twitch plays Pokemon Red" Elite4. That against Venomoth (?), specific trainer used only Agility, which did nothing (and does not run of out PP, because Gen1 doesn't have that for AI).
I don't know about Blaine, but if Level 3 AI takes type effectiveness into consideration, Surge wouldn't have reason to in Yellow since if I remember right, he only has Raichu. Since Pikachu is the default Starter for Yellow, there's a decently good chance Pikachu would go against Raichu. I'm not sure how that would affect things in actual play, but I could see that being a possible development reason. 🤔
I'd like to see why Blaine uses healing items on pokemon with full hp in gen 1 as well as spam roar with Arcanine. Somethings going on under the hood to make this ex scientist so stupid.
The reason why they added this line of code in Yellow was to prevent a softlock that could happen in Red and Blue. If you had a Pokémon that is weak to Psychic, Dewgong would spam Rest because the AI knows that you're weak to Psychic moves and doesn't know it's a non-attacking move. Trainers moves did not use PP in Gen 1, so if you used Rage (which only uses 1 PP in Gen 1 and the user will keep using it), the battle will go on forever once the user misses since the hit rate becomes ridiculously low if it misses once.
Mmm, level 2 AI isn’t supposed to use the same status move type on the Pokémon with the same status condition? Hmmm, back in gen 5 I remember I fought this one cottneee that used sleep powder 4 times in a row while my dewot was out.
Well first of all, AI has changed a lot over the gens, so gen 5 AI is very different to gen 1 AI. Secondly, if it was a wild Cottonee or being used by a weak trainer class, it was probably just picking random moves. That's like the one level of AI that I don't think has changed from gen 1 all the way to gen 9.
You guys are taking this a little too much to the heart, aren’t you? I’m aware the Ai has changed over the course of many years. If Pokémon really kept the same AI for more then 10 years that would be horrible game design, smh.
yeah you can actually softlock the game by bringing a pokemon weak to psyc, having the seal rest forever, and the your pokemon is level 2. or the lowest level a weakness to it can be. Pokemon in gen 1 apparently always use super effective moves if they see it, even if it's a move that does 0 damage. easiest softlock ever. faint all your pokemon, leave that single one alive, sell all your revives before the fight Use the move "rage" and BOOM. softlock.
....This should have just been titled "how trainer AI works in R/B/Y". The actual subject of this video was said and done in less than a minute, and honestly didn't amount to much of anything at all. "Lorelai's AI is broken because there's a 1.5% chance it'll use takedown instead of the other moves!" ??????
If I had to guess, I’d say Surge doesn’t have “good AI” in Yellow because Yellow is based on the anime. In the show, Ash fought Surge 1v1 with his Pikachu. It’s likely most kids would want to recreate this in their own game, and if Surge had good AI his Raichu would steamroll through Pikachu.
I love the pokemon AI content! I need it for success in the emerald battle frontier so I am super excited for your next video! (Even if it only pertains to frlg)
Another broken AI > Lance's dragonite will not attack tentacool (maybe any poison type? IDK) yesterday I was playing pokemon blue and switched to my lvl 23 tentacool when blastoise fainted to revive it and lance's dragonite never attacked tentacool, not even once. It took a while but I killed it with poison and confusion. Then I tried again another time and it happened again. Lance's dragonite will not attack tentacool.
Everyone who got recommended this video because they watched pikaspray's video: "Well, actually.." RU-vid algorithm: All these people are leaving comments, let's recommend it some more
Is not because it's weird, is because of a rage softlock. If you have a not strong enough fighting or poison type who isn't weak to ice or water, Lorelei's Dewgong will just spam rest, and if you taught it rage via TM then you have to literally delete your savefile because gen 1 trainers don't waste PP and you cannot escape without RNG manipulation. That's also why important yellow trainers either lost their "good AI" or gained movepools without status moves. Dude, i like your content, but this video was quite rough and very uninformed. The yellow AI was modified because of how of a disaster the Red/Blue was at times, both on gym leaders and some elite 4 members.
@UltaFlame It seems fairly unlikely that you'd ONLY have one mon left at the FIRST elite (right after a pokecenter) and said mon ONLY has pp in the ONE MOVE IN THE GAME that would cause a softlock... I might say vanishingly so.
@@gavinriordan9258 Not really. Rage is a TM everyone can learn and you don't need much to beat the RBG campaign. It could be even kinda replicated by Blastoise of all things if things go very wrong because it can only use growl + rest.