Skeetendo

’Cause all games were better on the GBC

You are not logged in.

#26 2016-03-21 07:45:49

TotesTim
Member
Registered: 2016-03-03
Post 9/12

Re: A Tutorial for Adding New Pokémon in Pokered

So, I went through each Pokemon's asm files to see where I messed up, only to come up with nothing. I then had the idea to copy over the Pokemon asm files from Danny-E's colorized Pokemon Red project, since the Pokemon base stats asm files are structured in the same way as to what I was trying to do. The result? Well, everything works just fine now. Some Pokemon that weren't working properly before for whatever reason (Mew and Starmie from what I had tested before, even though they had their basestat asm files set up properly from what I could tell) now work as intended, and I was even able to add in another working Pokemon. I hope that you don't mind that I used your files to work with, Danny-E. I figured it'd be okay, since you said at one point that your project was all right to be used as a base for other projects as long as credit was given.

Results (don't mind the unfitting placeholder sprites):

IkRttao.png

d08zkbS.png

I'll continue to work on implementing the new slots that I have planned for my hack, but in the meantime, I'm in pretty good standing. I do have one more question for the time being, however. How difficult is it to simply change which Pokemon corresponds to which Pokedex number? Would it be as simple as changing the order of the files in pokedex_constants.asm, or is there more to it than that? (Example: Giving Pikachu a dex number of 64 instead of 25.)

Last edited by TotesTim (2016-03-21 07:47:06)

Offline

#27 2016-03-21 14:39:32

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

Re: A Tutorial for Adding New Pokémon in Pokered

Glad you figured it out. If all you did was copy the files from the  colorized project, then something was wrong with the files that you replaced.

To change the pokedex order, reorder the entries in "pokedex_constants.asm".
https://github.com/pret/pokered/blob/ma … stants.asm

Offline

#28 2016-03-22 06:22:51

TotesTim
Member
Registered: 2016-03-03
Post 10/12

Re: A Tutorial for Adding New Pokémon in Pokered

First off, I'd just like to say thanks to you guys for being so helpful. It's really refreshing to see people be so willing to lend a hand to the inexperienced, and not get berated in the process.

Secondly, I did manage to swap around the entries in "pokedex_constants.asm", but it appears that it's not a perfect swap, unfortunately. Here's what I mean; I swapped Pikachu (#25) with Kadabra (#64).

YCL0LU1.png

Pikachu's name and cry gets applied to Pokedex slot 64, but everything else (sprite, moveset, type, base stats) are that of Kadabra's, and vice versa for slot 25. It's kind of wonky to work with in this manner, but maybe there's something else that I need to swap around as well? Any thoughts on this?

Offline

#29 2016-03-22 06:31:19

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

Re: A Tutorial for Adding New Pokémon in Pokered

The order of the base stats is also important: https://github.com/pret/pokered/blob/ma … _stats.asm

The routine that parses the base stats assumes that the list appears in pokedex order.  The mon's initial moveset, sprites, type, etc. are all included in the base stats.

Offline

#30 2016-03-22 07:11:49

TotesTim
Member
Registered: 2016-03-03
Post 11/12

Re: A Tutorial for Adding New Pokémon in Pokered

That makes sense, and it also did the trick. All of the rearranged slots work as they should now. Thanks again, pal.

Offline

#31 2016-04-06 08:17:07

KeiTaRo
Member
Registered: 2015-12-05
Post 14/49
Website

Re: A Tutorial for Adding New Pokémon in Pokered

Danny-E 33 wrote:

It's possible that this is a wram-shifting issue.
As you increase NUM_POKEMON, the number of bytes reserved in ram for the dex seen/owned flags increases.
We've tried to make it so that you can increase this section of ram (shifting everything after it down) but it still is not bug free I think.
A solution to this is to keep one flag array where it originally is (and let it overlap the other original array) and move the other array to a free space in wram.
Here is what I mean. Original:

wMainDataStart::

wPokedexOwned:: ; d2f7
    flag_array NUM_POKEMON
wPokedexOwnedEnd::

wPokedexSeen:: ; d30a
    flag_array NUM_POKEMON
wPokedexSeenEnd::


wNumBagItems:: ; d31d

You could try changing this to:

wMainDataStart::

wPokedexOwned:: ; d2f7
    flag_array NUM_POKEMON
wPokedexOwnedEnd::

    flag_array 2 * 151 - NUM_POKEMON
wPokedexSeenEndOld::

wNumBagItems:: ; d31d

Then change this:

wDestinationWarpID:: ; d42f
; if $ff, the player's coordinates are not updated when entering the map
    ds 1

    ds 128

wNumSigns:: ; d4b0

To this:

wDestinationWarpID:: ; d42f
; if $ff, the player's coordinates are not updated when entering the map
    ds 1


wPokedexSeen::
    flag_array NUM_POKEMON
wPokedexSeenEnd::


    ds 128 - (wPokedexSeenEnd - wPokedexSeen)

wNumSigns:: ; d4b0

Then change the two instances of "wPokedexSeenEnd" to "wPokedexSeenEndOld" in engine/save.asm

Hi, thanks for this suggestion! I tried doing this and a lot of oddities are occuring (I'm using pokered-gen-ii as a base)...specifically, I attempted to add a Slugma and Magcargo over existing Missingno slots (ignore the Chikorita issues from before, this is a fresh project)...I did everything correctly and they show up in the game, but the Pokedex now will not display anything past 144 entries, and Magcargo's graphics have its tiles completely jumbled...other oddities like wild Slowbro at level 163 showing up on Route 3, overworld NPCs walking on top of doors, stuff that it definitely wasn't doing before. Would it help if I set up a repository of my hack for someone to see where I may have gone wrong?

EDIT: Never mind, I seem to have fixed it! I had no idea that the game was hardcoded to only allow up to 153(?) Pokemon in the Pokedex, regardless of what you set in the Pokedex constants. When I modified this code, the problem seems to have gone away....so far! If anyone is having a similar issue, this code is located in engine/menu/pokedex.asm

EDIT 2: well, I fixed the Pokedex issue, anyway. Magcargo's graphics are still all jumbled and messed up
pokered.png

EDIT 3: looks like the issue was that Magcargo's sprite was 48x49 ....... gosh, I feel really stupid -_- goes to show it's usually something simple that you overlook.

Last edited by KeiTaRo (2016-04-06 12:37:59)

Offline

#32 2016-04-06 21:16:15

Danny-E 33
Administrator
Registered: 2012-06-09
Post 944/1,048

Re: A Tutorial for Adding New Pokémon in Pokered

My first guess with the wild pokemon and overworld bugs would be a bad save file. Once the contents of wram are shifted by any number of bytes, an old save file will write to the wrong ram addresses when being loaded, which of course can lead to very unpredictable bugs.


Red Hack: Pokémon Prototype

Total number of registered users: 8000+
Total number of active users: ~12

Offline

#33 2016-04-23 09:24:14

KeiTaRo
Member
Registered: 2015-12-05
Post 20/49
Website

Re: A Tutorial for Adding New Pokémon in Pokered

I managed to fix all issues I had been having up to this point, thank you for your help with everything so far. I am, however, encountering a new issue which has me stumped. I noticed when adding Pokemon after Victreebel (specifically, starting at around index $C4 I think?), they function perfectly fine (even moreso now that I separated trainers and Pokemon) but only up until they evolve. The evolution itself works totally fine, however it claims that the Pokemon has evolved in to, for example "HM01" and so on, continuing on through the rest of the TM names with each index number. The nickname of the Pokemon also remains the same (so for instance, TOTODILE would stay as TOTODILE despite now being a CROCONAW) .... weird part is the Pokemon evolves perfectly fine otherwise, and their names appear correctly both in the Pokedex and stats screen (the second screen showing the true species name) ... is there a reason the game is loading names from the item list when it evolves? is there some sort of hard-coded limiter for what constitutes a valid Pokemon index number?

Edit: Examples

wtftret.PNG nameweird.gif

Last edited by KeiTaRo (2016-04-24 10:07:09)

Offline

#34 2016-06-10 18:03:18

KeiTaRo
Member
Registered: 2015-12-05
Post 24/49
Website

Re: A Tutorial for Adding New Pokémon in Pokered

So I've continued adding Pokemon to my hack with much success but still am encountering this weird naming bug with the evolution. Does anyone have any possible insight on this? I'm really stumped. It's obvious that the name it pulls is corresponding to whatever item has the same index number as that Pokemon (in this case, a TM) but....I have no idea WHY it would ever do that :(

Offline

#35 2016-06-10 19:01:16

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

Re: A Tutorial for Adding New Pokémon in Pokered

It happens because the function for looking up a name in Red was coded by a lazy person who made it so ANY idea above a certain value would read a TM name, with no regard to what list it was actually supposed to be checking.

I got around it by editing it to check which list type we were dealing with, and skip the TM/HM check if it wasn't an Item, and then I had to edit a couple of other places to make sure they loaded the proper list type. Sadly there isn't one clean concise commit to link you to, since I had to fix various errors at different times coming from the same root problem, only to realize I hadn't fully fixed it yet. I recall there being an issue with TMs themselves related to this at one point, as well.

This is how the routine looks currently in Red++, and you would also need to edit this as well. I *think* that would get it to the point that works properly for everything, but I might have missed something. I know I changed that routine itself a few different times, but I think that will cover the stuff relevant to you. One of the other issues was with custom code you wouldn't have, so those should be the main fixes.

Another possible solution could be to just remove the TM/HM check and the side code that it calls entirely, and just give TMs regular names like every other item instead of them being special snowflakes. Haven't tested what other issues that might cause yet, though.

Offline

#36 2016-06-18 10:39:30

KeiTaRo
Member
Registered: 2015-12-05
Post 25/49
Website

Re: A Tutorial for Adding New Pokémon in Pokered

fixyay.PNG

That fixed it!!! Thank you so much!

Offline

#37 2016-06-18 13:59:12

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

Re: A Tutorial for Adding New Pokémon in Pokered

KeiTaRo wrote:

No problem, glad you got it working.

Offline

#38 2016-10-07 16:37:28

Nic7C5
Member
From: Germany
Registered: 2012-10-13
Post 50/52

Re: A Tutorial for Adding New Pokémon in Pokered

I'm trying to insert pokemon from gold/silver in red/blue with a python script. It's build upon pokecrystal and Danny's pokered-gen-II. So far it does the following:

creating a first generation basestat (and more) file from pokecrystal data. It doesn't yet covert the TM/HM learnset
Unbenannt10.PNG

including the pokemon in base_stats.asm
Unbenannt3.PNG

replacing the first missingno-spot in pokemon_constants.asm
Unbenannt4.PNG

adding it in pokedex_constants.asm and updating NUM_POKEMON
Unbenannt5.PNG

adding a new super gameboy palette, also adding it in palette_constants.asm and mon_palettes.asm (is this the right spot?)
Unbenannt6.PNG

Unbenannt7.PNG

Unbenannt8.PNG

copied Rhydon's cry for all missingnos

evos_moves.asm gets an evolution entry for the next free monster (e.g. Mon152) - which I removed manually for now, as the reassembly produces an error, when I refer to pokemon that haven't yet been inserted. The learnset isn't yet implemented.
Unbenannt9.PNG

Assigning a party-sprite in mon_party_sprites.asm and including the front and back sprite in main.asm
Unbenannt11.PNG

Unbenannt12.PNG

But as you might imagine, it doesn't work. =)
I replaced a starter pokemon with Chikorita. When I access it the pokedexscreen pops up, I see the right name but no sprite. When chosing it the pokemon changes to Rhydon (ID 01 instead of ID 1F which I replaced).

From what I can tell, the basestats are written correctly (dec(98) = 152, no tm/hm data yet) and points to the bank where the sprite is.
Unbenannt13.PNG

What did I miss/forgot/do wrong?

Offline

#39 2016-10-07 17:54:20

MechanicalPen
Member
Registered: 2016-06-22
Post 24/29

Re: A Tutorial for Adding New Pokémon in Pokered

You need to change UncompressMonSprite to know where to look for your added MonSprite. I think you also forgot to add it to the PokedexOrder list.

Last edited by MechanicalPen (2016-10-07 17:54:35)

Offline

#40 2016-10-07 19:18:03

Nic7C5
Member
From: Germany
Registered: 2012-10-13
Post 51/52

Re: A Tutorial for Adding New Pokémon in Pokered

MechanicalPen wrote:

You need to change UncompressMonSprite to know where to look for your added MonSprite. I think you also forgot to add it to the PokedexOrder list.

Ain't that UncompressMonSprite (get bank...) obsolete in Danny's version, where the bank the sprite is saved at is determined by the last basestat byte?

Is there an other list in Dex order than pokedex_constants.asm?

Last edited by Nic7C5 (2016-10-07 19:19:16)

Offline

#41 2016-10-07 20:30:26

Danny-E 33
Administrator
Registered: 2012-06-09
Post 985/1,048

Re: A Tutorial for Adding New Pokémon in Pokered

Besides the already mentioned UncompressMonSprite and data/pokedex_order.asm, it looks like you forgot data/pokedex_entries.asm, text/monster_names.asm and text/pokedex.asm.

Also note that if you add 2 or more Pokemon, you have to fix wPokedexSeen in wram.asm.

Check out here and here.

Although, the better edit to UncompressMonSprite isn't in that branch. You should get that routine from pokered-gen-II.


Red Hack: Pokémon Prototype

Total number of registered users: 8000+
Total number of active users: ~12

Offline

#42 2016-10-07 22:34:42

Nic7C5
Member
From: Germany
Registered: 2012-10-13
Post 52/52

Re: A Tutorial for Adding New Pokémon in Pokered

Danny-E 33 wrote:

Besides the already mentioned UncompressMonSprite and data/pokedex_order.asm, it looks like you forgot data/pokedex_entries.asm, text/monster_names.asm and text/pokedex.asm.

Also note that if you add 2 or more Pokemon, you have to fix wPokedexSeen in wram.asm.

Check out here and here.

Although, the better edit to UncompressMonSprite isn't in that branch. You should get that routine from pokered-gen-II.

I forgot pokedex_order.asm. That was ist. It works now. I'll give you an update, when the missing features are integrated.


Update:

pokered_03.png

pokered_05.png

Seen: Pidgey, Rattata and 9 inserted pokemon
Owned: 151 + 9 inserted pokemon (I started with a now corrupted 100% .sav)

Last edited by Nic7C5 (2016-10-09 00:17:07)

Offline

#43 2017-12-05 06:17:47

Maya Hack
Member
Registered: 2017-11-23
Post 4/16

Re: A Tutorial for Adding New Pokémon in Pokered

Thank you for these tutorials! They've been very helpful.

Offline

Board footer

Powered by FluxBB