diff options
-rw-r--r-- | Add-a-new-Pokémon.md | 649 | ||||
-rw-r--r-- | Tutorials.md | 1 | ||||
-rw-r--r-- | screenshots/gfx-footprints-munchlax.png | bin | 0 -> 100 bytes | |||
-rw-r--r-- | screenshots/gfx-pokemon-munchlax-back.png | bin | 0 -> 612 bytes | |||
-rw-r--r-- | screenshots/gfx-pokemon-munchlax-front.png | bin | 0 -> 3368 bytes | |||
-rw-r--r-- | screenshots/munchlax.png | bin | 0 -> 5799 bytes |
6 files changed, 650 insertions, 0 deletions
diff --git a/Add-a-new-Pokémon.md b/Add-a-new-Pokémon.md new file mode 100644 index 0000000..e5b730c --- /dev/null +++ b/Add-a-new-Pokémon.md @@ -0,0 +1,649 @@ +This tutorial is for how to add a new species of Pokémon, allowing up to 253 species. As an example, we'll add Munchlax. + + +## Contents + +1. [Define a species constant](#1-define-a-species-constant) +2. [Give it a name](#2-give-it-a-name) +3. [Define its base data](#2-define-its-base-data) +4. [Define its evolutions and level-up learnset](#4-define-its-evolutions-and-level-up-learnset) +5. [Define its egg moves](#5-define-its-egg-moves) +6. [Define its cry](#6-define-its-cry) +7. [Define its icon](#7-define-its-icon) +8. [Define its Pokédex entry](#8-define-its-pokédex-entry) +9. [Define its footprint](#9-define-its-footprint) +10. [Define its sprites](#10-define-its-sprites) +11. [Adding up to 253 Pokémon](#11-adding-up-to-253-pokémon) + + +## 1. Define a species constant + +Edit [constants/pokemon_constants.asm](../blob/master/constants/pokemon_constants.asm): + +```diff + ; pokemon ids + ; indexes for: + ; - PokemonNames (see data/pokemon/names.asm) + ; - BaseData (see data/pokemon/base_stats.asm) + ; - EvosAttacksPointers (see data/pokemon/evos_attacks_pointers.asm) + ; - EggMovePointers (see data/pokemon/egg_move_pointers.asm) + ; - PokemonCries (see data/pokemon/cries.asm) + ; - MonMenuIcons (see data/pokemon/menu_icons.asm) + ; - PokemonPicPointers (see data/pokemon/pic_pointers.asm) + ; - PokemonPalettes (see data/pokemon/palettes.asm) + ; - PokedexDataPointerTable (see data/pokemon/dex_entry_pointers.asm) + ; - AlphabeticalPokedexOrder (see data/pokemon/dex_order_alpha.asm) + ; - EZChat_SortedPokemon (see data/pokemon/ezchat_order.asm) + ; - NewPokedexOrder (see data/pokemon/dex_order_new.asm) + ; - Pokered_MonIndices (see data/pokemon/gen1_order.asm) + ; - AnimationPointers (see gfx/pokemon/anim_pointers.asm) + ; - AnimationIdlePointers (see gfx/pokemon/idle_pointers.asm) + ; - BitmasksPointers (see gfx/pokemon/bitmask_pointers.asm) + ; - FramesPointers (see gfx/pokemon/frame_pointers.asm) + ; - Footprints (see gfx/footprints.asm) + const_def 1 + const BULBASAUR ; 01 + ... + const MEW ; 97 + JOHTO_POKEMON EQU const_value + const CHIKORITA ; 98 + ... + const CELEBI ; fb ++ const MUNCHLAX ; fc + NUM_POKEMON EQU const_value + -1 +- const MON_FC ; fc + const EGG ; fd + const MON_FE ; fe +``` + +Some things to notice here: + +- Species constants are in national dex order; in fact, they're used as Pokédex IDs, so Munchlax is going to appear as #252. +- `JOHTO_POKEMON` is defined right before the first Johto Pokémon, and `NUM_POKEMON` is defined right after the last non-Egg Pokémon. +- There are a lot of data tables associated with Pokémon species! We'll go over them one by one later. + + +# 2. Give it a name + +Edit [data/pokemon/names.asm](../blob/master/data/pokemon/names.asm): + +```diff + PokemonNames:: + db "BULBASAUR@" + ... + db "CELEBI@@@@" +- db "?????@@@@@" ++ db "MUNCHLAX@@" + db "EGG@@@@@@@" + db "?????@@@@@" + db "?????@@@@@" + db "?????@@@@@" +``` + +All the names are exactly 10 characters long, with "@" as padding. Names that are 10 characters long anyway, like "CHARMELEON", don't have any padding. + +(Aside: if you make names lowercase, be careful—going from "FARFETCH'D" to "Farfetch'd" will lower the character count by 1 since "'d" is a single character, so that would need to become "Farfetch'd@".) + + +## 3. Define its base data + +Edit [data/pokemon/base_stats.asm](../blob/master/data/pokemon/base_stats.asm): + +```diff + BaseData:: + INCLUDE "data/pokemon/base_stats/bulbasaur.asm" + ... + INCLUDE "data/pokemon/base_stats/celebi.asm" ++INCLUDE "data/pokemon/base_stats/munchlax.asm" +``` + +Then create **data/pokemon/base_stats/munchlax.asm**; you can start with [data/pokemon/base_stats/snorlax.asm](../blob/master/data/pokemon/base_stats/snorlax.asm) as a guide. + +There's a lot of base data here: + +```diff ++ db MUNCHLAX ; 252 ++ ++ db 135, 85, 40, 5, 40, 85 ++ ; hp atk def spd sat sdf ++ ++ db NORMAL, NORMAL ; type ++ db 50 ; catch rate ++ db 94 ; base exp ++ db LEFTOVERS, LEFTOVERS ; items ++ db GENDER_F12_5 ; gender ratio ++ db 100 ; unknown 1 ++ db 40 ; step cycles to hatch ++ db 5 ; unknown 2 ++ INCBIN "gfx/pokemon/munchlax/front.dimensions" ++ db 0, 0, 0, 0 ; padding ++ db GROWTH_SLOW ; growth rate ++ dn EGG_NONE, EGG_NONE ; egg groups ++ ++ ; tm/hm learnset ++ tmhm DYNAMICPUNCH, HEADBUTT, CURSE, ROLLOUT, TOXIC, ZAP_CANNON, ROCK_SMASH, PSYCH_UP, HIDDEN_POWER, SUNNY_DAY, SNORE, BLIZZARD, HYPER_BEAM, ICY_WIND, PROTECT, RAIN_DANCE, ENDURE, FRUSTRATION, SOLARBEAM, THUNDER, EARTHQUAKE, RETURN, PSYCHIC_M, SHADOW_BALL, MUD_SLAP, DOUBLE_TEAM, ICE_PUNCH, SWAGGER, SLEEP_TALK, SANDSTORM, FIRE_BLAST, DEFENSE_CURL, THUNDERPUNCH, REST, ATTRACT, FIRE_PUNCH, SURF, STRENGTH, FLAMETHROWER, THUNDERBOLT, ICE_BEAM ++ ; end +``` + +From top to bottom, what it all means: + +- **species:** This is just used for declaring which ROM bank the Pokédex entry is stored it. It's arguably [a design flaw](../blob/master/docs/design_flaws.md#pokédex-entry-banks-are-derived-from-their-species-ids), since the exact species ID is insignificant, but it's not a big deal; just put the correct species here and move on. +- **base stats:** HP, Attack, Defense, Speed, Special Attack, and Special Defense, each from 1 to 255. +- **type:** The primary and secondary types. Single-type Pokémon just repeat their type twice. +- **catch rate:** A factor in the formula for capturing wild Pokémon. Lower rates are harder to capture. The highest value, 255, is used for common Pokémon like Hoothoot and Rattata; legendaries like Mewtwo and Ho-Oh get as low as 3. +- **base experience yield:** A factor in the formula for awarding experience. Higher values give more experience. As usual, since this is a single byte (`db`), its maximum is 255. (Chansey and Blissey both have 255 base exp.) +- **items:** A common item (23% chance) and a rare item (2% chance) that might be held by this Pokémon in the wild. +- **gender ratio:** The likelihood that an Egg of this Pokémon will be female. Lower values are more likely to be male, with 0 being 100% male, 254 being 100% female, and 255 being genderless (like Magnemite or Staryu). There are named constants for the few values that get officially used: + - `GENDER_F0`: 100% male + - `GENDER_F12_5`: 7/8 male, 1/8 female + - `GENDER_F25`: 3/4 male, 1/4 female + - `GENDER_F50`: 1/2 male, 1/2 female + - `GENDER_F75`: 1/4 male, 3/4 female + - `GENDER_F100`: 100% female + - `GENDER_UNKNOWN`: genderless +- **unknown 1:** An unused value that's always 100. +- **step cycles to hatch:** How many step cycles it takes for an Egg of this Pokémon to hatch. Each step cycle is 256 steps long. +- **unknown 2:** An unused value that's always 5. +- **front.dimensions:** The size of the Pokémon's front sprite. The front.dimensions file contains a single byte that's one of three valid values: $55 for a 40x40-pixel (5x5-tile) sprite, $66 for 48x48 pixels (6x6 tiles), or $77 for 56x56 pixels (7x7 tiles). It's automatically generated from the front.png sprite image (we'll get to this later). +- **padding:** Four unused bytes that are always 0s. +- **growth rate:** The formula that's used to determine experience point thresholds for reaching each level. (The formula coefficients are defined in [data/growth_rates.asm](../blob/master/data/growth_rates.asm).) Valid values: + - `GROWTH_MEDIUM_FAST`: *exp* = *L*³ (1,000,000 exp = level 100) + - `GROWTH_SLIGHTLY_FAST`: *exp* = (3/4)*L*³ + 10*L*² − 30 (849,970 exp = level 100); unused + - `GROWTH_SLIGHTLY_SLOW`: *exp* = (3/4)*L*³ + 20*L*² − 70 (949,930 exp = level 100); unused + - `GROWTH_MEDIUM_SLOW`: *exp* = (6/5)*L*³ − 15*L*² + 100*L* − 140 (1,059,860 exp = level 100) + - `GROWTH_FAST`: *exp* = (4/5)*L*³ (800,000 exp = level 100) + - `GROWTH_SLOW`: *exp* = (5/4)*L*³ (1,250,000 exp = level 100) +- **egg groups:** The two egg groups this Pokémon is in. Two Pokémon have to share an Egg group to breed. The 15 valid Egg groups (including `EGG_NONE` for sterile Pokémon like babies and legendaries) are defined in [constants/pokemon_data_constants.asm](../blob/master/constants/pokemon_data_constants.asm). +- **TM/HM learnset:** A list of which TMs, HMs, and tutor moves this Pokémon can learn, passed to the `tmhm` macro. Valid values are defined in [constants/item_constants.asm](../blob/master/constants/item_constants.asm) with the `add_tm`, `add_hm`, and `add_mt` macros. + + +## 4. Define its evolutions and level-up learnset + +Edit [data/pokemon/evos_attacks_pointers.asm](../blob/master/data/pokemon/evos_attacks_pointers.asm): + +```diff + EvosAttacksPointers:: ; 0x425b1 + dw BulbasaurEvosAttacks + ... + dw CelebiEvosAttacks ++ dw MunchlaxEvosAttacks + ; 0x427a7 +``` + +Then edit [data/pokemon/evos_attacks.asm](../blob/master/data/pokemon/evos_attacks.asm): + +```diff ++MunchlaxEvosAttacks: ++ db EVOLVE_HAPPINESS, TR_ANYTIME, SNORLAX ++ db 0 ; no more evolutions ++ db 1, TACKLE ++ db 1, METRONOME ++ db 8, AMNESIA ++ db 15, DEFENSE_CURL ++ db 22, BELLY_DRUM ++ db 29, HEADBUTT ++ db 36, SCREECH ++ db 36, REST ++ db 43, BODY_SLAM ++ db 50, ROLLOUT ++ db 57, HYPER_BEAM ++ db 0 ; no more level-up moves +``` + +The comment at the top of evos_attacks.asm explains the data structure: + +``` +EvosAttacks:: +; Evos+attacks data structure: +; - Evolution methods: +; * db EVOLVE_LEVEL, level, species +; * db EVOLVE_ITEM, used item, species +; * db EVOLVE_TRADE, held item (or -1 for none), species +; * db EVOLVE_HAPPINESS, TR_* constant (ANYTIME, MORNDAY, NITE), species +; * db EVOLVE_STAT, level, ATK_*_DEF constant (LT, GT, EQ), species +; - db 0 ; no more evolutions +; - Learnset (in increasing level order): +; * db level, move +; - db 0 ; no more level-up moves +``` + +Munchlax evolves into Snorlax through happiness; and its level-up moves are copied from Snorlax, with a couple replacements (Metronome and Screech). + +Note that the order of the `EvosAttacksPointers` matters, since the entries pair up with the species constants, but the `EvosAttacks` data is unordered. I just put Munchlax's data at the end of the file. + + +## 5. Define its egg moves + +Edit [data/pokemon/egg_move_pointers.asm](../blob/master/data/pokemon/egg_move_pointers.asm): + +``` + EggMovePointers:: ; 0x23b11 + dw BulbasaurEggMoves + ... + dw AerodactylEggMoves +- dw SnorlaxEggMoves ++ dw NoEggMoves + dw NoEggMoves + ... + dw NoEggMoves ++ dw MunchlaxEggMoves + ; 0x23d07 +``` + +Then edit [data/pokemon/egg_moves.asm](../blob/master/data/pokemon/egg_moves.asm): + +```diff +-SnorlaxEggMoves: ++MunchlaxEggMoves: + db LICK +-if !_CRYSTAL +- db CHARM +-endc + db -1 ; end +``` + +Note that since Snorlax will now lay Munchlax eggs, it doesn't need Egg moves of its own, and its set of Egg moves can just be reused for Munchlax. Like the level-up moves, this data is unordered, since the `EggMovePointers` table is used to access particular sets. + + +## 6. Define its cry + +Edit [data/pokemon/cries.asm](../blob/master/data/pokemon/cries.asm): + +```diff + PokemonCries:: ; f2787 + ; entries correspond to constants/pokemon_constants.asm + mon_cry CRY_BULBASAUR, $080, $081 ; BULBASAUR + ... + mon_cry CRY_ENTEI, $14a, $111 ; CELEBI +- mon_cry CRY_NIDORAN_M, 0, 0 ; 252 ++ mon_cry CRY_GRIMER, $065, $080 ; MUNCHLAX + mon_cry CRY_NIDORAN_M, 0, 0 ; 253 + mon_cry CRY_NIDORAN_M, 0, 0 ; 254 + mon_cry CRY_NIDORAN_M, 0, 0 ; 255 +``` + +The three values passed to `mon_cry` are a cry index, a pitch, and a length. Defining your own cries is similar to writing original music, and well beyond the scope of this tutorial. So just pick a cry from [constants/cry_constants.asm](../blob/master/constants/cry_constants.asm) and tweak the pitch and length until it sounds okay. I simply copied Snorlax's cry for Munchlax, with a slightly higher pitch and shorter length. + + +## 7. Define its icon + +Edit [data/pokemon/menu_icons.asm](../blob/master/data/pokemon/menu_icons.asm): + +```diff + MonMenuIcons: ; 8eac4 + db ICON_BULBASAUR ; BULBASAUR + ... + db ICON_HUMANSHAPE ; CELEBI ++ db ICON_SNORLAX ; MUNCHLAX + ; 8ebbf +``` + +Valid icons are in [constants/icon_constants.asm](../blob/master/constants/icon_constants.asm). They're used in the party menu and Day-Care. + + +## 8. Define its Pokédex entry + +Edit [data/pokemon/dex_entry_pointers.asm](../blob/master/data/pokemon/dex_entry_pointers.asm): + +```diff + PokedexDataPointerTable: ; 0x44378 + ; entries correspond to constants/pokemon_constants.asm + dw BulbasaurPokedexEntry + ... + dw CelebiPokedexEntry ++ dw MunchlaxPokedexEntry + ; 0x4456e +``` + +Then edit [data/pokemon/dex_entries.asm](../blob/master/data/pokemon/dex_entries.asm): + +```diff + SECTION "Pokedex Entries 193-251", ROMX + + PokedexEntries4:: + YanmaPokedexEntry:: INCLUDE "data/pokemon/dex_entries/yanma.asm" + ... + CelebiPokedexEntry:: INCLUDE "data/pokemon/dex_entries/celebi.asm" ++MunchlaxPokedexEntry:: INCLUDE "data/pokemon/dex_entries/munchlax.asm" +``` + +Each of the four sections in dex_entries.asm holds 64 Pokédex entries. Each section is in a different ROM bank, decided by which range the Pokémon's species ID is in: 1–64, 65–128, 129–192, or 193–256. The order of entries within each section doesn't actually matter, since they're accessed directly via `PokedexDataPointerTable`, but avoid confusion and just keep them in numerical order. + +Create **data/pokemon/dex_entries/munchlax.asm**: + +```diff ++ db "BIG EATER@" ; species name ++ dw 200, 2315 ; height, weight ++ ++ db "In its desperation" ++ next "to gulp down food," ++ next "it forgets about" ++ ++ page "the food it has" ++ next "hidden under its" ++ next "fur.@" +``` + +- The species name can be up to 10 characters (technically 11 will still fit in the Pokédex window). Be sure to end it with a "@". +- The height and weight values are in imperial units. 200 = 2 feet 0 inches; 2315 = 231.5 pounds. +- The entry text is in two pages; the first starts with `db`, the second with `page`. Each page can fit three lines with 18 characters each. Here it's visual size that matters—`"#MON"` counts as 7 characters because it prints as "POKéMON". Again, be sure to end it with a "@". + +Now the Pokédex entry exists, and will be listed correctly in "Old Pokédex Mode" (the Gen 2 equivalent of national order). But we need to define the new Pokémon's place in "New Pokédex Mode (regional order) and "A to Z Mode" (alphabetical order). + +Edit [data/pokemon/dex_order_new.asm](../blob/master/data/pokemon/dex_order_new.asm): + +```diff + NewPokedexOrder: ; 0x40d60 + db CHIKORITA + ... + db AERODACTYL ++ db MUNCHLAX + db SNORLAX + db BULBASAUR + ... + db CELEBI + ; 0x40e5b +``` + +Then edit [data/pokemon/dex_order_new.asm](../blob/master/data/pokemon/dex_order_new.asm): + +```diff + AlphabeticalPokedexOrder: ; 0x40c65 + db ABRA + ... + db MUK ++ db MUNCHLAX + db MURKROW + ... + db ZUBAT + ; 0x40d60 +``` + +That's all for the Pokédex. + + +## 9. Define its footprint + +Edit [gfx/footprints.asm](../blob/master/gfx/footprints.asm): + +```diff + ; Footprints are 2x2 tiles each, but are stored as a 16x64-tile image + ; (32 rows of 8 footprints per row). + ; That means there's a row of the top two tiles for eight footprints, + ; then a row of the bottom two tiles for those eight footprints. + + ; These macros help extract the first and the last two tiles, respectively. + footprint_top EQUS "0, 2 * LEN_1BPP_TILE" + footprint_bottom EQUS "2 * LEN_1BPP_TILE, 2 * LEN_1BPP_TILE" + + ; Entries correspond to Pokémon species, two apiece, 8 tops then 8 bottoms + + ... + ; 249-256 top halves + INCBIN "gfx/footprints/lugia.1bpp", footprint_top + INCBIN "gfx/footprints/ho_oh.1bpp", footprint_top + INCBIN "gfx/footprints/celebi.1bpp", footprint_top +-INCBIN "gfx/footprints/252.1bpp", footprint_top ++INCBIN "gfx/footprints/munchlax.1bpp", footprint_top + INCBIN "gfx/footprints/253.1bpp", footprint_top + INCBIN "gfx/footprints/254.1bpp", footprint_top + INCBIN "gfx/footprints/255.1bpp", footprint_top + INCBIN "gfx/footprints/256.1bpp", footprint_top + ; 249-256 bottom halves + INCBIN "gfx/footprints/lugia.1bpp", footprint_bottom + INCBIN "gfx/footprints/ho_oh.1bpp", footprint_bottom + INCBIN "gfx/footprints/celebi.1bpp", footprint_bottom +-INCBIN "gfx/footprints/252.1bpp", footprint_bottom ++INCBIN "gfx/footprints/munchlax.1bpp", footprint_bottom + INCBIN "gfx/footprints/253.1bpp", footprint_bottom + INCBIN "gfx/footprints/254.1bpp", footprint_bottom + INCBIN "gfx/footprints/255.1bpp", footprint_bottom + INCBIN "gfx/footprints/256.1bpp", footprint_bottom +``` + +Notice how the footprints are broken into top and bottom halves; you may want to [correct this design flaw](../blob/master/docs/design_flaws.md#footprints-are-split-into-top-and-bottom-halves). (It won't have a visible consequence on the game, but it makes for cleaner code and data.) + +Create **gfx/footprints/munchlax.png**: + + + +Running `make` will automatically create munchlax.1bpp from munchlax.png. Since it's a 1bpp file (**one** **b**it **p**er **p**ixel) you can only use black and white in the image. + + +## 10. Define its sprites + +This is a bit complicated. We need a front sprite with an animation sequence; a back sprite; and normal and shiny color palettes for both. + +Edit [data/pokemon/pic_pointers.asm](../blob/master/data/pokemon/pic_pointers.asm): + +```diff + PokemonPicPointers:: + ; entries correspond to Pokémon species, two apiece + dba_pic BulbasaurFrontpic + dba_pic BulbasaurBackpic + ... + dba_pic CelebiFrontpic + dba_pic CelebiBackpic +- dbw -1, -1 ; unused +- dbw -1, -1 ; unused ++ dba_pic MunchlaxFrontpic ++ dba_pic MunchlaxBackpic + dba_pic EggPic + dbw -1, -1 ; unused +``` + +We have to use `dba_pic` here instead of a standard `dba`—declaring the bank and address of `MunchlaxFrontpic` and `MunchlaxBackpic`—because of [another design flaw](../blob/master/docs/design_flaws.md#pic-banks-are-offset-by-pics_fix). I strongly recommend removing the whole `FixPicBank` routine from [engine/gfx/load_pics.asm](../blob/master/engine/gfx/load_pics.asm), including both calls to it in that file, and just using `dba` here; then you'll be able to `INCBIN` sprites in arbitrary banks. + +Edit [gfx/pics.asm](../blob/master/gfx/pics.asm): + +```diff + SECTION "Pics 19", ROMX + +-; Seems to be an accidental copy of the previous bank +- +-INCBIN "gfx/pokemon/spinarak/back.2bpp.lz" +-... +-INCBIN "gfx/pokemon/unown_r/back.2bpp.lz" ++MunchlaxFrontpic: INCBIN "gfx/pokemon/munchlax/front.animated.2bpp.lz" ++MunchlaxBackpic: INCBIN "gfx/pokemon/munchlax/back.2bpp.lz" +``` + +(If you *don't* fix the `dba_pic` design flaw, you'll have to put your sprites in the "Pics" sections, which are compatible with `dba_pic`. "Pics 19" isn't used for anything useful—all its contents are unused duplicates of "Pics 18"—so it's the easiest place to start adding new sprites. But if you have a lot of new sprites to add, you risk overflowing the banks, and it's hard to fit sprites within fixed bank limits. By using just `dba`, you can create new `SECTION`s with a few sprites each, that will automatically be placed wherever they can fit in the ROM.) + +Create **gfx/pokemon/munchlax/front.png**: + + + +And **gfx/pokemon/munchlax/back.png**: + + + +front.png is a vertical strip of unique animation frames. Frames are all the same size; valid sizes are 40x40, 48x48, or 56x56. Here we have five frames, each 48x48 pixels. back.png is always 48x48. Both sprites have to use the same four colors: white, black, and the same two arbitrary hues. + +Next create **gfx/pokemon/munchlax/anim.asm**: + +```diff ++ frame 0, 08 ++ frame 1, 08 ++ frame 0, 08 ++ frame 2, 24 ++ frame 3, 08 ++ frame 4, 08 ++ frame 3, 08 ++ frame 3, 08 ++ frame 0, 16 ++ endanim +``` + +And **gfx/pokemon/munchlax/anim_idle.asm**: + +```diff ++ frame 1, 08 ++ frame 0, 08 ++ frame 1, 08 ++ endanim +``` + +anim.asm defines the main sprite animation sequence; anim_idle.asm defines an extra one that gets played in some contexts (notably *not* when a Pokémon is encountered in battle). A full description of the animation script commands is at [docs/pic_animations.md](../blob/master/docs/pic_animations.md). + +This Munchlax animation was designed by SCMidna. But you're more likely to have a single static front sprite than a whole animated sequence of frames. In that case, you can save the one sprite as front.png (so it will be a single square frame, not a vertical strip of them), and just put `endanim` as the full contents of anim.asm and anim_idle.asm. + +Now create **gfx/pokemon/munchlax/shiny.pal**: + +```diff ++ RGB 22, 22, 12 ++ RGB 07, 15, 25 +``` + +These two colors will be used for shiny Munchlax, along with the standard black and white. The lighter color should come first. + +When you `make` the ROM, a number of sprite-related files will be automatically generated for you: + +- **normal.pal:** Like shiny.pal, but with the normal colors, derived from front.png and back.png. +- **front.dimensions:** The size of a frame from front.png. +- **front.animated.2bpp.lz:** The compressed tiles needed to animated the sprite. Animation frames tend to have lots of duplicate tiles, since only parts of a Pokémon move at a time, so each unique tile only exists once. +- **bitmask.asm:** A sequence of masks that define which spots in each frame are changed from the still sprite. +- **frames.asm:** A sequence of lists that declare the tile IDs with which to fill in the changed spots in each frame. + +There are two main reasons to pay attention to these auto-generated files. One, you want to make sure that normal.pal got its colors in the right order, and have shiny.pal match it. Two, if your animation appears corrupt, you want to make sure that frames.asm isn't using too high tile IDs. A 40x40 sprite can use IDs $00 to $31; a 48x48 sprite can use up to $47; a 56x56 sprite can use up to $61. If you see IDs above those limits, edit your front.png frames so they use fewer unique tiles. + +Anyway, all that's left is to `INCLUDE` and point to to the new data. Edit [data/pokemon/palettes.asm](../blob/master/data/pokemon/palettes.asm): + +```diff + PokemonPalettes: ; a8ce + ; entries correspond to Pokémon species, two apiece + + ; 000 + RGB 30, 22, 17 + RGB 16, 14, 19 + ; 000 shiny + RGB 30, 22, 17 + RGB 16, 14, 19 + + INCLUDE "gfx/pokemon/bulbasaur/normal.pal" + INCLUDE "gfx/pokemon/bulbasaur/shiny.pal" + ... + INCLUDE "gfx/pokemon/celebi/normal.pal" + INCLUDE "gfx/pokemon/celebi/shiny.pal" + +-; 252 +- RGB 30, 26, 11 +- RGB 23, 16, 00 +-; 252 shiny +- RGB 30, 26, 11 +- RGB 23, 16, 00 ++INCLUDE "gfx/pokemon/munchlax/normal.pal" ++INCLUDE "gfx/pokemon/munchlax/shiny.pal" + + INCLUDE "gfx/pokemon/egg/normal.pal" + INCLUDE "gfx/pokemon/egg/shiny.pal" + + ; 254 + RGB 30, 26, 11 + RGB 23, 16, 00 + ; 254 shiny + RGB 30, 26, 11 + RGB 23, 16, 00 + + ; 255 + RGB 23, 23, 23 + RGB 17, 17, 17 + ; 255 shiny + RGB 23, 23, 23 + RGB 17, 17, 17 + + ; b0ce +``` + +Edit [gfx/pokemon/anim_pointers.asm](../blob/master/gfx/pokemon/anim_pointers.asm): + +```diff + AnimationPointers: + dw BulbasaurAnimation + ... + dw CelebiAnimation ++ dw MunchlaxAnimation +``` + +Edit [gfx/pokemon/anims.asm](../blob/master/gfx/pokemon/anims.asm): + +```diff + PicAnimations: + BulbasaurAnimation: INCLUDE "gfx/pokemon/bulbasaur/anim.asm" + ... + CelebiAnimation: INCLUDE "gfx/pokemon/celebi/anim.asm" ++MunchlaxAnimation: INCLUDE "gfx/pokemon/munchlax/anim.asm" + EggAnimation: INCLUDE "gfx/pokemon/egg/anim.asm" +``` + +Edit [gfx/pokemon/idle_pointers.asm](../blob/master/gfx/pokemon/idle_pointers.asm): + +```diff + AnimationIdlePointers: + dw BulbasaurAnimationIdle + ... + dw CelebiAnimationIdle ++ dw MunchlaxAnimationIdle +``` + +Edit [gfx/pokemon/idles.asm](../blob/master/gfx/pokemon/idles.asm): + +```diff + BulbasaurAnimationIdle: INCLUDE "gfx/pokemon/bulbasaur/anim_idle.asm" + ... + CelebiAnimationIdle: INCLUDE "gfx/pokemon/celebi/anim_idle.asm" ++MunchlaxAnimationIdle: INCLUDE "gfx/pokemon/munchlax/anim_idle.asm" + EggAnimationIdle: INCLUDE "gfx/pokemon/egg/anim_idle.asm" +``` + +Edit [gfx/pokemon/bitmask_pointers.asm](../blob/master/gfx/pokemon/bitmask_pointers.asm): + +```diff + BitmasksPointers: + dw BulbasaurBitmasks + ... + dw CelebiBitmasks ++ dw MunchlaxBitmasks +``` + +Edit [gfx/pokemon/bitmasks.asm](../blob/master/gfx/pokemon/bitmasks.asm): + +```diff + BulbasaurBitmasks: INCLUDE "gfx/pokemon/bulbasaur/bitmask.asm" + ... + CelebiBitmasks: INCLUDE "gfx/pokemon/celebi/bitmask.asm" ++MunchlaxBitmasks: INCLUDE "gfx/pokemon/munchlax/bitmask.asm" + EggBitmasks: INCLUDE "gfx/pokemon/egg/bitmask.asm" +``` + +Edit [gfx/pokemon/frame_pointers.asm](../blob/master/gfx/pokemon/frame_pointers.asm): + + ```diff + FramesPointers: + dw BulbasaurFrames + ... + dw CelebiFrames ++ dw MunchlaxFrames +``` + +Finally, edit [gfx/pokemon/johto_frames.asm](../blob/master/gfx/pokemon/johto_frames.asm): + + ```diff + JohtoFrames: + ChikoritaFrames: INCLUDE "gfx/pokemon/chikorita/frames.asm" + ... + CelebiFrames: INCLUDE "gfx/pokemon/celebi/frames.asm" ++MunchlaxFrames: INCLUDE "gfx/pokemon/munchlax/frames.asm" + EggFrames: INCLUDE "gfx/pokemon/egg/frames.asm" +``` + +Note that we edited johto_frames.asm, not kanto_frames.asm, because `MUNCHLAX` comes after `JOHTO_POKEMON` in [constants/pokemon_constants.asm](../blob/master/constants/pokemon_constants.asm). + +That's it—we're done! Munchlax works just like every other Pokémon. + + + + +## 11. Adding up to 253 Pokémon + +TODO diff --git a/Tutorials.md b/Tutorials.md index 9e80d66..03fbdbc 100644 --- a/Tutorials.md +++ b/Tutorials.md @@ -9,6 +9,7 @@ Tutorials may use diff syntax to show edits: **How to add a new…** +- [Pokémon species (Munchlax)](Add-a-new-Pokémon) - [Type (Fairy)](Add-a-new-Fairy-type) - [Item (including a healing item, held item, Poké Ball, evolution stone, Town Map, etc)](Add-different-kinds-of-new-items) - [TM (up to 120 TMs)](Add-a-new-TM) diff --git a/screenshots/gfx-footprints-munchlax.png b/screenshots/gfx-footprints-munchlax.png Binary files differnew file mode 100644 index 0000000..a382d91 --- /dev/null +++ b/screenshots/gfx-footprints-munchlax.png diff --git a/screenshots/gfx-pokemon-munchlax-back.png b/screenshots/gfx-pokemon-munchlax-back.png Binary files differnew file mode 100644 index 0000000..b18250a --- /dev/null +++ b/screenshots/gfx-pokemon-munchlax-back.png diff --git a/screenshots/gfx-pokemon-munchlax-front.png b/screenshots/gfx-pokemon-munchlax-front.png Binary files differnew file mode 100644 index 0000000..c2f526d --- /dev/null +++ b/screenshots/gfx-pokemon-munchlax-front.png diff --git a/screenshots/munchlax.png b/screenshots/munchlax.png Binary files differnew file mode 100644 index 0000000..af97e88 --- /dev/null +++ b/screenshots/munchlax.png |