• 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?".
  • 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.

[Pokered] Basic Pokered/Pokeyellow info and tutorial links

200
Posts
10
Years
    • He or They
    • Seen Jun 19, 2022
    Why are there exactly 0 tutorials on here for Pokered/Pokeyellow? Not even any links to tutorials! Feeling like they're a little unloved... So, while I am not the best hacker, I compiled this together.

    A Short List of Bases:
    https://github.com/dannye/pokered-gen-II - Dannye's Gen II Red Base
    https://github.com/dannye/pokeyellow-gen-II - Yellow Gen II Sprites, same as above just in Yellow
    https://www.pokecommunity.com/showthread.php?t=361713 - Pokered full color
    https://github.com/TheFakeMateo/rpp-backup - Old repo of Red++ that still uses Red.
    https://github.com/dannye/pokered-crysaudio/ - Pokered with Crystal's audio ported in.
    https://github.com/dannye/pokered-gbc/tree/crysaudio - I believe this is an attempt to combine Crysaudio with full colored Pokered. I am unsure how stable it is however.
    There is also an expansion Red project to get past 250+ mons, but it reportedly has some instabilities. And I think Shin Poke Red is an attempt at making a better battle engine, but I don't know if it uses pokecolor or any of these as a base, so you might simply want to start with one of those and copy any desired code over.
    Warning: If copying code to Yellow you need to be aware Yellow has slightly different flags (usually uncapslocked), though I have no idea if this is still true as of the latest updates, and can be very sensitive, so test EVERYTHING changed thoroughly to make sure the copy over didn't cause crashes. This applies as well to code from Red++; in particular, I found that Yellow is more sensitive to loading new moves, and this causes the otherwise fine move deleter and move adder code to crash AS WELL as possibly the original TM script to sometimes crash if you load a lot of TM move names in a row by hitting 'use'. This might be related somehow to the fact that Yellow has worse/crashy-er Missingnos; it handles memory slightly differently due to being already in color. Or it might be something I altered somewhere wrong, who knows, but in any case, be careful.

    I recommend starting off with using a base such as color or one of Dannye's Gen II Sprite packages, unless you have no plans on adding more pokemon or changing any pokemon's images. Red++ newer versions are moving to Crystal.

    You could also try (try being the key word here because other people have had difficulties getting it to compile) use one of mine if you like Yellow and having Raichu/All Mons Follow: probably the simpler just-151 is what you want because it's more stable / not being actively changed and potentially made unstable, and then look at the other one if you want to figure out how to implement more features. I have a tutorial in my sig for Yellow specifically (which for some reason isn't in this forum, but whatever, not like it matters as long as you can find it). Some people have had installation issues with the modified pikachu sound wavs for Raichu not auto-converting to .pcm for them. You might want to start with the Dannye's Gen II and then just paste the code over; if you still have install issues after that, you may need to replace all the places where it asks for .wav files with .pcm.

    You need some version of these (or did on the last version I downloaded):
    https://github.com/bentley/rgbds/releases
    which should do things like said auto-conversion of wav files.

    https://cygwin.com/install.html

    and while I recommend checking the readme of the latest pokered or yellow or whatever for the actual listed packages there, you'll probably want to make cygwin with these packages at a minimum:

    make
    git
    gettext
    python
    python-setuptools


    Some useful resources:

    https://hax.iimarckus.org/topic/7019/ - Gen II Sprite Resources
    https://hax.iimarckus.org/topic/6443/ - Some 8 bit song devamps
    https://hax.iimarckus.org/topic/6777/ - more songs, more useful because it has asm; these are for crystal but could probably be ported to rby particularly with 'crysaudio'?
    https://hax.iimarckus.org/topic/197/25/ - Some custom graphix resources, will need a lot of hunting around
    https://hax.iimarckus.org/topic/7857/ - Some blue+green style pokemon
    https://hax.iimarckus.org/topic/7862/ - Gyaoon, abandoned beta pokemon.
    https://hax.iimarckus.org/topic/7224/ - a custom palettes thread.
    https://hax.iimarckus.org/topic/7594/ - Custom move animations.
    https://hax.iimarckus.org/topic/7113/ - Pokemon Crystal Music Editor with Asm export
    https://hax.iimarckus.org/topic/7671/ - another music tool, midi to asm exporter for crystal
    https://github.com/huderlem/pokered_battle_factory - Battle frontier remake example.

    You will probably want Polished Map and Tilemap studio, which two tools that are great for, you guessed it, tilemaps (such as town map) and actual map editing. They work on a variety of roms disassemblies including Crystal. I used them to make a Johto Map for Yellow/Red/Blue once. You can also use polished map to edit the .bst blockset files.

    Quoting Rangi the maker, Tilemap studio also has a feature to make tilemaps from an image.
    ' Say you have a mockup image.

    Open Tilemap Studio; press Ctrl+X for Image to Tiles; and choose your options. For a GBC game, we want the tile IDs and attributes stored in separate files, and following the existing Pokémon Crystal intro, we want the first tile to be $80, not $00.' Implying I think for GB do it a bit differently. When in doubt, look at existing tilemaps and how they've stored their data.

    https://github.com/Rangi42/tilemap-studio
    and the pokecommunity thread for polished: https://www.pokecommunity.com/showthread.php?t=425994

    Finally, let's look at some tutorials.
    https://hax.iimarckus.org/topic/6436/ - an old tutorial for adding pokemon by Shattenjager.
    https://hax.iimarckus.org/topic/4248/ - old tileset edit guide
    https://hax.iimarckus.org/topic/7795/ - useful info about changing trainer custom moves, red vs. yellow differences
    https://hax.iimarckus.org/topic/6937/ - add lose text to fights
    https://hax.iimarckus.org/topic/4650/ - Adding Boy/Girl to Red. I had no issues porting this to Yellow /except/ for bank space being low in the initial spots I tried to modify the bike. So, I settled on a single Growlithe pokemon to ride on instead of two separate girl/boy bike images.
    In addition, you should know if you want to additionally have a new trainer using a player sprite that if player sprite is in a different bank from the rest of the trainer sprites, simply adding the trainer sprite to be associated with the list of trainer types (say replacing 'Chief') will give you a missingno when you try to fight that trainer because it'll be loaded wrong. You'll either need to code in a bank switch or make sure your pic is in the same bank with the other trainers.
    https://hax.iimarckus.org/post/44357/ - an answered question about expanding tilesets.
    https://hax.iimarckus.org/topic/7845/ - Find Red's starting coordinates.
    https://github.com/Rangi42/redstarbluestar/commit/48c0b4fe41064fc1456226654b682c4328e288c6 - Pokemon are not trainers commit, from Red Star Blue Star.
    https://hax.iimarckus.org/topic/7739/ - Adding new items to a map
    https://hax.iimarckus.org/topic/7404/ - Editing counters

    Adding a trade example:
    https://github.com/longlostsoul/EvoYellow/commit/1df35ac6848cb7463054b6a366d3dcf1f41345a5

    Expanding a rom could hypothetically be done with Twitch Play's wrapper, but I'm honestly not very familiar with how this works or how to handle pointers after you do so. I do remember hearing that you can't expand a GB to the same size as a GBA, of course. I think the limit is 4mb and this messes up the clock (which is irrelevant for red/b/yellow but not Crystal)? Linking in case anyone wants to look:
    https://github.com/aaaaaa123456789/tpp1

    Physical/Special Split and Sp. Def/Sp. Attack Split

    Simply splitting moves has been done (in Red++), but for Pokemon (Sp. Def/Sp. Attack split) it is harder. In fact, for awhile it was thought impossible in Red because of all the instabilities changing the structs seems to cause. However, I have recently thought of another method which would probably work. Simply dynamically generate the physical/special split when needed based on how balanced the pokemon's stats are, with the second special stat adjusted higher or lower than the base special stat as needed. This would be a little tedious to actually write, but it would involve just a few places rather than hundreds needing to be changed, and more importantly wouldn't mess with boxes or data structs in any way.

    Static Pokemon Encounters

    1. Mess with the hide/show sprite page, to make sure the game knows what sprite you are talking about when you want to hide it and where it is.
    2. The actual encounter asm itself, which you'll want to copy from existing static encounters and then take a look at Flag/Event Name Constants. You need an unused event. There are some at the very end of the event constants list I think.
    3. Make sure the sprite sets support the sprite you want to use, and add that sprite to the map. If it's a dungeon I don't think you need to worry about sprite sets, but if it's an open world area then you should be aware each map only loads some sprites at a time and for open world this is fixed so that it knows how to handle walking from one map to another. For dungeons this doesn't matter because you warp.

    I will make a more thorough guide to this later at some point.

    Update to adding new pokemon:
    The old tutorials don't mention how to fix the 'turn into trainers in wild if above a certain number' issue, but this is actually very easy to fix. Just set a flag before wild encounters, then do a check in battle core. If you only add like 5 or so, you don't really need to worry about this though. Note that the following commit only fixes wild grass battles, I didn't touch battles with a rod I think, and the flag used will need to be added to wram (or an existing renamed).
    https://github.com/longlostsoul/EvoYellow/commit/e7d929e9706ae6286132ee7d62e6a0ab6bfcafe6 (Ignore the first bit messing with pokemon constants, that does nothing)
    You also, in yellow at least, need to do the following to fix '8 bit error':


    engine/menu/pokedex.asm
    @@ -299,7 +299,7 @@ Pokedex_DrawInterface:
    call PlaceString
    ; find the highest pokedex number among the pokemon the player has seen
    ld hl, wPokedexSeenEnd - 1
    ; replace this -> ld b, (wPokedexSeenEnd - wPokedexSeen) * 8 + 1 with below
    ld b, 0;(wPokedexSeenEnd - wPokedexSeen) * 8 + 1 gives 8 bit error, so, just enjoy having all of them. >_>

    If pokemon turn into Rhydons, comment out some code in home's LoadFrontSpriteByMonIndex::, I think I did this because Num_pokemon+1 got dangerously large so that num pokemon was okay but +1 was not, buuuut I can't quite remember.
    ;jr z, .invalidDexNumber ; dex #0 invalid
    ;cp NUM_POKEMON + 1
    ;jr c, .validDexNumber ; dex >#151 invalid
    ;.invalidDexNumber
    ;ld a, RHYDON ; $1
    ;ld [wcf91], a
    ;ret
    ;.validDexNumber

    Level adjusting examples:
    https://github.com/longlostsoul/EvoYellow/commit/f2642365d79bc28f874a3af021a03e8e3ecb687d
    https://github.com/longlostsoul/EvoYellow/commit/233c6ba9618f45af8772ab03817ade574f59a8fc
    finally, this one will also require you to copy other changes in field moves since it already had changes if I remember right, as default yellow doesn't ask from overworld about cutting and surfing:
    https://github.com/longlostsoul/EvoYellow/commit/0fdfbae12ac07fcf644e54b9a49d4c8662ecf2f8

    Roaming Red has, I think, much more thorough level adjustment and changes for free world roaming (including option to change starting map), so check it out if this interests you:
    https://github.com/tshadowknight/Pokemon-Roaming-Red

    About randomization
    You probably realized it would be very easy to mess not just with pokemon levels, but randomly grab a pokemon too by calling Random and loading the result into species. If you do this, you have to beware of the missingnos which are hidden throughout the dex and either remove them or put in a check for them one by one.
    You can also easily randomize trainers' pokemon: however, I got a weird little bug with only one random pokemon loading when I tried a trainer that was the only trainer in its class, when I put two in it suddenly started working properly. It might be the FF special levels for each mon version just works better, but here's my example anyway if you want to look at it:
    https://github.com/longlostsoul/EvoYellow/commit/b2afd5d4aa68cd3307fe075db68e2ab2ce1ea067 (Making it load the player pic was a mistake, as it was in the wrong bank)
    https://github.com/longlostsoul/EvoYellow/commit/9ecff2c07101837876c5d641d486922a16ea9cdd (this commit fixes that bug and the 'only one random pokemon' bug, as well as some adding an Oak battle junk, sorry, although maybe you'd like to look at that?)

    A note on adding new trainers:

    Adding new trainers is a pain in the ass. You want to be VERY careful about your flag and text ordering, make sure they increment from the one you start with in your scripts and don't zig-zag all over the place. There's also several different methods, optional yes/no battle scripted trainers are a little different than the default 'spot you and run up to you' trainers that use headers and are a bit less finicky in my experience, but do take up more space.

    See the next section for one example of adding trainers.

    Adding New Maps, and stuff on them

    I have now added a map, connected via warps, in my hack. I will try connections later.

    Adding the map, warps on the map set up:
    https://github.com/longlostsoul/EvoYellow/commit/acd29747b860cb3281ec31bdb333ea03635e1eb8
    Warping to the new map from another, adding an item (I am not 100% sure how the game decides where to write the item flag in memory, so beware of that, you might need to alter hide/show constants or something):
    https://github.com/longlostsoul/EvoYellow/commit/b5100f9e636773e4e86cfc5e243daeb3589c1460
    Putting some trainers on the map (I recommend looking at a normal trainer map script, as I altered mine so I could use whatever event flags I wanted with it for the trainers, but this gives you the basic idea):
    https://github.com/longlostsoul/EvoYellow/commit/41871115487a744870184c5a4002a0d4956e017e

    If you choose to use the map, the bridge was slightly buggy, so fix:
    https://github.com/longlostsoul/EvoYellow/commit/6fed093608485cb41e5e8d25b614cae4b25b2c48

    Day/Night:

    Day/Night is quite add-able in Yellow, although one person had issues and thought they'd messed it up somehow - I actually also have palette issues when you talk to Pikachu/Raichu sometimes, so this is not unique to them as originally thought. However, it's a really minor issue.
    https://github.com/longlostsoul/EvoYellow/search?q=night&type=commits
    I believe some of the code is from Maize (Except for yellow specific fixes I added due to it changing color palette for every town), which I think was a red hack, so if using Red you probably want to check that version out instead.

    Held Items:
    I can't remember if I covered this more thoroughly in my other tutorial or not, probably did, but the basics of what you need to know is that pokemon in Red/Blue/Yellow can already 'have' Held Items, they just don't display or do anything. However, if traded, or if you modify to grab the pokemon's catch rate (that's what is used for items!) and display, then you can see it, but you need to be aware that certain catch rates won't correspond to proper items at all. I did things the hard way by methodically going through and changing all the pokemon's catch rates when I implemented item holding. I have a horribly outdated commit that does highlight locations you need to alter, you could grab the locations and then look at the script modifications in my latest, more stable version, or even just try copying the files over and see what differences show up (probably don't want to do that with core, tho', since I modded a lot of other stuff too):
    https://github.com/longlostsoul/EvoYellow/commit/52d74323680c08633a4e4666815276c73e4b6a23

    Note that changes to items (increasing number, say for berries) and messing around with the wram in general will require you to restart your game save. There are examples of adding new kinds of items in Red++ if I recall right, one of them I think was a snag/theft ball.

    Changing TMs to not just display Number, but also Type:
    This is a massively useful little hack that makes TMs 100% less annoying, but probably could definitely be improved upon (or at least made more efficient):
    https://github.com/longlostsoul/EvoYellow/commit/4d955b29fd3abdc5cd3c86c7a7f3e3d0bfcec0f4

    Forget HMs
    comment out this:
    .hm
    ld hl, HMCantDeleteText
    call PrintText
    pop hl
    jr .loop
    from engine/learn_move.asm
    You will probably want to combine with a change to field_moves to allow surfing/cutting without a pokemon, to avoid softlock issues. Alternatively, you could try to fix the surfboard item, I believe Shin Poke Red has a fix for that, and make some mirroring 'cut' item and so forth.

    Doubles
    I am unsure of the status of this. I know someone was working on it, but last time I checked they were not kind enough to post a repo/code and that was years ago. So one will have to start from scratch here. The method that was used, as far as I know, was to simply switch which pokemon is being previewed as needed because making both show at once is awkward with the small amount of space.
    However, one might alternatively get rid of the HP and Exp bars instead, and make that information available some other way. Unless you like being evil and increasing difficulty, of course; this would also work well for a mystery dungeon demake game as they never showed HP bars of enemies in the original Mystery Dungeon, and you can still check your own HP by going to your status screen. And of course, one would need to alter wram to double the 'battlemons', both enemy and your own mon, and need to make some kind of code for target selection, and altered code for victory and for handling when you get down to just one mon / no triggering doubles inappropriately. Lastly, one might want to make some moves hit both, but that's polishing.
    Anyone have any other thoughts on this? Or better yet, some code? Even unfinished would be better than nothing. We already have snagging/poketheft (I implemented a simple version but I believe others did different ones as well), and I can implement conditional type changes to Shadow (see my item hold system code on Megas, which I should probably get around to finishing for enemies), and an Eevee follow, so doubles is really the only thing left needed for a proper Colosseum style hack.

    speaking of mystery dungeon demakes:
    I've been thinking of doing some minimal changes to Yellow to make yourself a pokemon with a pokemon follower, idk if people would want that code or not though.
    The bare minimum version would simply be to change the player sprite with a pokemon, but you could also alter the followme to change which pokemon is in front or behind based on party; you'd need to do two reads, instead of one, with the second read grabbing the second pokemon in your party instead of the first, and do alterations in the same place the boy/girl code does to the player sprite dynamically based on first party mon.
    You could also do a simpler version if you want the player to be from a limited list of pokemon and always leading, and just modify boy/girl and the follow to grab the second party member only if the first party member is equal to your starter pokemon (that is, you), otherwise grab first party member, so that you don't end up having yourself follow yourself, obviously.
    This is another thing that would benefit from doubles, alas.

    A Small Note On Adding Shinies/Gender to Yellow and Its Effect on Pikachu:
    If you add shinies to Yellow (such as from Red++ code), people will shiny reset for the Oak battle pikachu, but this pikachu has nothing to do with the pikachu that is later caught. So either change the Oak Battle (I made him catch a mew) or make sure Pikachu never becomes shiny, or do some sort of check if first pikachu is shiny. This also applies to gender.

    That's the end!
    I know there was a helpful discord for Pokered hackers, but I haven't kept track of it.
     
    Last edited:
    200
    Posts
    10
    Years
    • He or They
    • Seen Jun 19, 2022
    I've updated the tutorial, and I just wanted to say also that if someone has something they want me to add to it I am happy to take suggestions.

    Also, please feel free to take absolutely any code/assets whatsoever you want from my github. It's open for a reason. And don't forget to check out my other, older tutorial if you hack Yellow.
     
    Last edited:
    Back
    Top