• 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: Animated Sprites in Ruby and FireRed

altariaking

Needs NO VMs...
1,087
Posts
14
Years
We all know that from Emerald the Pokemon were animated. However, what if this was possible in Ruby and FireRed?
Well, it is.
The offset 1E7C64 in Ruby (2349BC in FireRed) is the pointer to the data that tells us how the sprites behave when they appear. So, first of all, simply repoint it to another offset. Simply take your desired offset (I'll be using 0xB00000) and split it into segments.
Code:
B0 00 00
Then, swap the first two digits (B0) with the last two (00), and then add 08 to the end. So now we have this:
Code:
00 00 B0 08
Now, we must go to the offset it was repointed to, and then we need the animation data.
The first byte is the frame number.
The second byte does nothing.
The third byte is how long the image is displayed.
The fourth byte, again, does nothing.
To end the animation you must add
Code:
FF FF 00 00
So, here is an example of it all in action:
Code:
00 00 0F 00
01 00 0F 00
00 00 0F 00
01 00 0F 00
00 00 0F 00
FF FF 00 00
Of course you can make this code longer if you want, and even add more frames.
Now, all sprites will have a second frame, so now just insert the two frames for every sprite. A good, efficient way to do this is to insert a blank 128x64 image over every Pokemon in Unl-Z GBA, and then use Advanced Sprite Editor to insert all of the individual frames. You must do this for EVERY Pokemon and their Backsprite, otherwise there are a lot of bugs. Like turning into the Hero.

There are, however, a few bugs with using this. For instance, as I stated previously, if you don't insert two frames for a Pokemon, it will turn into the player's backsprite. When you exit the bag, or Pokemon menu during a battle, the Pokemon's sprite will move again. Also, if you make the animation data short, then you might not see it during wild battles, and if you make it too long then it will take a while before it does its thing in Trainer battles and the stats screen and such. I think that's it. :\
 
Last edited:

Darthatron

巨大なトロール。
1,152
Posts
18
Years
Very nice. Thanks for the info. :) I'll be looking into FireRed offsets now. ;)

EDIT: I just tried this, and nothing happened. :\
 
Last edited:

Flandre Scarlet

Free your mind.
356
Posts
16
Years
Very nice. Thanks for the info. :) I'll be looking into FireRed offsets now. ;)

EDIT: I just tried this, and nothing happened. :\

One for Fire Red will be awesome. xD I hope this works.

Well sorry for double posting, but I just found the offsets for FireRed, so now we can have animations in FireRed too! :D

Go to 2349BC in your ROM using a Hex editor, and repoint the offset there. I used B00000 (00 00 B0 08).

Then use Altariaking's code.

Code:
00 00 0F 00
01 00 0F 00
00 00 0F 00
01 00 0F 00
00 00 0F 00
FF FF 00 00

Then you have to save it, and add the animations to EVERY Pokemon or it will be buggy.

If you use this, please give credits to:
  • Flandre Scarlet (me)
  • Altariaking
  • Shiny Quagsire
  • Crazybuizel
 
Last edited:

Orinjmate

The Orinj of the Mate
120
Posts
13
Years
This sounds rly good! But I probably won't use it because it will take aaagggeeesss to put in a second frame for every pokemon.
 

xGGxToiZ

>.//:SO HOT:\\.<
44
Posts
14
Years
Alright, finally! I've been pondering about this all week and now it's true!
That's amazing!

But, I have "bug" if you may want to call it reports:
1. When in battle, when you go to your Pokémon Menu and then do anything that leads you back to the battle screen, the battling Pokémon will move again! (Weird stuff !:))

2. When you encounter a wild Pokémon, it does it's animations long before it gets to its rightful position (You know the big circle?) thus making it look like it doesn't for some Pokémon. (How do you add delay?)

Oddities:
1. All of the Pokémon move even the (?)'s when viewed (Not in the description page.) in the PokéDex. (Ruby)

Oh, and one more thing, the 0F byte in 01/00 00 0F 00 not only controls its duration of being displayed but also when turned into a value like let's say, FF, it will flip the Pokémon in the status screen accordingly! (Used Ruby for this "behavior stuff")

It's not yet perfect yet but it totally works!
I hope that we could get it to move (Animations) at the proper moment. :)

P.S. How do you make the trainer sprites move? :p
 
Last edited:
2
Posts
13
Years
  • Seen Jul 4, 2010
hello a question could put pictures and do not understand the point of re-displacement, and that point what I understand, I'm very interested to learn ^ ^
 

Full Metal

C(++) Developer.
810
Posts
16
Years
Alright, finally! I've been pondering about this all week and now it's true!
That's amazing!

But, I have "bug" if you may want to call it reports:
1. When in battle, when you go to your Pokémon Menu and then do anything that leads you back to the battle screen, the battling Pokémon will move again! (Weird stuff !:))

2. When you encounter a wild Pokémon, it does it's animations long before it gets to its rightful position (You know the big circle?) thus making it look like it doesn't for some Pokémon. (How do you add delay?)

Oddities:
1. All of the Pokémon move even the (?)'s when viewed (Not in the description page.) in the PokéDex. (Ruby)

Oh, and one more thing, the 0F byte in 01/00 00 0F 00 not only controls its duration of being displayed but also when turned into a value like let's say, FF, it will flip the Pokémon in the status screen accordingly! (Used Ruby for this "behavior stuff")

It's not yet perfect yet but it totally works!
I hope that we could get it to move (Animations) at the proper moment. :)

P.S. How do you make the trainer sprites move? :p

for the bugs (1 and 2) i think that would be because we have edited the routine that loads the images, not the routine that executes during battle.
basically, instead of
Code:
readybattle(&battleinfo);
get_battle_pokemon(&battleinfo,&spriteinfo);
load_battle_pokemon_sprite_pointer(&spriteinfo);
load_battle_pokemon_sprite(&spriteinfo);
get_battle_pokemon(&battleinfo,&spriteinfo1);
load_battle_pokemon_sprite_pointer(&spriteinfo1);
load_battle_pokemon_sprite(&spriteinfo1);
initiate_battle(&battleinfo,&spriteinfo1,&spriteinfo);
it might look more like this:
Code:
void load_sprite(battleinfo* battleinfo,spriteinfo* spriteinfo,spriteinfo* spriteinfo1)
{
 get_battle_pokemon(&battleinfo,&spriteinfo);
 load_battle_pokemon_sprite_pointer(&spriteinfo);
 load_battle_pokemon_sprite(&spriteinfo);
 get_battle_pokemon(&battleinfo,&spriteinfo1);
 load_battle_pokemon_sprite_pointer(&spriteinfo1);
 load_battle_pokemon_sprite(&spriteinfo1);
}
wild_encounter()
{
 readybattle(&battleinfo);
 load_sprite();
 update_battle_screen();
 initiate_battle(&battleinfo,&spriteinfo1,&spriteinfo);
}
and "update_battle_screen()" would occur every time you reload the screen from something (like the bag, or the pokemon party menu, etc).
but, this is just a thoery (and no, more than likely, that will *never* compile in any language xD)
 

altariaking

Needs NO VMs...
1,087
Posts
14
Years
Alright, finally! I've been pondering about this all week and now it's true!
That's amazing!

But, I have "bug" if you may want to call it reports:
1. When in battle, when you go to your Pokémon Menu and then do anything that leads you back to the battle screen, the battling Pokémon will move again! (Weird stuff !:))

like full metal said, it changes the loading of the sprites and not the battle start.
2. When you encounter a wild Pokémon, it does it's animations long before it gets to its rightful position (You know the big circle?) thus making it look like it doesn't for some Pokémon. (How do you add delay?)
just add a ew more of 00 00 0F 00 and that will show only the first frame for as long as you want[/quote]
Oddities:
1. All of the Pokémon move even the (?)'s when viewed (Not in the description page.) in the PokéDex. (Ruby)

Oh, and one more thing, the 0F byte in 01/00 00 0F 00 not only controls its duration of being displayed but also when turned into a value like let's say, FF, it will flip the Pokémon in the status screen accordingly! (Used Ruby for this "behavior stuff")

It's not yet perfect yet but it totally works!
I hope that we could get it to move (Animations) at the proper moment. :)

P.S. How do you make the trainer sprites move? :p

to ake the trainer move I think it would already work with this code, as long as you add a second frame
 

Shiny Quagsire

I'm Still Alive, Elsewhere
697
Posts
14
Years
Wow, never expected this to happen! :P
Anyways, glad this came into the R&D! :)

Wow, never expected this to happen! :P
Anyways, glad this came into the R&D! :)


Stupid browser sent it twice...
 
Last edited:

Shiny Quagsire

I'm Still Alive, Elsewhere
697
Posts
14
Years
Oh, quick reminder. you could also loop an animation by putting this instead:

Code:
EF FF 00 00

With that, it will continuously loop forever and ever, and ever, and so on.

Also, I always get a black screen when I do this. I repointed the first pointer to B00000, like you said. I go outside of a building, it's all black. Go into battle, it freezes. :\
Fixed it! ;)

*edit*
I think I found the offset for some other animation! It's at 3cc290. I'm not sure what it is though, but it could be a trainer's animation.
 
Last edited:

xGGxToiZ

>.//:SO HOT:\\.<
44
Posts
14
Years
Oh, quick reminder. you could also loop an animation by putting this instead:

Code:
EF FF 00 00
With that, it will continuously loop forever and ever, and ever, and so on.

Also, I always get a black screen when I do this. I repointed the first pointer to B00000, like you said. I go outside of a building, it's all black. Go into battle, it freezes. :\
Fixed it! ;)

*edit*
I think I found the offset for some other animation! It's at 3cc290. I'm not sure what it is though, but it could be a trainer's animation.

3cc290 is for FR, right? Well, I replaced the bytes found there with this:
00 00 A0 08. Then @ A00000 I used altariaking's code. Then added 2 extra frames to my trainer sprite.

[bummer]I tested it in-game but nothing happened, I checked the tile viewer in real time and I saw no extra frame in it at all.[/bummer]

But I know it's located somewhere in there . .

P.S. I also tried to change the bytes after 3cc294 and nothing happened.
 

Flandre Scarlet

Free your mind.
356
Posts
16
Years
Oh, quick reminder. you could also loop an animation by putting this instead:

Code:
EF FF 00 00

With that, it will continuously loop forever and ever, and ever, and so on.

Also, I always get a black screen when I do this. I repointed the first pointer to B00000, like you said. I go outside of a building, it's all black. Go into battle, it freezes. :\
Fixed it! ;)

*edit*
I think I found the offset for some other animation! It's at 3cc290. I'm not sure what it is though, but it could be a trainer's animation.

Yeah same, I was hoping it was the trainers animation. Guess it wasn't. :S

Also I can't seem to be able to loop the animation with EF FF 00 00. It freezes as soon as it should loop.
 

Shiny Quagsire

I'm Still Alive, Elsewhere
697
Posts
14
Years
Wait, I forgot to mention he said not to do it with pokemon, and he did it with "Ivan's" backsprite. I've played his game, and the player's backsprite is moving. Maybe the place I found is the backsprite, or some other animation.
 

Corvus of the Black Night

Wild Duck Pokémon
3,416
Posts
15
Years
Make sure you repoint the animation if it's larger han the original (which it probably will be). Also, I'm way too lazy and unmotivated to find the pointer for FR, so mine only works for Ruby. I was able to edit both the Pokemon sprites (whose back and front animations are connected and thus the same) and also the backsprite. Actually all three character backsprites use different animations but I just set them all the same because it was easier, lol

By the way, I was using a different Edian than is used with Hex Editors (I was using a tile viewer after all), so try switching the values around a bit.

If this helps, you should be able to find it near the sprite tables.

By the way, this is Crazybuizel, if you didn't know already >_>
 
Last edited:
Back
Top