Advertiser Content

Development Animated Sprites in Ruby and FireRed

Started by altariaking June 20th, 2010 10:19 AM
  • 47668 views
  • 124 replies

altariaking

Needs NO VMs...

Age 45
Male
Scotland, Lesmahagow
Seen August 3rd, 2015
Posted February 7th, 2011
1,096 posts
10 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.
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:
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
FF FF 00 00
So, here is an example of it all in action:
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. :\

altariaking

Needs NO VMs...

Age 45
Male
Scotland, Lesmahagow
Seen August 3rd, 2015
Posted February 7th, 2011
1,096 posts
10 Years
Very nice. Thanks for the info. :) I'll be looking into FireRed offsets now. ;)

EDIT: I just tried this, and nothing happened. :\
I realised the example I posted was too short, so I edited the example and it should work now :D

Flandre Scarlet

Free your mind.

Age 23
Male
Australia
Seen June 6th, 2019
Posted November 18th, 2017
356 posts
11.8 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.

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
Male
Seen October 26th, 2019
Posted August 19th, 2018
1,312 posts
12.6 Years
For anyone who's interested, I've made secondary frames of FR/LG sprites:
http://www.pokecommunity.com/showthread.php?t=222966

Even though I've only uploaded up to Parasect, I have up to Slowbro complete. Here's a video of an animated FR/LG Slowbro:
http://img688.imageshack.us/img688/7651/slowbrolol.mp4

Sole developer of STARLIGHT LEGACY intended to be released on Steam.
Discord: https://discord.gg/fTS5Q78

xGGxToiZ

>.//:SO HOT:\\.<

Age 23
Male
We're now near the Tin Tower! . xD
Seen November 10th, 2010
Posted July 10th, 2010
44 posts
9.7 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


JOHTO ELITE FOUR


. . .

Full Metal

C(++) Developer.

Age 24
Male
In my mind.
Seen August 19th, 2018
Posted May 27th, 2017
806 posts
11.9 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
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:
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)

★ full metal.

I like to push it,
and push it,
until my luck is over.

altariaking

Needs NO VMs...

Age 45
Male
Scotland, Lesmahagow
Seen August 3rd, 2015
Posted February 7th, 2011
1,096 posts
10 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

Age 21
Male
Hoenn Safari Zone
Seen 3 Weeks Ago
Posted April 17th, 2017
700 posts
10.6 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...

Shiny Quagsire

I'm Still Alive, Elsewhere

Age 21
Male
Hoenn Safari Zone
Seen 3 Weeks Ago
Posted April 17th, 2017
700 posts
10.6 Years
Oh, quick reminder. you could also loop an animation by putting this instead:

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.

xGGxToiZ

>.//:SO HOT:\\.<

Age 23
Male
We're now near the Tin Tower! . xD
Seen November 10th, 2010
Posted July 10th, 2010
44 posts
9.7 Years
Oh, quick reminder. you could also loop an animation by putting this instead:

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.


JOHTO ELITE FOUR


. . .

Shiny Quagsire

I'm Still Alive, Elsewhere

Age 21
Male
Hoenn Safari Zone
Seen 3 Weeks Ago
Posted April 17th, 2017
700 posts
10.6 Years
Maybe it goes to something else :\ I never did say it was for trainers.

Flandre Scarlet

Free your mind.

Age 23
Male
Australia
Seen June 6th, 2019
Posted November 18th, 2017
356 posts
11.8 Years
Oh, quick reminder. you could also loop an animation by putting this instead:

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

Age 21
Male
Hoenn Safari Zone
Seen 3 Weeks Ago
Posted April 17th, 2017
700 posts
10.6 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

Age 26
Non-binary
With the Birds
Seen January 9th, 2015
Posted January 9th, 2015
3,417 posts
10.8 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 >_>

Shiny Quagsire

I'm Still Alive, Elsewhere

Age 21
Male
Hoenn Safari Zone
Seen 3 Weeks Ago
Posted April 17th, 2017
700 posts
10.6 Years
Yeah, I knew that. I'll try to find it, but fire red's backsprites are uncompressed, so it will most likely not be around the sprite tables.

*offtopic* I love your hack. It's awesome :)

altariaking

Needs NO VMs...

Age 45
Male
Scotland, Lesmahagow
Seen August 3rd, 2015
Posted February 7th, 2011
1,096 posts
10 Years
Wow now someone can make all of them animated and then upload their ips patch for all of us! Yay
why? it's not that hard, why don't you do it yourself instead of relying on other people to do it for you?

Shiny Quagsire

I'm Still Alive, Elsewhere

Age 21
Male
Hoenn Safari Zone
Seen 3 Weeks Ago
Posted April 17th, 2017
700 posts
10.6 Years


why? it's not that hard, why don't you do it yourself instead of relying on other people to do it for you?
I agree. If they had a patch, everyone would have animated sprites, and it would be too common of a feature. It's easy enough to do as is.

xGGxToiZ

>.//:SO HOT:\\.<

Age 23
Male
We're now near the Tin Tower! . xD
Seen November 10th, 2010
Posted July 10th, 2010
44 posts
9.7 Years
Oh, right. I see now.

Well, I have some time in my hands so I could look for them.

And a patch for animations? If that were to happen, then all hacks that wish to have those animations in there hack will have the same animations. shiny quagsire's right, it'll make animations not so unique anymore. You could edit it but hey why bother? We can make it ourselves err.. right? :\

Oh and altariaking, thanks for the delay tip! :)


JOHTO ELITE FOUR


. . .

Advertiser Content