Go Back   The PokéCommunity Forums > ROM Hacking > Research & Development

Notices
For all updates, view the main page.

Research & Development Got a well-founded knack with ROM hacking? Love reverse-engineering the Pokémon games? Or perhaps you love your assembly language. This is the spot for polling and gathering your ideas, and then implementing them! Share your hypothesis, get ideas from others, and collaborate to create!
Research & Development programs in this forum are subject to moderator approval before they are displayed.



Reply
 
Thread Tools
  #1    
Old April 18th, 2014 (11:57 AM). Edited April 21st, 2014 by Shiny Quagsire.
Shiny Quagsire's Avatar
Shiny Quagsire
I like .short's because they're comfy and easy to wear.
 
Join Date: May 2009
Location: Hoenn Safari Zone
Age: 17
Gender: Male
Nature: Jolly
For the longest time hackers have wondered how those magical Emerald animations have worked. Well, it turns out it's a bit more complicated than we thought. There are three (or possibly more) tables used for Emerald's animations: One for changing between the two frames, one for rotation/scaling, and a third for deciding how to rotate and scale. More on that further down.

So the first table has been discovered a while back as a simple animation table, in the usual format for most animations. Nothing to special about it, other than it decides how the two frames are "flip-flopped" between each other. The next two, however, are an interesting pair of tables.

The first is the actual scaling/rotation animation table, located at 60AA88. Unlike most animations, it doesn't actually use a simple script-like byte interface; It instead uses ASM to do it's job. Now, obviously writing out code for each and every Pokemon's animation is a bit difficult, and takes up a large amount of space, so instead of doing an individual animation for each Pokemon, they reused them, and they have it narrowed down to about 150 different and unique animations. For most people this might be a bit of a dead end, but this does confirm that there is the possibility of changing animations.

Now obviously if we have a table with less animations than Pokemon we're going to have to have a sort of "index" deciding which animations go where. Luckily, there is such an index, located at 3299EC for front sprites and 60A8C8 for back sprites, both of which contains a single byte for every Pokemon, deciding which animation is used where, meaning that we can change different Pokemon's animations, provided that we know which one we want to use.

As of now that's all I've discovered. If anyone has anything they'd like to contribute feel free to help.
__________________



Reply With Quote
  #2    
Old April 20th, 2014 (09:16 AM). Edited April 21st, 2014 by Chaos Rush.
Chaos Rush's Avatar
Chaos Rush
im sexy and i know it
 
Join Date: May 2007
Location: Taylor Swift
Gender: Male
Nature: Adamant
Here's my code for a blank animation:
Code:
.text
.align 2
.thumb
.thumb_func
.global blankanimation

push {r4,lr}
ldr r0, .RETURN
str r0, [r4, #0x1C]
pop {r4}
pop {r0}
bx r0

.align
.RETURN: .word 0x08180715
The lines "ldr r0, .RETURN" and "str r0, [r4, #0x1C]" are in there because the game freezes in-battle after the animation is "done" if you don't have that in there. This animation code however, makes it move slightly in the Summary screen (but not in-battle). It appears that for some reason they behave differently. That can be fixed just by changing the bytes at 0x06EE38 to 00 00 and the byte at 0x06ECC4 to 01.

Also I've been looking for the back sprite animation table to no avail, but I'm 90% sure that either it's in a different format from the front sprite animation table, or it uses another set of animations entirely. I've concluded this because I'm 99% sure Lugia's back sprite animation number would be 0x96 (turn blue and slowly wave side to side), and I've searched "96 __ __ 00 00 00 00 00 00 ..." in a hex editor (the two blank spots are for Ho-oh and Celebi. GoldFinger lets you search strings with missing bytes), and seeing as how the front sprite animation table just has 00 for the Unown placeholders, I figured the back would too, but apparently not... I found the back sprite table, scroll to the bottom of this post.

EDIT: Scratch that, I'm pretty sure now that the backsprites do use the same set of animations, since I put a breakpoint on the scaling/rotation table pointer right before sending out a Pokémon and the breakpoint was indeed reached.

Also I'm going to try and make a list of all animations with descriptions of what they do.

EDIT: Here we go:
Animation Index:
00 - tiny bounce (used by Egg)
01 - small grow,expand,grow,expand
02 - shake side-to-side really fast
03 - shake side-to-side normal speed
04 - shake up-and-down normal speed
05 - bounce and rotate left and right fast
06 - hop up and down, hop left and right (used by Bulbasaur)
07 - rotate left and right kinda slow
08 - rotate left and right pretty fast twice
09 - shrink a tiny bit, grow a tiny bit, kinda fast (similar to Growl)
0A - move around kinda diagonally
0B - rotate left and right but not that much, slowly
0C - rotate left and right but not that much, fast
0D - rotate from top left and right but not that much, slowly
0E - rotate from top left and right but not that much, fast
0F - shake left and right really fast, not as much as 02
10 - shake up and down really fast
11 - shake in circles really fast
12 - twist around a bit
13 - grow, shrink, kinda like a bounce (more than 00)
14 - circle around really fast then freeze for a split second
15 - glow a solid black color
16 - stretch on horizontal axis kinda fast (like a growl)
17 - stretch on vertical axis kinda fast (like a growl)
18 - wiggle and rotate up and down
19 - shake up and down twice
1A - rotate a little and move to the left a little
1B - rotate down, rotate up (I think it's used by Deoxys)
1C - rotate down and up in a zigzag motion
1D - rotate left and right in a zigzag motion
1E - hop up and down a little
1F - 360 degree spin (used by Spheal)
20 - fade to a yellow
21 - fade to a red
22 - fade to blue
23 - fade to orange-ish
24 - fade to purple
25 - move to left really fast
26 - move toward bottom left and then do a 360 degree spin (used by Pidgeot)
27 - sprite blinks several times (used by Kecleon?)
28 - move toward bottom left and then do a backflip
29 - move toward top right and then do a frontflip
2A - rotate around really fast in a triangle motion
2B - move like a wave left and right
2C - blink yellow several times
2D - tilt left and right fast
2E - tilt left and right fast from top axis
2F - rotate up, and then stomp back down (used by Venusaur)
30 - squish down and up (Grimer?)
31 - bounce left and right kinda fast
32 - bounce back and forth
33 - rotate left and right really fast
34 - rotate left and right really really fast
35 - sprite blinks several times really fast
36 - rotate almost sideways and then bounce to the left
37 - rotate left really fast a couple times
38 - rotate right and shake a little
39 - move in a square-ish motion really really really fast
3A - slowly grow bigger (used by Gengar)
3B - wiggle up and down while squishing
3C - wiggle up and down while squishing faster
3D - wiggle up but stay up then come back down while squishing
3E - wiggle side to side fast while squishing
3F - wiggle side to side even more while squishing
40 - wiggle really fast left to right while squishing
41 - grow freaking huge really fast a couple times (Heracross and Dodrio?)
42 - move in a small oval kinda fast
43 - move left and right while shaking
44 - move left and right and then bounce a little?
45 - tiny bounce like 00, except a lot slower
46 - move left to right really slow
47 - move up and down really slow
48 - jump and shake kinda fast
49 - jump and shake kinda slow
4A - jump and shake really slow
4B - move around in a zigzag motion kinda slow
4C - shake left and right kinda slow
4D - shake up and down kinda slow
4E - rotate left and right a couple times then do it all again
4F - move around in a circle-ish shape once
50 - shake up and down twice
51 - rotate in a zigzaggy way
52 - shake up and down a tiny bit
53 - 360 degree spin again
54 - move in a triangle motion twice (used by Magnemite)
55 - squish up and down twice
56 - bounce around twice
57 - shake up and down really fast
58 - shake up and down moderate speed
59 - shake left and right while moving a relatively long distance
5A - tense up a little bit vertically
5B - tense up a little bit horizontally
5C - shake fast up and down but not that much
5D - shake fast left and right but not that much
5E - shake fast left just once
5F - shake really fast left and right a couple times
60 - shake really really fast left and right a couple times
61 - shake really really fast up and down a couple times
62 - jump-ish motion twice
63 - jump-ish motion twice faster
64 - move around in a circle really fast
65 - grow bigger fast
66 - move to the right then left while shaking
67 - move to the right then left really fast while shaking
68 - move in a triangle motion slow
69 - move in a triangle motion really fast
6A - move in a triangle motion twice
6B - grow big then back to normal
6C - grow big then back to normal twice
6D - flutter left and right
6E - flutter left and right slowly
6F - flutter left and right really fast
70 - flutter left and right but more wiggly idk
71 - grow big fast then shrink fast twice
72 - shrink and grow a little twice
73 - get a little bigger like a growl
74 - stretch fast vertically twice
75 - stretch fast horizontally twice
76 - stretch horizontally once
77 - grow big twice in an erratic way
78 - shake/growl/grow at the same time
79 - move left and right in an arc motion
7A - move left and right in an arc motion fast
7B - move left and right in an arc motion really fast
7C - flutter in an arc motion twice
7D - flutter in an arc motion twice fast
7E - flutter in an arc motion twice really fast
7F - barely move in an arc motion
80 - barely move in an arc motion fast
81 - barely move in an arc motion really fast
82 - tilt downwards
83 - tilt downwards slow
84 - tilt downwards twice fast
85 - grow bigger twice in a shaky way
86 - grow bigger in a shaky way fast
87 - kinda growl/grow bigger shaky
88 - charge to the right
89 - charge to the right fast
8A - charge to the right really fast
8B - blink a yellow color several times
8C - blink a yellow color several times faster
8D - blink a yellow color several times faster i guess
8E - turn red then violently shake
8F - turn red then shake
90 - turn red then slide left and right
91 - turn green then violently shake
92 - turn green then shake
93 - turn green then slide left and right
94 - turn blue then violently shake
95 - turn blue then shake
96 - turn blue then slide left and right

Here's what I've found on back sprite animations:
Right after the main scaling/rotation table is another table, at 0860ACE4. This table is simply a list of animation slots that the back sprites may use. Unfortunately the table that determines which of these animations are apparently in a different format, but I can confirm that this back sprite animation list is indeed referred to thanks to VBA-SDL-H. With VBA-SDL-H, I was also able to determine that the back sprite animations for the first six Pokémon are:
Bulbasaur = 0x83 (slot 0x38 in the table at 0860ACE4)
Ivysaur = 0x46 (slot 0x05 in the table at 0860ACE4)
Venusaur = 0x5D (slot 0x15 in the table at 0860ACE4)
Charmander = 0x7F (slot 0x35 in the table at 0860ACE4)
Charmeleon = 0x88 (slot 0x3C in the table at 0860ACE4)
Charizard = 0x8E (slot 0x42 in the table at 0860ACE4)
The table for the back sprites is definitely in a different format than the animation index for the front sprites, because the string "38 05 15 35 3C 42" does not show up in the ROM (nor does what the table supposedly would be if I used their 'true' slots, which would be 83 46 5D ...).

To explain the table at 0860ACE4 a little, you'll see that the first byte at 0860ACE4 is 60. This means in the hypothetical back sprite animation table, 00 actually refers to animation 0x60. If you were to change this value, then all back sprites that used animation 0x60 will instead use whatever value you changed it to.

To help with testing, I'll just use Bulbasaur as an example. Bulbasaur's back sprite animation is 0x83. In the table that starts at 0860ACE4, skip ahead to 0860AD1C and you'll see byte 0x83. Change this value to another animation, and then all Pokémon that used 0x83 as the back sprite animation will now have a different back sprite animation to whatever you changed it to - not just Bulbasaur, thus confirming there has to be another table for this somewhere.

To prove this further, Charizard and Ho-oh both use the same back sprite animation: 0x8E. So find 0x8E in the table at 0860ACE4 (8E is located at 0860AD26) and change that byte to something else, which causes Charizard and Ho-oh, and all other Pokémon that use 0x8E as their back sprite animation, to use whatever animation you changed it for the back sprite.



EDIT: 4/21/14
Ok, so I found the index table that controls the back sprite animations. It's at 0860A8C8. Apparently there are only up to 0x1A animations available for backsprites. The indexes as I suspected are different from the front sprite animation table, but it doesn't work how I thought it would. It is still somehow related to the table at 0860ACE4 I mentioned earlier but now I'm not quite sure how. But who cares lol, the back sprite table has been found and can be freely changed!
__________________
Reply With Quote
  #3    
Old April 21st, 2014 (03:42 PM). Edited April 23rd, 2014 by Chaos Rush.
Chaos Rush's Avatar
Chaos Rush
im sexy and i know it
 
Join Date: May 2007
Location: Taylor Swift
Gender: Male
Nature: Adamant
(I think this warrants a second post)

HOW TO DISABLE EMERALD ANIMATIONS COMPLETELY:
1. First we're going to overwrite Animation #00 with a blank animation, but makes sure sprites work as normal in-battle. At 0x18080C, put in these bytes:
Code:
10 B5 02 48 E0 61 10 BC 01 BC 00 47 15 07 18 08
2. Now from 0x3299EC to 0x329B87, fill it with 00. This will make every Pokémon use animation number #00 as their front sprite animation.

3. Now at 0x308CC0, change the bytes there to 38 F5 2F 08.

4. Now starting at 0x309AAC and ending at 0x30A11B is a table. Change every pointer in that table to the bytes BC 8C 30 08. This will make every Pokémon only have one frame, just like in Ruby and FireRed.

5. At 0x06EE38, change the bytes to 00 00. This will disable the Pokémon's animation in the Summary screen. Even though we changed every Pokémon's animation to a blank one, this is still necessary because the blank animation code seems to function differently in the Summary screen, but as far as I know is the only way to have it work perfectly in-battle.

6. At 0x06ECC4, change the byte to 01. The reasoning for this is the same as above, except this is specifically to disable the Egg sprite's animation in the Summary screen. (It still works when hatching)

7. Starting at 0x60A8C8 to 0x60AA63, fill the bytes with 00. This will change all the Pokémon's back sprite animation to back animation #00.

8. As a failsafe, fill the bytes starting at 0x60ACE4 to 0x60AD2E with 00. This will ensure that Pokémon will always use the blank animation for back sprites.

There, that should do it. I might have missed something, as I wrote these steps after I modified my ROM. But either way if I missed something, I'll just upload a patch if anyone wants it.
__________________
Reply With Quote
  #4    
Old September 14th, 2014 (01:56 AM).
Artemis64
 
Join Date: Mar 2014
Gender: Male
Exactly where are the tables involved? It seems that there is a table for controlling how the frames alternate and the repetition. How is that data edited? Is it possible to expand the table? I understand how you feel on this, Chaos Rush, but one of the reasons I hack Emerald in the first place are the animations. Plus, some of the animation scripts might be usable in move animations (using the 03 command).
Reply With Quote
  #5    
Old October 7th, 2014 (10:32 AM).
TheDeepSpirit
 
Join Date: Jul 2014
Gender: Male
Hey Chaos Rush. Thanks for writing down how to disable the anims.

I did everything but if wild poke's appear, the game freezes, 0.1 sec. before the cry appears.

A patch isn't good because i have modded my rom already in over parts. For example every sprite.

Can you help me?
Reply With Quote
  #6    
Old November 29th, 2014 (10:41 PM).
Percy's Avatar
Percy
Known in the past as BlazikenXY
 
Join Date: Sep 2014
Location: Somewhere in the world, obviously
Age: 18
Gender: Male
Nature: Gentle
Quote originally posted by Chaos Rush:
(I think this warrants a second post)

HOW TO DISABLE EMERALD ANIMATIONS COMPLETELY:
1. First we're going to overwrite Animation #00 with a blank animation, but makes sure sprites work as normal in-battle. At 0x18080C, put in these bytes:
Code:
10 B5 02 48 E0 61 10 BC 01 BC 00 47 15 07 18 08
2. Now from 0x3299EC to 0x329B87, fill it with 00. This will make every Pokémon use animation number #00 as their front sprite animation.

3. Now at 0x308CC0, change the bytes there to 38 F5 2F 08.

4. Now starting at 0x309AAC and ending at 0x30A11B is a table. Change every pointer in that table to the bytes BC 8C 30 08. This will make every Pokémon only have one frame, just like in Ruby and FireRed.

5. At 0x06EE38, change the bytes to 00 00. This will disable the Pokémon's animation in the Summary screen. Even though we changed every Pokémon's animation to a blank one, this is still necessary because the blank animation code seems to function differently in the Summary screen, but as far as I know is the only way to have it work perfectly in-battle.

6. At 0x06ECC4, change the byte to 01. The reasoning for this is the same as above, except this is specifically to disable the Egg sprite's animation in the Summary screen. (It still works when hatching)

7. Starting at 0x60A8C8 to 0x60AA63, fill the bytes with 00. This will change all the Pokémon's back sprite animation to back animation #00.

8. As a failsafe, fill the bytes starting at 0x60ACE4 to 0x60AD2E with 00. This will ensure that Pokémon will always use the blank animation for back sprites.

There, that should do it. I might have missed something, as I wrote these steps after I modified my ROM. But either way if I missed something, I'll just upload a patch if anyone wants it.
Wow, I actually did this...
Good job!
__________________
Credits to Ilona-the-Sinister for my avatar.

Hey, folks! I don't know what to put here, so I better just advertise.
Can you give me a hand with my hack? Just PM me.

Oh, yeah, I don't need any mappers, now, 'cause I already have 2, and now I need Music Composer, and spriting. And, if you're friendly enough, VM me, and we can chat!
Reply With Quote
  #7    
Old 2 Weeks Ago (02:22 AM).
DRYZAS
 
Join Date: Jan 2015
Gender: Male
Chaos Rush i dont know if you ever see this, but if you see please upload a patch thanks
Reply With Quote
  #8    
Old 2 Weeks Ago (05:51 AM).
Percy's Avatar
Percy
Known in the past as BlazikenXY
 
Join Date: Sep 2014
Location: Somewhere in the world, obviously
Age: 18
Gender: Male
Nature: Gentle
Quote originally posted by DRYZAS:
Chaos Rush i dont know if you ever see this, but if you see please upload a patch thanks
He actually uploaded one.
Attached Files
File Type: ips EmeraldDisableAnimations.ips‎ (1.7 KB, 1 views) (Save to Dropbox)
__________________
Credits to Ilona-the-Sinister for my avatar.

Hey, folks! I don't know what to put here, so I better just advertise.
Can you give me a hand with my hack? Just PM me.

Oh, yeah, I don't need any mappers, now, 'cause I already have 2, and now I need Music Composer, and spriting. And, if you're friendly enough, VM me, and we can chat!
Reply With Quote
Reply
Quick Reply

Sponsored Links
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 02:57 PM.