Advertiser Content

Development Animated Sprites in Ruby and FireRed Page 5

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

BugMania

The Bug Master

Male
Seen November 4th, 2016
Posted July 30th, 2014
32 posts
6.4 Years
To facilitate...
http://www.mediafire.com/download/qou5ljny92hxegj/Pokemon+-+Fire+Red.rar
Even the smallest of beings can achieve the greatest of obstacles!
Click in the spoiler, if you dare!
Spoiler:


L
et's dream bigger than our bodies can endure!
G
et to the extreme!

See my works here

Smeargle

Illusory

Non-binary
In the fabric of life
Seen October 21st, 2015
Posted December 26th, 2014
160 posts
7 Years
This is wondeful :D, I've been spending the last week trying to duplicate it.
I came very close, but thank you very much for this. You really are going to help enhance a lot of pokemon roms.
I see what went wrong now, I was very close.

I will work on ruby and emerald variations as well as pre-made ones, full credit given to you for the code of course.

BugMania

The Bug Master

Male
Seen November 4th, 2016
Posted July 30th, 2014
32 posts
6.4 Years
Ok. But someone found adreses for Pokemon Ruby about Behaviour Data?
Well... There would be no problem doing this with RUBY too.
But so can only possible with the offsets of messages. ... so we must find such offsets and play the routines inside it.
Even the smallest of beings can achieve the greatest of obstacles!
Click in the spoiler, if you dare!
Spoiler:


L
et's dream bigger than our bodies can endure!
G
et to the extreme!

See my works here

Windsong

—the dream is dead

Age 27
Male
Germany
Seen August 22nd, 2014
Posted July 28th, 2014
30 posts
11.9 Years
Hey, do you think we could do this for trainer sprites in battle as well?
According to this thread, someone already achieved that four years ago.

http://www.youtube.com/watch?v=Avn538l96qA
あなたがいつか消えて行くの?
working on something

Shiny Quagsire

I'm Still Alive, Elsewhere

Age 21
Male
Hoenn Safari Zone
Seen 2 Days Ago
Posted April 17th, 2017
700 posts
10.5 Years
Hey, do you think we could do this for trainer sprites in battle as well?
According to this thread, someone already achieved that four years ago.

http://www.youtube.com/watch?v=Avn538l96qA
Yes, that would be me and another hacker which did it. I actually made a thread on it which is only one page down in the R&D subforum. Same process as this one, but with the trainers you can animate specific sprites to your will.

FBI

Free supporter

Male
Unknown Island
Seen 52 Minutes Ago
Posted 4 Weeks Ago
1,906 posts
6.8 Years
First of all, it's great that this method exists for two framed sprites. Second of all, no matter how I look at this, I am left thinking that using the object callback to animate the sprite is far superior than this method. While this works for a mere 2 frames animation, when it comes to something more interesting like a looped animation, using an object callback would be excellent as it'd execute independently from the battle engine. At the same time allow for more interesting animations including positional movement/pal change and rotscale modifications as seen here:

https://www.youtube.com/watch?v=LUS5xmJpW_s&ab_channel=astridjoeroeja

Note Pikachu turns yellow for a second. So for an initial animation, use this method, for a looped animation or animation with cool effects using the object callback seems more logical to me.
...
Seen 3 Weeks Ago
Posted June 27th, 2019
3 posts
4 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. :\
I was wondering if it is possible to increase the frame to the front of the sprite Pokemon, it would not be possible to develop something like this to increase the back sprites?

thedarkdragon11

New World Pirate

Male
Raftel, New World
Seen 1 Hour Ago
Posted 21 Hours Ago
874 posts
10.5 Years
Is it possible to do it with selected Pokémons only? Say for instance, I will do it to all except Castform...

Shiny Quagsire

I'm Still Alive, Elsewhere

Age 21
Male
Hoenn Safari Zone
Seen 2 Days Ago
Posted April 17th, 2017
700 posts
10.5 Years
Is it possible to do it with selected Pokémons only? Say for instance, I will do it to all except Castform...
I've done this once, it requires modifying the routine which assigns the animation to the Pokemon sprite to load them from a table, like trainer animations do. Don't think I have the source to that anywhere though...

thedarkdragon11

New World Pirate

Male
Raftel, New World
Seen 1 Hour Ago
Posted 21 Hours Ago
874 posts
10.5 Years
I've done this once, it requires modifying the routine which assigns the animation to the Pokemon sprite to load them from a table, like trainer animations do. Don't think I have the source to that anywhere though...
Thanks! I'm glad that it's possible... {:3}

Lunos

Random Uruguayan User

Male
Montevideo (Uruguay)
Seen 56 Minutes Ago
Posted 1 Day Ago
2,086 posts
11.1 Years
I gave this patch a try but I don't really know how to implement the 2nd Frame of a Pokemon.
I thought that maybe a 256x128 sheet could work for some reason, but it doesn't.
Is it even possible to make Advanced Series recognize that the Pokémon can have a 2nd Frame even though it's FireRed?
Male
Seen 3 Days Ago
Posted July 6th, 2019
208 posts
2.8 Years
In theory, it can be done. It's just a matter of whether anyone even wants to do it.
I want to do it!

BluRose

blu rass

Age 18
Male
rip x
Seen 5 Hours Ago
Posted 4 Weeks Ago
765 posts
5.6 Years
I gave this patch a try but I don't really know how to implement the 2nd Frame of a Pokemon.
I thought that maybe a 256x128 sheet could work for some reason, but it doesn't.
Is it even possible to make Advanced Series recognize that the Pokémon can have a 2nd Frame even though it's FireRed?
his hack uses 3 frames but is easily editable as well, the subsequent frames are to be implemented exactly as you thought but manually replacing the image in like unLZ.gba or something, so you'll have two images: front sprite normal, and then back sprite shiny,
and it should be like 64x196
I want to do it!
i mean, go for it ahaha
am i cool yet

Petuuuhhh

Male
Georgia
Seen 1 Hour Ago
Posted 2 Weeks Ago
622 posts
2.6 Years
I found one of the offset's for Emerald's animations: 0x308CBC

This is a table that seems to control how long each frame lasts. Each Pokemon has two pointers, meaning that starting at 0x308CBC, the first two pointers (the first 8 bytes) is Missingno, then the 3rd and 4th pointer is Bulbasaur, the 5th and 6th pointer is Ivysaur, the 7th and 8th pointer is Venusaur, etc.

Messing around with Bulbasaur's second pointer (0x308CC8), I managed to make it's second frame do this:


Unfortunately the table I found only seems to control how long each frame lasts and some other stuff I don't know. I don't think it controls the movement of the sprite, because no matter what I do to Bulbasaur's pointers, he still moves around on the same (meaning the sprite jumps around)


EDIT: There's another table at 0x309AAC that's definitely related to the animations, but at this table it's only 1 pointer per Pokemon, unlike the table at 0x308CBC.
Adding on to this; 0x30A18C is the pointer to Missingno's animation, followed by
00 08 00 00
After this is the pointer to Bulbasaur's animation, followed by
00 08 01 00
So the 00 08 XX 00 is some kind of numbering system, and there's some sort of table there.

Petuuuhhh

Male
Georgia
Seen 1 Hour Ago
Posted 2 Weeks Ago
622 posts
2.6 Years
Spoiler:

It is a very simple routine:
(This is to run the animation).

.text
.align 2
.thumb
main:
push {r5, r4, r0}
LDR r5, var2
LDRH r5, [r5]
LDR R6, anim
strh r5, [r6]
LDR R0, go !Continue the Battle
pop {r5, r4, r0}
BX R0

.align 2
anim: .word 0x2FF7D18
var: .word 0x020370c0
var2: .word 0x020370c2
go: .word 0x080XXXXX






This 0x80xxxxx is for a byte that you would continue. Example: 0x80D737D (In table SetwildbattleMessages).

(This is to no run the animation).
.text
.align 2
.thumb
main:
push {r5, r4, r0}
LDR r5, var
LDRH r5, [r5]
LDR R6, anim
strh r5, [r6]
LDR R0, go !Continue the Battle
pop {r5, r4, r0}
BX R0

.align 2
anim: .word 0x2FF7D18
var: .word 0x020370c0
var2: .word 0x020370c2
go: .word 0x080XXXXX
How does this differ from the way Emerald runs animations?

BluRose

blu rass

Age 18
Male
rip x
Seen 5 Hours Ago
Posted 4 Weeks Ago
765 posts
5.6 Years
How does this differ from the way Emerald runs animations?
don't know if you found the answer to this question, but his implementation runs the animation continually as opposed to solely once when loading the sprite
am i cool yet

Momoro

Creator of | Pokemon IRON Version | And also maybe a Coding Guru

Male
Castelia City, Unova
Seen 3 Weeks Ago
Posted 4 Weeks Ago
18 posts
85 Days
Well could SOMEONE PLEASE TELL ME HOW TO ANIMATE *TRAINER* SPRITES? I wanted to animate some trainers doing cool movements :D
Nocturnal...? W-What does that mean?😕
Advertiser Content