Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#1 2016-02-28 02:18:38

ShantyTown
Member
Registered: 2013-12-04
Post 255/344

Expanding the Dex Past 255 Pokémon

Here's the github link.  It's the "expand-dex" branch of my pokered fork.
https://github.com/huderlem/pokered/tree/expand-dex

Hi, all.  I've spent the last few weeks investigating and implementing the changes needed to expand pokered's Dex past 255 pokemon. Pokemon ids are two bytes, so you could theoretically fit thousands of pokemon...  It turns out that the changes were relatively straightforward, but very tedious.  At this point, all of the important engine changes are complete, and we're just adding pokemon.

Some important things to note:
- BaseStats data can be put in any bank. They no longer have to be contiguous relative to each other.
- EvosMoves data can be put in any bank.
- Trainer Ids no longer start at $C9--they start at $00.
- Pokemon constants are two bytes now, so make sure to use "dw", instead of "db" in the disassembly.


If you're interested in helping add pokemon, feel free to send pull requests to the git repository mentioned at the top of this post. (Remember, it's the "expand-dex" branch of that repository).

Current status (let me know if you want to claim any of the pokemon to work on):

Completed:
Chikorita (#152) through Shiftry(#275)

To-Do:
Taillow
Swellow
Wingull
Pelipper
Ralts
Kirlia
Gardevoir
Surskit
Masquerain
Shroomish
Breloom
Slakoth
Vigoroth
Slaking
Nincada
Ninjask
Shedinja
Whismur
Loudred
Exploud
Makuhita
Hariyama
Azurill
Nosepass
Skitty
Delcatty

Known Bugs:
1.  Pokédex entries after 255 have "001" at their Pokédex entry screen, and their Pokédex number loops back to 000 at 256 and increments normally from there

To be continued...

Last edited by ShantyTown (2016-12-05 19:48:48)

Offline

#2 2016-02-28 12:23:09

Crystal_
Member
From: Spain
Registered: 2012-09-16
Post 366/450
Website

Re: Expanding the Dex Past 255 Pokémon

This is amazing! I had thought about this in the past but thought it would take closer to a year than a few weeks. That said, it was when a lot of pokemon data offsets were hardcoded but it's an incredible effort nonetheless! To be honest, I never thought I would see a dex expansion being done due to all the tedious work involving it.

On another note, I don't think that adding all 720 pokemon would be necessary strictly speaking, I guess that would be up to whoever wants to utilize your mod as a base (and I'm sure, that would be many people).

Last edited by Crystal_ (2016-02-28 12:25:21)

Offline

#3 2016-02-28 16:10:16

Schattenjäger
Member
Registered: 2015-10-21
Post 24/25

Re: Expanding the Dex Past 255 Pokémon

YOU DID WHAT?!

This is amazing. I've been busy with some other stuff in my hack, and haven't even checked the boards in a while, and now I see this. Great job. I will definitely look into this. I'd be interested in doing the same for moves.

I'll try to make this work, and absolutely credit you, if I do, ShantyTown. :)

Offline

#4 2016-02-28 16:31:30

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 3,253/3,578

Re: Expanding the Dex Past 255 Pokémon

Like I said on Twitter, this is really impressive. Like Crystal, I always assumed this would take ages, but you really got after it. I'll take a look through the repo and see if I can at least help you with testing and whatnot. Maybe I'll port this to Red++ eventually but I can already see that some things might interfere of course. Anyways, looking good, and I went ahead and followed the repo on github.

Offline

#5 2016-02-28 16:54:25

Fotomac
Member
Registered: 2015-10-25
Post 158/332

Re: Expanding the Dex Past 255 Pokémon

Now I know who to thank when my hack includes the Gen III species in addition to the Gen I and Gen II species.

Offline

#6 2016-02-28 16:58:55

ShantyTown
Member
Registered: 2013-12-04
Post 256/344

Re: Expanding the Dex Past 255 Pokémon

As Crystal mentioned, the feasibility of this hinged on the completeness of pokered.  I only ran into two cases of difficult bugs occurring due to hardcoded constants in pokered, and I committed those fixes to pokered.

I think my plan moving forward is to first add ~300 pokemon.  Then, play through the game completely to discover any bugs that haven't appeared for pokemon ids that are less than 256.

Offline

#7 2016-02-28 17:02:06

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 3,254/3,578

Re: Expanding the Dex Past 255 Pokémon

I'm curious how you're planning to handle the Fossil pics and the Ghost battle. Are those going to stay as Pokémon ID slots, or will they be a separate thing?

Offline

#8 2016-02-28 18:54:06

ShantyTown
Member
Registered: 2013-12-04
Post 257/344

Re: Expanding the Dex Past 255 Pokémon

I just kept them the same.  They have their own pokemon ids.

Offline

#9 2016-02-28 19:16:19

Fotomac
Member
Registered: 2015-10-25
Post 159/332

Re: Expanding the Dex Past 255 Pokémon

When I expand the Dex for my own hack, I'm going by a different ID set and moving the Ghost and Fossil IDs closer to the 256 mark.

Offline

#10 2016-02-28 21:39:30

ShantyTown
Member
Registered: 2013-12-04
Post 258/344

Re: Expanding the Dex Past 255 Pokémon

I believe there would be no impact of changing the ids of the Ghost/fossils.  I think you might be getting the Ids mixed up with the pokedex ids.

Offline

#11 2016-02-29 04:43:44

ShantyTown
Member
Registered: 2013-12-04
Post 259/344

Re: Expanding the Dex Past 255 Pokémon

The pokedex works now!

gXCeSEx.png

Mateo, I don't think GitHub will notify you about activity that doesn't occur on the master branch, FYI.  At least, it's not showing any public activity on my account, even though I've pushed lots of commits to that branch lately.

Offline

#12 2016-02-29 05:12:55

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 3,255/3,578

Re: Expanding the Dex Past 255 Pokémon

Thanks for the heads-up, I'll just have to keep an eye on it manually as well. Nice progress!

Offline

#13 2016-02-29 22:10:27

Urnighter
Member
Registered: 2015-01-17
Post 120/123

Re: Expanding the Dex Past 255 Pokémon

This is sick.

Where would you be getting sprites from?

Offline

#14 2016-03-01 02:29:42

ShantyTown
Member
Registered: 2013-12-04
Post 260/344

Re: Expanding the Dex Past 255 Pokémon

That's a great question.  Sanquii's randomizer has gen-1-style sprites for all 721, but he isn't releasing them at the moment due to concerns about how the various creators intended the sprites to be used.  (At least, that's what I remember him saying last time I asked)

Offline

#15 2016-03-18 01:51:02

ShantyTown
Member
Registered: 2013-12-04
Post 267/344

Re: Expanding the Dex Past 255 Pokémon

Here's an update on this project.  As far as I know, everything works.  However, a full playthrough of the game will need to be done eventually.  I disabled the Hall of Fame PC functionality because it would have been annoying, and I doubt anybody cares about it anyway.

I also decided to use HD backsprites (56x56 pixels) because it's easier to plop in Gen 2 backsprites for the gen 2 pokemon.  Otherwise, there would be a ton of effort required for resizing them to 32x32 pixels.

So far, I've added Chikorita through Typhlosion.  I've also allocated space in some of the data lists for pokemon up to Swampert.

Here's an example commit of adding pokemon, if anyone is interested in helping: https://github.com/huderlem/pokered/com … f1f84a02d3

Offline

#16 2016-04-14 03:16:20

daMoose52
Member
Registered: 2014-11-14
Post 24/108
Website

Re: Expanding the Dex Past 255 Pokémon

Any chance of a writeup on what was done?
I've been working on a mod for a while now and could adapt code, but can't exactly start with a fresh base very easily.


Pokemon: Project Neo A Pokemon hack 15 years in the making...

Offline

#17 2016-04-14 14:39:50

ShantyTown
Member
Registered: 2013-12-04
Post 274/344

Re: Expanding the Dex Past 255 Pokémon

daMoose52 wrote:

Any chance of a writeup on what was done?
I've been working on a mod for a while now and could adapt code, but can't exactly start with a fresh base very easily.

Here's the general idea:
1. Update wram.asm to change all of the pokemon id bytes from 1 byte to 2 bytes.
2. For each of those bytes in wram.asm that were changed, go through the entire game's code and update the code so that it makes use of the two-byte value instead of the 1-byte value.

If you want more detail than that, all of the commits are available to see in the GitHub repository.  This isn't a change that you can easily add to an existing project because it touches pretty much every part of the game's code...

Offline

#18 2016-04-14 14:45:03

daMoose52
Member
Registered: 2014-11-14
Post 28/108
Website

Re: Expanding the Dex Past 255 Pokémon

ShantyTown wrote:

This isn't a change that you can easily add to an existing project because it touches pretty much every part of the game's code...

Roger that; I'll see if I can't extract more of my changes then and recreate them.
Its been a while since I've been under the hood of mine so I may have more content (maps, scripts, etc) than system changes. Might be easier than expected.

Do want to say: thanks for making this available!!


Pokemon: Project Neo A Pokemon hack 15 years in the making...

Offline

#19 2016-04-14 15:34:09

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 3,286/3,578

Re: Expanding the Dex Past 255 Pokémon

daMoose52 wrote:
ShantyTown wrote:

This isn't a change that you can easily add to an existing project because it touches pretty much every part of the game's code...

Roger that; I'll see if I can't extract more of my changes then and recreate them.
Its been a while since I've been under the hood of mine so I may have more content (maps, scripts, etc) than system changes. Might be easier than expected.

Do want to say: thanks for making this available!!

If you project's source is as outdated as you said before (from like 2014 I think you said) you may run into additional issues, such as data sizes that are still hard-coded in your copy but dynamic in the up-to-date copy that this was based on, so that's something to look out for as well. Something I'll have to keep in mind too, since I haven't pulled in updates to Red++ in a while either (I had various reasons for that, and still manually copied over some updates that were important, such as removing hard-coded values in the Save routines and that sort of thing, while not worrying about random things like Object Macros that just broke compatibility with the map editor I'm using anyway).

Last edited by Mateo (2016-04-14 15:37:54)

Offline

#20 2016-04-14 15:57:29

daMoose52
Member
Registered: 2014-11-14
Post 29/108
Website

Re: Expanding the Dex Past 255 Pokémon

It was late '14, like November, so a lot of the memory elements are already dynamic. Very few are hardcoded I am finding, thankfully. One small headache was a hardcode of my own I just turned up :D My flag array for 152+ Pokemon was overrunning some data, so I moved it after narrowing that down only to lose connection with my starter script Pokedex flags. Took me a second to remember where that was set, but was an easy fix when I ran it down and properly made it dynamic so I don't run into that issue again.


Pokemon: Project Neo A Pokemon hack 15 years in the making...

Offline

#21 2016-04-14 16:03:50

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 3,288/3,578

Re: Expanding the Dex Past 255 Pokémon

I wasn't talking about addresses being hard-coded (although you still have some, since you will still have wram constants manually declaring a few). I was talking about the lengths of data structures, such as having a hard-coded amount of bytes to copy instead of like "ld bc, wPartyMon2 - wPartyMon1" or whatever, it might still be hardcoded with the original length of a party structure, which would cause problems when you increase the size of a party structure by making the 'mon ID two bytes instead of one. Not saying there will be a lot, just saying it's something to be on the lookout for.

Offline

#22 2016-04-18 05:47:08

Mmmmmm
Member
From: West Virginia
Registered: 2015-05-17
Post 17/261

Re: Expanding the Dex Past 255 Pokémon

I very much admire and appreciate this project. One question I have to add with regards to adding new Pokémon is, what should be done about Pokémon with evolution methods that don't exist in Gen 1? For example, I've added the Ledyba and Spinarak lines mostly fine, only having to compromise with their movesets, but the next Pokémon to add is Crobat, a happiness evolution. What should be the priority? Should happiness be backported to the game or should it be given an existing evolution method, like how Red++ evolves Golbat into Crobat via Moon Stone?

Offline

#23 2016-04-18 14:13:14

Mateo
Member
From: The Sims 4
Registered: 2009-11-25
Post 3,294/3,578

Re: Expanding the Dex Past 255 Pokémon

Speaking of Red++ we probably should port some of the new evolution methods over to this, like I did for... most of them except happiness.

Offline

#24 2016-04-18 14:43:02

ShantyTown
Member
Registered: 2013-12-04
Post 275/344

Re: Expanding the Dex Past 255 Pokémon

I think we should punt the happiness evolution type for now, since it requires a bigger engine change than just adding an easy new evolution type.  If a pokemon has a non-trivial new evo type, I would just use a normal level-based evolution for now.  Here's some quick thoughts on the new types:

Tyrogue - Easy to add.
Friendship - Just do level-based for now.
Knows Move - Easy to add.
Level Up in Certain Area - Easy to add.
Time of Day - Easy to add.  Just look at the in-game time to fake it?
Level Up while Holding Item - Just do level-based for now.
Level Up while Holding the GameBoy upside down - Why does this even exist?

Offline

#25 2016-04-19 02:32:40

ShantyTown
Member
Registered: 2013-12-04
Post 276/344

Re: Expanding the Dex Past 255 Pokémon

FYI, I'm going to try to keep the first post updated with a list of pokemon that people are working on adding, so that we don't duplicate work.

Offline

Board footer

Powered by FluxBB