• 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: Move Animations General

794
Posts
10
Years
I know move animations are already present in the move resource thread however I think they deserve their own.

I also made this thread, because I think it's the time we moved from animations as series of bytes to a scripting language. After all, that's how they were done. There are about 50(a bit less) commands in total and I'll go briefly about them. Note that I am not sure how some of them work.

Commands:
Spoiler:


Now some terms I've used while explaining commands not everyone may get.
Spoiler:


All offsets below are for Emerald.

A list of all move animation tasks that are used: (Soon to add descriptions on what they do)
Spoiler:

Similarly a list of all templates:
Spoiler:


Now, I'd like to give you the most important thing in this post that I believe could make animation scripting MUCH much easier. And that is all move animation scripts decompiled. Link
They were decompiled in Emerald, but they look the same in other games, the difference being offsets.
I also attached the file in case someone can't get pastebin to work.

How to write scripts using those commands?
There is no script editor that supports custom commands, but it doesn't mean we have to write our scripts in hex. We can use ASM for that. Here's an ASM file that contains all defines and command as macros. All you'd have to do is include it at the top of your ASM file.
Spoiler:

Also task offsets for your linker(BPEE.ld) file. If you don't use a linker, you need to change them to .equ format.

Spoiler:


With that in mind I think we could easily write scripts for all moves past gen3. Even without custom tasks.

If you have questions, wrote a script or researched a command/task/template please post it here.
 

Attachments

  • anim_scripts.txt
    349.9 KB · Views: 117
Last edited:

Blah

Free supporter
1,924
Posts
11
Years
For anyone wondering, you can find some additional documentation including FireRed addresses here:
https://www.pokecommunity.com/showthread.php?t=354621

For the list of tasks as well as templates which Dizzy has posted, they were made on a case by case basis for each move so there are no tables containing these functions. Additionally, if you made a new animation script, you would be forced into reusing the tasks which GameFreak had coded, or making your own task for the object's animation.

The current move animation system seems quite poor for making new move scripts as they use a setup overly complex to achieve something simpler. I think you can make more leverage with this if you reworked the task's object transformation operations into a scripting system as well.
 

MrDollSteak

Formerly known as 11bayerf1
858
Posts
15
Years
Crazy good stuff!

I made a move, I believe it was Flash Cannon use a custom loaded object template, or an edited one at least, to slightly change its size and/or trajectory I don't even remember. Maybe have a look at that in the moveanimations.s file Dizzy to see if theres an easier way to automate that process too.
 
794
Posts
10
Years
Crazy good stuff!

I made a move, I believe it was Flash Cannon use a custom loaded object template, or an edited one at least, to slightly change its size and/or trajectory I don't even remember. Maybe have a look at that in the moveanimations.s file Dizzy to see if theres an easier way to automate that process too.

What process you're talking about?
 

MrDollSteak

Formerly known as 11bayerf1
858
Posts
15
Years
What process you're talking about?

I think its how to program the movement / size of the particle. For example with Flash Cannon I believe what I did was take the object movement from another animation but changed one of the bytes to make it bigger and / or faster. Sorry for not being more specific I'll try and explain more soon.
 

Blah

Free supporter
1,924
Posts
11
Years
So what MrDollstead did was edit the object template to adjust the size, and then assign a different task. As you should know the Object Template is a template for the Object system to initialize an Object, and ofcourse that has an OAM field for you to scale the size. However, speed and direction are not controlled by the Object template, and rather the task.

I think you ought to make a central task for the animations and include time dependent positional delta vectors for movement and utilize GameFreak's animation scripting system for OAM animation (actually the system currently does make use of this) in addition to the rotscale scripting system (system does not make use of this).

Because the tasks themselves are doing the scaling and rotation, rather than through the script system. However, there is a good reason for this, and that reason is because there is no way to distinguish which instruction of the rotation/scaling script is currently running. So adjustments of vector positions and influencing movement based of the rotation is impossible normally.

There is a very easy solution, and that is to assign a task to assign rotation scripts one instruction at a time, while simultaneously adjusting position vectors. This is what I mean when I say make a new scripting system for animations. You want to combine both the animation script engine and the rotscale script engine GF has made in addition to the task system for positional updates. Ideally incorporating BGs as well. The result is an easy to use animation script system which abstracts all of the matrix and trigonometric calculations while maintaining nearly the same functionality (taking a minor speed hit of 1 frame per animation phase shift).

The downside is that it takes up a comparably larger amount of ROM space depending on the permutations of the rotscale scripts you plan to have and the length of the animation. You would need to somehow push the C2 callback, execute the script callback, pop C2 back and finish executing C2 (or you can make a very inefficient C2, but you would take a performance and potential FPS penalty).

I think most of this would become clear after I make another tutorial soon(TM).
 

MrDollSteak

Formerly known as 11bayerf1
858
Posts
15
Years
So what MrDollstead did was edit the object template to adjust the size, and then assign a different task. As you should know the Object Template is a template for the Object system to initialize an Object, and ofcourse that has an OAM field for you to scale the size. However, speed and direction are not controlled by the Object template, and rather the task.

I think you ought to make a central task for the animations and include time dependent positional delta vectors for movement and utilize GameFreak's animation scripting system for OAM animation (actually the system currently does make use of this) in addition to the rotscale scripting system (system does not make use of this).

Because the tasks themselves are doing the scaling and rotation, rather than through the script system. However, there is a good reason for this, and that reason is because there is no way to distinguish which instruction of the rotation/scaling script is currently running. So adjustments of vector positions and influencing movement based of the rotation is impossible normally.

There is a very easy solution, and that is to assign a task to assign rotation scripts one instruction at a time, while simultaneously adjusting position vectors. This is what I mean when I say make a new scripting system for animations. You want to combine both the animation script engine and the rotscale script engine GF has made in addition to the task system for positional updates. Ideally incorporating BGs as well. The result is an easy to use animation script system which abstracts all of the matrix and trigonometric calculations while maintaining nearly the same functionality (taking a minor speed hit of 1 frame per animation phase shift).

The downside is that it takes up a comparably larger amount of ROM space depending on the permutations of the rotscale scripts you plan to have and the length of the animation. You would need to somehow push the C2 callback, execute the script callback, pop C2 back and finish executing C2 (or you can make a very inefficient C2, but you would take a performance and potential FPS penalty).

I think most of this would become clear after I make another tutorial soon(TM).

Cheers FBI, summed it up a lot better than I could. I made the animation a while ago and sort of forgot exactly what I did. But yes the pointers there all seem a bit unoptimised having certain tasks being linked to certain sizes, though there is obviously the capability to improve this.
 

AkameTheBulbasaur

Akame Marukawa of Iyotono
409
Posts
10
Years
So recently I've started trying to do more in depth research into animations, specifically the various tasks and templates and how they work.

I'm not too far into this yet (due to being busy with other things), but what I do have so far which may be useful is a collection of all the backgrounds, particles and sound effects and which hex ID they have.

This should at least be useful so that you can know what things look/sound like without having to go find them manually every time.
 

Attachments

  • Animation Sound Effects.zip
    13.9 MB · Views: 52
  • Move Animation Particles.pdf
    300.6 KB · Views: 57
  • Move Animation Backgrounds.pdf
    235.2 KB · Views: 45

AkameTheBulbasaur

Akame Marukawa of Iyotono
409
Posts
10
Years
I'm nearly finished with my research on animation Tasks and Templates. The actual research itself is big enough to have its own thread, so likely I will be making that instead of putting it here. I'm posting here, for now, to say that Animation Scripting research isn't dead, it's just been in grad school and was too busy to work on anything for a while lol.
 
123
Posts
3
Years
  • Age 25
  • Seen yesterday
Is it possible to use pokespritetoBG command for both the User and the Target in the same animation? When I try to do it, it causes the game to freeze at the end of the battle
 
Back
Top