PDA

View Full Version : Development: Animated Trainer Sprites in Ruby and Fire Red


Shiny Quagsire
November 9th, 2010, 07:28 AM
OK, so me and xGGxToiZ have decided to release our knowledge to the general public. This knowledge is the knowledge of trainer animations!

xGGxToiZ noticed the pointer I found to a blank animation while looking at the trainer's back animations (No, this is not the front animations!). Here's the origanal post:

I found some more animation data. It's huge though,

01 00 14 00
02 00 06 00
03 00 06 00
04 00 18 00
00 00 01 00
FF FF 00 00

01 00 14 00
02 00 06 00
03 00 06 00
04 00 18 00
00 00 01 00
FF FF 00 00

01 00 18 00
02 00 09 00
03 00 18 00
00 00 09 00
FF FF 00 00

01 00 18 00
02 00 09 00
03 00 18 00
00 00 09 00
FF FF 00 00

00 00 18 00
01 00 09 00
02 00 18 00
00 00 09 00
03 00 32 00
FF FF 00 00

00 00 18 00
01 00 09 00
02 00 18 00
00 00 09 00
03 00 32 00
FF FF 00 00

it's at offset 239EBB.There are 6 different trainers: the boy, the girl, trainer dude, old man, brendan, and may. plus, they're all the same!I played with the values, and it's correct. These are the animations for the trainer backsprites! Funny, there are pointers to 2347E8, which contains this:

00 00 00 00 FF FF 00 00

I fiddled with the first value, the frame, and changed it to 05, and check out the result!
http://i46.tinypic.com/bjecg9.png
Oh, and I was a boy at the time.

It was quite odd, because it also led to the trainer's sprite, and several other things we don't know.

So how do we do this? Simple! Let me quote xGGxTioZ:

Okay, each trainer sprite has their own pointer to E8 47 23 08. So I searched for that and voila!
Table starts at: 0x238E8C
Select: 250h Bytes. (148d * 4d)

This means, each trainer can have their own number of frames! Exciting, huh? And if we can expand it, who knows what are the possibilities!


So, like he said, each trainer gets it's own animation pointer. So go to the table, and multiply your trainer's sprite's number (Starting from 0) by 4, and add it to the table offset. Now repoint the following pointer to free space, and write out your animation data. Here's how it works:

Animation data is a sequence of 4 bytes, giving data on various information, and ends in FF FF 00 00.

The first byte is the frame number from 0 Up to as many frames as you want!
The second byte is unknown, but I'll look into the ASM coding to figure it out.
The third byte is the duration. 0x10 is about a half second.
The fourth byte is unknown
The format is two bytes for the frame, two bytes for the duration. The values are simple flipped half-words.

After you've typed up as many of these sequences you want, end it in FF FF 00 00. Here's one I used for Pokemon Chrome:


00 00 00 00
02 00 FE 00
02 00 30 00
01 00 0F 00
00 00 30 00
FF FF 00 00


I'm not sure why I used the 0's, but it works. This is a good example of going in any order. I went from my 3rd frame, to my second, to my first. The duration of 30 at the end delays when the pokemon are sent out.

diegoisawesome
November 10th, 2010, 06:43 AM
OK, so me and xGGxToiZ have decided to release our knowledge to the general public. This knowledge is the knowledge of trainer animations!

I'm not entirely sure about this... This seems to be for trainer backsprites, but all throughout the thread, you mention "trainer sprites"...
Is this for trainer front- or back-sprites?
EDIT: I see. In this thread, there's info on the frames for back sprites AND for front sprites.
Awesome!

Shiny Quagsire
November 10th, 2010, 06:50 AM
It's fro the front sprites. Each sprite has their own pointer in the table at 238E8C

diegoisawesome
November 10th, 2010, 06:54 AM
It's fro the front sprites. Each sprite has their own pointer in the table at 238E8C
Yeah, I saw. But there's also info for the back sprites, which is cool, too.

Shiny Quagsire
November 10th, 2010, 06:56 AM
Yeah, I saw. But there's also info for the back sprites, which is cool, too.

Yeah, that was how he found it. It was just actually a post from the pokemon animation thread.

diegoisawesome
November 10th, 2010, 07:02 AM
Yeah, that was how he found it. It was just actually a post from the pokemon animation thread.
Ahh, I see.
Both are still interesting discoveries, though.

altariaking
November 10th, 2010, 07:49 AM
Yay! I already had the offset for Ruby but it's good to see you've released it to everyone now :)

knizz
November 10th, 2010, 09:44 AM
Great find! (Why didn't you tell me about this earlier?!)

So... which animation is front and which is back?

Shiny Quagsire
November 10th, 2010, 03:05 PM
Great find! (Why didn't you tell me about this earlier?!)

So... which animation is front and which is back?
I couldn't tell you because I promised xGGxTioZ to keep it a secret. In fact, he posted this video in the pokemon animations thread. (Which he actually made, but he never told anyone that)

Avn538l96qA

The back animations are at 239EBB, and the front onse are in a table of pointers to each trainer's animation at 238E8C

alypkm
September 24th, 2012, 03:20 PM
please How can I animate the pokemon too in fire red ? and where do I put this code ?

Shiny Quagsire
September 24th, 2012, 05:27 PM
please How can I animate the pokemon too in fire red ? and where do I put this code ?

If you scrolled down in R&D you'd find it (http://www.pokecommunity.com/showthread.php?t=223078). ;)

alypkm
September 29th, 2012, 11:38 AM
If you scrolled down in R&D . ;)

I'm using the HEX editor in NSE..I searched the Sprite table and entered this code then the game freeze once I start a wild battle even after I added 2 sprites for the pokemon.

how do I repoint it to another offset ?

SneakyEpicface11
January 10th, 2013, 05:50 PM
Hmm.... seems complicated... that is why I do not do rom hacking xD.

robin22gongon
April 12th, 2013, 03:14 PM
What's the Final Code? I'm using FR and I need 3 frames each for some trainers. I can apply this to whoever I just want animated right?

Shiny Quagsire
April 12th, 2013, 10:24 PM
What's the Final Code? I'm using FR and I need 3 frames each for some trainers. I can apply this to whoever I just want animated right?

Um, code? I guess the closest thing we have to code is ASM, but ff you mean hex it's at the bottom of the post.

hackstar
April 30th, 2013, 10:37 PM
Is animated trainer sprite is working?

BugMania
June 26th, 2013, 09:00 AM
at least in the pokemon party can put a loop.

BugMania
October 24th, 2013, 02:28 PM
Instead of using the HEX code, podemon well use a space in memory of the ROM.

example:

Go to the 0x82349BC.
You'll notice that the code uses an offset to 0x823499C, ie 9C 49 23 08.

To have an offset memory, we replace XX XX XX 08 to XX XX XX 02

In the end, find a space memory FREE, and inserted a routine battle system that changes the bytes FF FF 00 00 to FE FF 00 00.

I'm sorry that I did not bring the solution ready.


And of course, my bad English.

BLAxTOISE
December 3rd, 2014, 11:56 AM
Sorry for reviving this post but since I got working the animated sprites for Pokemon, I wanted to get some trainers animated too. The only problem I find came when I have to add the frames. I've been trying all evening diferent ways to do it without getting anything correct... So I summon you Shiny Quagsire... How did you do to add the frames?

Shiny Quagsire
December 3rd, 2014, 01:58 PM
So I summon you Shiny Quagsire...
http://33.media.tumblr.com/d0133b3c5af917f0160573878a4b521c/tumblr_mkr2lvsjDd1rlj1yeo1_400.gif

How did you do to add the frames?
Basically you just format your different frames vertically like you would do for Pokemon for the trainer image you want to animate, and then find that sprite's index in the animation table and create an animation for it.

BLAxTOISE
December 3rd, 2014, 04:10 PM
Basically you just format your different frames vertically like you would do for Pokemon for the trainer image you want to animate, and then find that sprite's index in the animation table and create an animation for it.

Thank you so much man, I've done it succesfuly :D

Tomorrow or so I'll post here a short tutorial of how I did it step by step, and also I'll complete the information about the frames parameters since they work the same way animated Pokemon Sprites do. It's better to have all the info on the same place xD

AtecainCorp.
December 6th, 2014, 09:57 AM
One important thing. Where is the Trainer Sprite Showing limiter in Ruby and Fire Red? It can make some issues after adding animations sice Limiter disable to show extra sprites <I have that problem in Ruby Rom>