• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Development: Mega Animation for 3rd Gen

Status
Not open for further replies.
25
Posts
12
Years
  • Seen Aug 25, 2017
Hi there,


i finally have managed it, to do MegaEvolutions in the 3rd Gen. I show you this, in order to get feedback, but also to help me with the desing of the new Mega-Pokemon.
This system will not be availible for the public, but i definitly want to get feedback (and of course also some publicity for my hack pokemon violet). If somebody has done any further research on the battle system (especially for the "display text callback at 0x03004FE0), it would be great, if you could post it here or pm me.
Also Pm me if you want to help me with the sprite desing.



Here is a link to Pokemon Violet - also subscribe my channel if you want to. I will post my research on the battle system (which is merly enough to perform a mega evolution), but keep in mind that all ROM-Offsets (and eventually some RAM Offsets as well) are only for FireRed German.

The Battle System is parted into many sequenzes, e.g. oponent makes a move, you open the bag etc. Which sequence is executed next is stored on a callback handler. A callbacks loops every frame, and if it has finished it pushes an other callback to this handler. There are many callbacks, and i dont know how many there are, but most of the time RAM: 0x03004FE0 is used for the callbacks.

There are some callbacks i reserached so far, but notice that they will all return to the "normal" battle once they have finished.


  • 0x08108BCC | 1 : Return to the Battle, executes an item script form a table (usually your moves ends after that, because an item script from this table ends the move, but e.g. not for item 0x0)
  • 0x080A1FE0 | 1 : text is loaded, which text is related to an table which i have not found so far
As you might see now these callbacks are meant to be used in combination with an item. I use this callbacks in my mega_evolution, because they can be used in a item_battle_script safely.


Everybody who has hacked items so far knows, that battle_scripts are executed kinda weird. The ASM snippet seems to prepeare what has to be done afterwards. The pokeball for example just loads data into the RAM, then uses the "Return to Battle" callback. Because the item slot is pokeball (im RAM) the callback from the table is executed, and a pokeballs effect is now active, even thogh the code on the pokeballs data itself has been executed long ago.


Unfortunatley that is almost everything i figured out so far ;)
 
Last edited by a moderator:

Shiny Quagsire

I'm Still Alive, Elsewhere
697
Posts
14
Years
Simply amazing. The more we learn about battle scripts the better, this is literally one of the last frontiers of Gen III hacking we have yet to discover and now we are one step closer to fully understanding the battle engine.
 

Agastya

Grinding failed. Item Grind level dropped by 3.
73
Posts
14
Years
  • Age 33
  • Seen Mar 19, 2023
this method seems a little wonky - from the current implementation it appears you could mega then switch or mega then use an item

it also seems that you'll use the mega's base speed for the turn it evolves instead of the non-mega's base speed

it's still impressive and a step in the "right" direction (as far as hacking goes), don't get me wrong, but hopefully now that the baseline has been figured out it can be improved to be as accurate as possible instead of sticking with it with the community's typical "good enough" mentality that's stuck around for a little too long
 

DoesntKnowHowToPlay

Tiny Umbrella with Lots and Lots of Good
265
Posts
12
Years
  • Seen Feb 24, 2024
This system will not be availible for the public,
cool advertisement



To make this not just a blatant ad thread and actually have some content, I'm gonna dump some stuff I figured out from an old attempt at creating Relic Song that might be useful for creating mega evolutions.

Forms, in almost all cases, are most easily created using extra slots. There's a few reasons for this- the biggest in my opinion is that it trivializes changing base stats. Normally you'd have to do a bunch of obnoxious math to calculate the Mega's stats, but by tying the mon to a different slot you can just call the game's stat-recalc function (x3e47c) to do it for you after you change the mon's species to the new form's slot. More pragmatically, this method simplifies changing their sprites, abilities, type, weight, and cry. It also means you don't have to add a mega or form identifier anywhere as you can just check the species. As far as the pokedex goes, you can map every form of a mon to the same dex number, so encountering Rotom-W would get you Rotom's dex page if you used this method for it.

So, to implement mega evolution, you'd want to change the mon to the mega species provided that no other mega pokemon exist in the party (done by checking their species). You'd also want to update the battle structs to the new mon's stats, typing, species, and ability. You'd also need to run a routine that scans the party for mega-evolved pokemon (again, a species check) and changes their species to the appropriate normal mon at the end of every battle.

I think it should go without saying that ASM would be involved, especially in an implementation consistent with X/Y since it would need to happen after the player selects their command and turn order is decided but before any of the Pokemon actually move.


Here's some helpful offsets for changing a mon's species during battle:

x02023D6B: bank of the mon that is currently attacking. 0 is player's first mon, 1 is enemy's first mon, 2 is player's second mon (in doubles), 3 is enemy's second mon. Relevant if you want to do Relic Song or Stance Change, but not as much for properly implemented Megas.
x02023BCE: stores which party slot the active pokemon are mapped to. Somewhat non-intuitively, these are half-words, and are sorted in the same order as the above banks. (player's first mon, enemy's first mon, player's second mon, enemy's second mon). Values range from 0-5.
x02024284: player's party data. Each entry is 100 (x64) bytes long, encrypted- structure is same as documented here: http://bulbapedia.bulbagarden.net/wiki/Pokemon_data_structure_in_Generation_III
x0202402C: enemy's party data, stored same way as above.
x02023be4: Battle structs. There are four of them, each 88 (x58) bytes long. These store temporary data for the active pokemon, such as type changes, volatile status (curse/leech seed), stat modifiers, etc. This is *not* directly tied to the pokemon data- if you change the mon's species in pokemon data you'll need to update this yourself. They are documented in what should be a sticky thread here: http://www.pokecommunity.com/archive/index.php/t-215644.html
x02023bde: turn order- four bytes, holding the values 00, 01, 02, and 03 in the order those banks will move (just 00 and 01 in single battles).

x0803fbe8: decrypter- function used to read the pokemon data elegantly. Takes a Pokemon struct's address in R0 and an index to read in R1.
x0804037c: encrypter- function used to change the pokemon data elegantly. Takes a Pokemon struct's address in R0, an index to change in R1, and a pointer to the new data in R2.
x0803e47c: stat recalc- function used the recalculate a pokemon's stats to accommodate changed EVs or base stats.
 
55
Posts
10
Years
  • Age 27
  • Seen Oct 18, 2014
It does seem like a really good idea. I never even thought about putting it as an in-bag item. Unfortunately, you're not having it available to the people.
 
48
Posts
9
Years
  • Age 24
  • Seen Mar 23, 2024
Oh, good, I am thinking how to make the pokemon image distortion, do you have any good ideas?
 

Gexeys

Location: Ilex Forest shrine
70
Posts
10
Years
  • Age 27
  • Seen Aug 16, 2015
This system will not be availible for the public, but i definitly want to get feedback (and of course also some publicity for my hack pokemon violet). If somebody has done any further research on the battle system (especially for the "display text callback at 0x03004FE0), it would be great, if you could post it here or pm me.
How are you expecting the public to help you on something you're not going to give to the public?
 

karatekid552

What happens if I push it?....
1,771
Posts
11
Years
I'm going to close this thread. I personally do not agree with keeping this to yourself seeing as you posted in R&D and not a personal hack thread. R&D is for PUBLIC development and research, not personal feedback. Make a hack with this in it and then you can request feedback.

Btw, sharing will make you far more respected. Trust me.

~karatekid552
 
Status
Not open for further replies.
Back
Top