+/pokedex
cli pokedex that reads data from roms
git clone https://git.julia.blue/+/pokedex
2e697db
main
files
| examples/ | |
| src/ | |
| .envrc | 10 B |
| .gitignore | 25 B |
| Cargo.lock | 11.8 KiB |
| Cargo.toml | 335 B |
| README.md | 8.0 KiB |
| flake.lock | 1.4 KiB |
| flake.nix | 310 B |
Why does this exist
I was Feeling Restless at work. I haven't gotten to write a non-trivial amount of rust recently. I've also been doing a LOT of small tweaks to various software I use as I bring up my new laptop and I'm exhausted from that and want to stop worrying about those big programs and their various shortcomings by writing a teeny program that perfectly satisfies my use case.
eevee's blog post does this for the full-size sprites, but I want the smaller menu/box sprites to display in my terminal. once I realized this I decided to go do it myself for fun. eevee's toolkit for data extraction (or the hg/ss decompilation) can probably get those icon-sized sprites too, but I didn't bother checking.
This one had the coolest UI out of the dozen or so I looked at, so it's what I'll try to recreate. That means I need not only sprites, but names, nicknames, evolutions, types, height/weight, and pokedex prose.
🍍 file diamond.nds&& md5sum diamond.ndsdiamond.nds: Nintendo DS ROM image:"POKEMON D" (ADAE01, Rev.05) (decrypted )02a1af2a677d101394b1d99164a8c249 diamond.nds
Side note: it's cool that file has support for these ROMs, I went and found the source because I was pleasantly surprised that it just worked.
Scope Creep
There's lots of pokemon games and they've got lots of art/data, but the maximum I'd be interested in covering are:
Games:
- Fire Red/Leaf Green
- Ruby/Sapphire/Emerald
- Heart Gold/Soul Silver
- Diamond/Pearl/Platinum
- maybe b/w/b2/w2?? after i play them?
Info (priority list):
- box sprites
- pokedex prose description
- pokedex attributes (height/weight)
- type/stats
- evolutions
- hg/ss overworld sprites (2 frames for all 4 directions)
- abilities
- front sprites
- moves? learnset/teachset/egg/tutor/description/power/acc/probabilities
- back sprites
- pokeball/other item sprites
Trainer teams with full level/stat/moveset info and the trainersprite would be cool but wayyyy too much work
remember to double check for exact sprite re-use (I've heard some platinum sprites just swapped frame 1/2)
Functionality:
- dex entries:
- name/nick/num
- height/weight
- sprite, change the pool based on dimensions
- random version or arg to lock a gen/game/type/shiny
- type/strengths/weaknesses (including 0/4x)
- stats
- evolution chart
- 2 frame box sprite animations seem doable, and I'll at least get static versions of both large frames but probably not the more dynamic animations from emerald and onward.
- ability/learnset
- type chart
- region
- cli
- hyphen option completion, otherwise name/number(id) and gender/form for second positional arg
Ideas
- levenshein distance or fuzzy search for names?
- natures grid
- type chart
- single and double type effectivenesses
- move coverage calculator?
- search for mons that can learn certain move(s) alongside certain abilities with certain type(s), filter thresholds or sort by stats?
- this cli pokedex has some cute filter options
- favorite picker
References
- great historical background and technical breakdown of the gba and nds
- comprehensive gba/ds technical resource including file formats: GBATEK
- gen 3 color palettes explanation
- hgss had an unnamed filesystem but some resources like this have guides to which file is which
- data format notes and dumps for all gen 4 games
- more detailed hg/ss data format docs for hg/ss
- rom hacking guide with great info on movesets (if i wanted to do add move tutor support this is a good starting place)
- another ds rom header breakdown with the extra dsi bits (maybe relevant if I ever want to support b/w/b2/w2)
- list of pokemon with forms
- uxie is a project that implements most of the functionality I'd like to write. If I weren't writing this tool for fun I'd just use this as a library.
- backup of a great resource on ds file formats which includes the formats used for sprites
- blz compression explanation for the arm9 in hg/ss
eevee's blog posts:
- https://eev.ee/blog/2016/08/05/storing-pok%C3%A9mon-without-sql
- https://eev.ee/blog/2017/08/02/datamining-pokemon
tools and resources to read/dump nitro filesystem:
- high quality rust library + cli
- another rust library and a less complete one
- https://github.com/pret/ds_disassembly_tools
- https://scenegate.github.io/Ekona/
- cute blog post on making the smallest nds file possible
tools to dump narcs:
- https://github.com/nickworonekin/narchive
- https://ndspy.readthedocs.io/en/latest/api/narc.html
hacking tools/editors that probably already have all the info I want:
- https://github.com/magical/pokemon-nds-sprites for gen4 sprites
- https://github.com/haven1433/HexManiacAdvance for gen3
- https://github.com/turtleisaac/PokEditor for gen4
other terminal pokemon sprite renderers:
- https://github.com/Tenchi2xh/pokedex-cli
- https://github.com/yannjor/krabby and this fork
- https://github.com/talwat/pokeget-rs
- https://github.com/31marcosalsa/pokeTerm
- https://github.com/Findarato/pokemon-colorscripts
- https://github.com/possatti/pokemonsay
- https://github.com/HRKings/pokemonsay-newgenerations
msg file string parsing:
- https://github.com/yakoswg/chatot
- https://codeberg.org/AyashiBox/pkmn-strings
possible online sources for fallback data that I don't derive like encounter tables:
- veekun (TODO: check if their database has this and maybe use it offline?)
- serebii
- bulbapedia
- pokemondb
- pokeapi using either of these libraries
existing sprite databases to check against:
- veekun's (they also have a convenient separate download)
- pokesprite
- pokemondb/pokemondb/serebii have structured urls so i could scrape
notes
- msg.narc (i looked in diamond, soul silver, and platinum) TODO: check, since according to https://ds-pokemon-hacking.github.io/docs/generation-iv/guides/editing_moves/#move-name-description--battle-texts, the narc entries are different per game for various things
- 16 names
- 190 natures
- 192 pokemon nickname suggestions
- 205 statuses
- 310 names... japanese?
- 326 trade pokemon nicknames
- 343 item desc
- 344 item
- 362 POKEMON
- 373 berry types
- 382 place names
- 414 poffin types
- 495 stat names
- 552 abilities
- 554 ability descriptions
- 559 trainers
- 560 trainer titles
- 565 types
- 587 move descriptions
- 588 moves
- 615 pokedex entry
- 619 weight
- 620 height
- 621 "___ pokemon"
- in diamond and pearl hypnosis accuracy is 70, but in all the other gen 4 games it's 60. that's the only difference in their move data tables