The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary ROM Hacking (https://www.pokecommunity.com/forumdisplay.php?f=284)
-   -   Other Controlling What Pokemon Hatch Into (BPRE) (https://www.pokecommunity.com/showthread.php?t=360194)

AkameTheBulbasaur December 22nd, 2015 5:41 PM

Controlling What Pokemon Hatch Into (BPRE)
 
Does anyone know how Fire Red (BRPE) determines what Pokemon an egg will hatch into?

I ask because my Gengar eggs are hatching into Haunter and I don't know why.

I added a feature recently where if a certain stone is used on certain Pokemon it will "evolve" into an alternate form. The feature works just like normal evolution, except that the Pokemon can switch back by using the stone again. The game treats this as a normal stone evolution.

I think this might be the cause, because Gengar never produced Haunter before this, but I can't say for certain.

If there's anything anyone knows about the breeding mechanic in Fire Red, it would help me out a lot.

azurile13 December 22nd, 2015 7:56 PM

Can you read the game's THUMB code?
The majority of species determination occurs at 0x046000.
Within that routine, there is a particular bl to 0x045970 which loads the evolution table and may be your issue.

AkameTheBulbasaur December 23rd, 2015 12:02 AM

Quote:

Originally Posted by azurile13 (Post 9046181)
Can you read the game's THUMB code?
The majority of species determination occurs at 0x046000.
Within that routine, there is a particular bl to 0x045970 which loads the evolution table and may be your issue.

I can sort of read THUMB. I know what THUMB is and what some of the terms mean, but I could stand to be better. I will look at that table tomorrow when I'm off mobile.

Is there anything in particular I should know about how the table is structured? Such as how many bytes each entry takes up?

I know at the offset 0x46068 is the byte of an egg that would hatch into NidoranF, (which has a 50% chance of hatching into the byte at 0x4607E or NidoranM). I tried looking at that before to see if I could find Gengar's information (or rather Gastly's, to be more precise), but I wasn't sure how that was structured either so I didn't get very far.

azurile13 December 23rd, 2015 2:04 AM

Quote:

Originally Posted by AkameTheBulbasaur (Post 9046439)
I can sort of read THUMB. I know what THUMB is and what some of the terms mean, but I could stand to be better. I will look at that table tomorrow when I'm off mobile.

Is there anything in particular I should know about how the table is structured? Such as how many bytes each entry takes up?

I know at the offset 0x46068 is the byte of an egg that would hatch into NidoranF, (which has a 50% chance of hatching into the byte at 0x4607E or NidoranM). I tried looking at that before to see if I could find Gengar's information (or rather Gastly's, to be more precise), but I wasn't sure how that was structured either so I didn't get very far.

Well there is nothing specific for Gastly or anything, it is reading off of the evolution table. 8 bytes per entry. A halfword for evolution type, halfword argument, halfword species it evolves into, and halfword of padding. Not definitely in that order, I can't check right now because I'm on my phone. Anyways, my unsubstantiated guess would be that gengar is reading that it evolves from haunter, then that haunter is reading that it "evolves from" gengar, and a limited loop never gets back to gastly. Try switching the orders of the evolution entries. If that doesn't work, you'll need to actually go through the routines and possibly change them.

AkameTheBulbasaur December 23rd, 2015 10:41 AM

I did some testing and I think I know what's wrong. Since the game regards the form change as a true evolution, it thinks that the alternate form is the new third stage and the hatching is weird. I tried it with Camerupt, and no matter what I did, Camerupt just kept hatching into the "B Form" instead of Numel.

I think what I'll do is change the feature so it's only on Pokemon with no evolution to begin with.

Thanks for your help though! This information might be useful later to me or someone else! :D


All times are GMT -8. The time now is 2:24 AM.


Like our Facebook Page Follow us on Twitter © 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.