• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Please note that users with less than 6 posts will have their threads/posts go to the approval queue if it has links or messages. This counts edits made to threads/posts after they were already approved and is intentional anti-spam behavior that is unfortunately necessary. Once you reach 6 posts, this will no longer occur.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Crystal hack: Pokémon Polished Crystal (update 2.2.0)

  • 52
    Posts
    7
    Years
    The game corner had dropped coins in the floor in the kanto games. Can you bring them back for polished crystal? For some odd reason I liked them being there :P

    Also, adding something like the habitat list from black 2/white 2 (and rewards?) would make the game feel even more complete.
     

    Splash

    But nothing happened.
  • 658
    Posts
    14
    Years
    You have some pretty ambitious TODO list right now, I'm especially looking forward to the
    Spoiler:
    keep this up! Good Luck!
     
  • 755
    Posts
    7
    Years
    • NY
    • Seen Oct 9, 2023
    Cut trees are now permanently removed when you cut them down. (This meant changing them to use sprites like rocks and boulders, instead of tiles like whirlpools. They moved up a few pixels but otherwise look the same.)

    Pokémon Polished Crystal (update 2.2.0)


    The game corner had dropped coins in the floor in the kanto games. Can you bring them back for polished crystal? For some odd reason I liked them being there :P

    Also, adding something like the habitat list from black 2/white 2 (and rewards?) would make the game feel even more complete.

    I liked RBY's hidden coins too. Not sure how many Crystal hack players would bother looking for them, but yeah, I could add some.

    Something like the habitat list or DexNav... maybe. I'd have to hard-code consolidated lists for each location of the Pokémon available from grass, Headbutt trees, fishing, Surfing, and smashing rocks, and design a good UI for it in the Pokédex. I'll consider it for 4.0.
     

    Adammac

    Linux user
  • 44
    Posts
    17
    Years
    Hello, I noticed that AI is pretty stupid when it come to Baton Pass. AI trainers love to use this move even it makes no sense at this time. They even use it when current Pokemon is their last and then move fails. Sometimes they switch to Pokemon just to use baton pass.
     
  • 755
    Posts
    7
    Years
    • NY
    • Seen Oct 9, 2023
    Hello, I noticed that AI is pretty stupid when it come to Baton Pass. AI trainers love to use this move even it makes no sense at this time. They even use it when current Pokemon is their last and then move fails. Sometimes they switch to Pokemon just to use baton pass.

    Are you using 2.2.0? That update might have fixed it. If not, 3.0 is changing how the battle engine's switching code works, so I'll check for this bug again.
     

    FIQ

  • 251
    Posts
    11
    Years
    • Seen Sep 15, 2022
    Are you using 2.2.0? That update might have fixed it. If not, 3.0 is changing how the battle engine's switching code works, so I'll check for this bug again.

    The problem he/she states seems to be AI-related though.

    There is "smart" (not very, but better than randomly picking moves) AI for Baton Pass, but IIRC it is just for checking for harmful statuses (to prevent use.
     
    Last edited:
  • 755
    Posts
    7
    Years
    • NY
    • Seen Oct 9, 2023
    The problem he/she states seems to be AI-related though.

    There is "smart" (not very, but better than randomly picking moves) AI for Baton Pass, but IIRC it is just for checking for harmful statuses (to prevent use).

    I haven't modified the "smart" scoring for Baton Pass—none of the edits to scoring.asm would seem to affect this—so if it's an AI bug, it wouldn't be in that area.
     

    FIQ

  • 251
    Posts
    11
    Years
    • Seen Sep 15, 2022
    I haven't modified the "smart" scoring for Baton Pass—none of the edits to scoring.asm would seem to affect this—so if it's an AI bug, it wouldn't be in that area.

    What I'm trying to say is that I don't think there is any direct issue here -- rather that the AI just sucks.
     
  • 755
    Posts
    7
    Years
    • NY
    • Seen Oct 9, 2023
    What I'm trying to say is that I don't think there is any direct issue here -- rather that the AI just sucks.

    Aha. That wouldn't surprise me. :)

    AI_Smart_BatonPass is supposed to: "Discourage this move if the player hasn't shown super-effective moves against the enemy. Consider player's type(s) if its moves are unknown." Sabrina has the AI_SMART flag, so I'll test against her later and see if it really is discouraged.
     

    FIQ

  • 251
    Posts
    11
    Years
    • Seen Sep 15, 2022
    The 2gen AI sucks.
    * Why use Waterfall twice, *then* Dragon Dance?
    * Why not use the move that deals the most damage among "ordinary" moves?
    * Why use moves that are certain to fail instead of switching out?
    * Why use recovering moves at full HP?
    * Why not account for Speed in 2-turn moves?
    * Why does only Razor Wind check for potential of opponent Protect?
    * Why heal up when the opponent deals >50%?
    * Why use offensive status when an actual move can kill?
    * Why be greedy and setup on certain death?
    * Why spam Hail (I think I fixed this for 3.0)?
    * Why not almost always switch out on Perish 1?
    * Why is almost every move scoring system depending on randomness, ruining any potential strategy in practice due to 4 move slots?

    This is why I never complain on the in-game AI decisions because it's simply not worthwhile to look into or such, as long as it isn't doing things that are obvious stupidity like using moves that will obviously not work. Hell, even 7gen AI suffers from the issue where GF seems to not reuse failure logic between AI and actual battle, as can for example be seen by the AI spamming weather moves if Cloud Nine is active because it checks if weather is up by using a routine that suppresses that info if Cloud Nine is active...
    There is a reason I want to rewrite it in the long run :p

    EDIT: AI_Smart_BatonPass should simply just check if it has positive status to pass, otherwise discourage it. The thing it does now should rather be used in switch handling (which I think is already the case), and if the AI decides to switch, it should prefer Baton Pass unless negative status or it's outsped.
     
    Last edited:
  • 755
    Posts
    7
    Years
    • NY
    • Seen Oct 9, 2023
    Stupid AI + randomness = stupid AI with a chance of being smart. :P Also makes it less predictable.
     
  • 171
    Posts
    11
    Years
    Creating a competent AI system for such a complex engine can be really hard. No matter how hard you try, you're never going to come close to the long term thiking and predictions that a human player can make. In addition, if you try too hard to make every decision the best one by the numbers you run into the risk of making the AI repetitive and predictable. Imho, some level of randomness and "imperfection" is necessary in order to compensate the variability in decision making and in knowledge/expertise of a human player.

    For example, when would Dragon Dance be the preferred move over attacking with Waterfall? From the AI's point of view, you could say that whichever combination outputs the least number of turns to KO the target. Let's say I'm the AI. How do I know the exact stats of the target? By blatantly cheating in order to compensate my other disadvantages compared to a human? Should I be intelligent enough to be able to estimate them or fit them into a certain range every time an attack deals damage?

    Aside from that, what if the target decides to switch out at some point? What if the target can raise its Defense or Speed stats? What if the target can recover HP? What if the target has a move able to for example paralyze, burn, or sleep you? What if the player may use a healing or stat boosting item? How can you measure or predict the way that the player may use any of these options available to them? What if the player can KO you in one hit? What if the player has the potential to KO you in x hits, but you should not know what x is because the moves have not been revealed? And even if you did, how do you measure if the player is going to be intelligent enough to take the most efficient route at KOing you? How can the player's decisions be affected by your own actions?

    If you try to consider all the possible factors in order to come up with the mathematically best play, you're going to be overwhelmed. As a consequence, while stat modifying moves should be favored before attacking, a well made AI should still allow the Waterfall+Waterfall+Dragon Dance kind of sequence to happen occasionaly, and the same could be said about most of the other points that you mentioned.

    Not only that but I don't think that a good AI should necessarily aim for perfection. Just like human players could have less or more experience or knowledge, I don't think that a youngster in the first route should be able to always perfectly time his Rattata's Tail Whips and Tackles in order to KO your Pokemon in the least number of hits.

    My point is not to defend the Gen II AI; in fact, I think that for the resources that were spent in writing the AI engine, there are a few things that could've been done a bit better. But for the most part, the possible improvements that could be made are all related to the AI not being able too look at the bigger picture, and would therefore involve getting into a significantly higher level of complexity in order to account for a wide range of outcomes comparable to the ones that I mentioned above.
     

    FIQ

  • 251
    Posts
    11
    Years
    • Seen Sep 15, 2022
    I have personal plans for rewriting the 2gen AI at some point. I am aware of most/all things you mention. There is a few things in particular I want to address in your post, because otherwise my current plans aren't set in stone:
    * Gen II AI in particular is very poor at making good decisions. I am not aiming to create an AI capable of playing at VGC level or similar, but the current AI just sucks. For instance, the 7gen AI isn't much more complicated (it just has a lot more conditionals) but it plays far better -- it still does some stupid decisions, but almost all of them can be amounted towards mistakes in logic that is trivially fixable. For example, I've followed TPP Sun and other playthroughs, and almost all AI failures is stuff like not knowing how Cloud Nine works, using a strictly inferior move (The AI doesn't understand multi-hit moves + Skill Link or how Weather Ball works and low-accuracy moves seem to confuse it), using harmful moves on allies (2nd stage water starter has a move that deals major damage but heals burns, the AI considers this a helpful move), etc.
    * In my rewrite I intend to make the AI conditional as a start. If this results in a "boring" experience as a player, it can be tweaked over time to potentially fuzz use of several near-optimal decisions
    * I have also intended to let the AI know player stats and moves. My reasoning:
    - People spoil themselves over enemy teams ingame all the time. What prevents NPCs from scouting you?
    - Stats: Polished Crystal only really have one thing that matters: Nature. If feasible, one could make the AI assume max EVs, IVs but neutral Nature until particular conditions are met (did it outspeed while assuming the opposite/vice versa, did something deal more/less damage than it should)
    - (Mostly relevant for moves) I don't think creating either a move prediction system or a database a la Smogon is feasible within 2gen
    - Rangi has expressed dislike for this approach. I suppose I could at least attempt a simple lookup of move availability and predict based upon that and see if it is actually feasible/worthwhile.
    * For "newbies" (youngsters, etc), I already have an approach in mind for these:
    - Enemy AI has 3 settings that can be tweaked: how much should it switch, how likely should it replace its chosen move with a random move, should this randomness avoid moves that is certain to fail
    - With this, you could make people like Joey have a 50% randomness factor and not avoid moves that fail (and perhaps for later fights, reduce randomness and/or check for failure)
    * Generally, I intend to make the AI look at its own moves and enemy moves (or predicted moves if I make it not cheat), figure out who is killed first assuming optimal play from both sides judged by AI and switch/choose based upon that
    * It is worth mentioning that as of Generation V in-game AI does actually cheat -- it always know Levitate even if not supposed to/etc, and it uses enemy stats when calculating move damage.

    EDIT: I also don't think I'll bother taking player item usage into account at all, because it opens a new can of worms entirely and players sometimes doesn't even want to use certain items. Potentially as an exception, if the player did use an item and it screwed with enemy assumptions, consider if it will use the item it just used again to possibly counter PP stalling.
     
    Last edited:
  • 755
    Posts
    7
    Years
    • NY
    • Seen Oct 9, 2023
    It is worth mentioning that as of Generation V in-game AI does actually cheat -- it always know Levitate even if not supposed to/etc, and it uses enemy stats when calculating move damage.

    If even the official games resort to that kind of cheating, then I'm fine with it. Just not blatantly unfair things like knowing how long sleep will last or whether a move will miss, i.e. predicting the RNG.

    Edit: Some items and abilities could have simple special-case logic, like Air Balloon and Levitate.
     

    FIQ

  • 251
    Posts
    11
    Years
    • Seen Sep 15, 2022
    If even the official games resort to that kind of cheating, then I'm fine with it. Just not blatantly unfair things like knowing how long sleep will last or whether a move will miss, i.e. predicting the RNG.

    Edit: Some items and abilities could have simple special-case logic, like Air Balloon and Levitate.

    Take a look at AICompareSpeed. While CheckSpeed there is part of my speed handling refactor, it essentially did the same thing beforehand -- checking player's raw speed stat against its own. Just saying :p

    Air Balloon in particular is announced similar to Pressure/Mold Breaker/etc, so "cheating" that isn't actually cheating.

    EDIT: Any and all potential AI cheating I would do in a rewrite would be purely information related. Knowing RNG outcomes introduces very strange behaviour and blatant AI cheating and simply isn't fair. Stadium AI does this, but I don't want to go there. I want the AI to know sleep duration for Rest, but otherwise not know it more than a player would (e.g. the AI should know when a mon is certain to wake up (3rd turn) or not (0th turn) but not otherwise)

    Generally, the way I intend to make the AI check for failure logic is by using actual battle engine commands. This automatically resolves things like accounting for Flash Fire, Levitate, Air Balloon, type matchups, status when enemy is statused, etc. Possibly running the logic more than once (say, 10 times) to account for potential randomness (like Protect failing).

    EDIT2: OK, I took a look at that article. Only one part of it is actually true, and only partially -- It knows in advance how much damage its attack will do. The AI since gen IV apparently (I thought it was gen V), uses damage calculation formulas to figure out what to hit you with for the most damage. If a move can kill, it will go for that move, and if several can, it seems to pick at random (hence the Quick Attack). Note that the AI seems to assume 100% damage (when the actual range is 85-100%), so the AI can fail if the faint depends on a roll.
    I have seen sleeping AIs use Sleep Talk when they're about to wake up, in generation IV. And they certainly don't use Protect in the way the article describes (which isn't even optimal play, and you'd think if GF wanted to cheat by looking at what you will do, they would actually do the optimal decision...)
     
    Last edited:

    Linnie

    Mmmmmmmmmmmmmmmmm
  • 40
    Posts
    10
    Years
    • Seen Jan 16, 2022
    - (Mostly relevant for moves) I don't think creating either a move prediction system or a database a la Smogon is feasible within 2gen
    - Rangi has expressed dislike for this approach. I suppose I could at least attempt a simple lookup of move availability and predict based upon that and see if it is actually feasible/worthwhile.
    If you want to make it semi-realistic, maybe only have it check level-up moves, and not know Egg or TM moves until the player uses them.
     
  • 52
    Posts
    7
    Years
    If you want to make it semi-realistic, maybe only have it check level-up moves, and not know Egg or TM moves until the player uses them.

    And also you can make the more experienced trainers (Gym Leaders, Veterans, Elite Four, etc) check some Egg and TM moves from the start (they are supposed to have more experience).
     
  • 10
    Posts
    7
    Years
    • Seen Jul 4, 2018
    Any ETA on V.3.0.0? Looking forward to it! All the changes you've made are fantastic!
     
    Back
    Top