Galenmereth

Retired
Veteran
Joined
May 15, 2013
Messages
2,248
Reaction score
2,162
First Language
English
Primarily Uses
N/A
Easing Script
 
Edit: The completed script can now be found here: http://forums.rpgmakerweb.com/index.php?/topic/20714-ease-script-smooth-and-varied-movement/?p=197603

Introduction
So what is "easing"? Have you tried using the Move Picture event command in Ace? You'll notice that, if you move the picture's position from one spot to another, the movement in between is linear - it moves from point A towards point B in X amount of frames in equal amounts each frame. A lot of the time this is fine, but what if you want to move the pictures quickly but with a little slowing down at the end, for a "pop up" effect? That's what easing can do. Easing is using the powers of math to apply a modified movement curve to an object's attributes over a given period of time.
 
Demonstration
All of that is a bit boring, so have a look at this video instead. Please be aware that the choppiness is Fraps' fault; there's no extra performance hit on using the easing script from the regular move picture methods, so it moves silky smooth:

Edit: I've added the bounce ease method:
Does it work with multiple images, different durations and easing methods? But of course it does! The Move Picture extension hooks into the update method, and uses the Easing module algorithms instead of Ace's default, so it works just like Move Picture works by default, just with easing! Here's a super quick video I took of multiple pictures being moved with different durations and easing methods applied:

 
Moving pictures is just one use for the Easing Script. I'm making it modular, and scripters can use its easing class for anything, like moving projectiles, characters, fading pictures in exiting ways, etc. The script is modular, so you can add new easing algorithms easily, for example. It'll also be the first script I will release using the "Plugin Framework" setup, but don't worry; I'll make a standard script version too. It's a lot nicer to work with when you're using the plugin framework, however. Take a look at this neat folder structure:
 
tdd_easing_plugin.PNG
Psst, scripters: Don't worry, I'll document it all properly...

How it works

To do what I did in the video above, all you have to do is set the easing method before you use a move picture command, by setting Game_Picture.easing to desired easing method in a script call. It's reset to default after the move command. You can also set the default easing method for all future move picture commands by using Game_Picture.easing_default instead. A picture is perhaps more descriptive:

tdd_easing_move_picture.PNG
Keep in mind that it works with all the Move Picture settings, like the duration. As you can see in the picture, I only call one Move Picture command; the movement is modified only based on the set easing method. I'm going to make a shorthand script call for setting the easing, so it won't be that much text needed when it's done.

Todo

While the script works for positioning of pictures, I haven't implemented it with alpha values yet, or tint. So that needs to be done. I'll also be adding more easing methods, like bounce, circular, curve and sine. In addition, I'll be implementing script calls for moving an event using easing and setting alpha values of events with easing. I'll then release it, as it will have a solid foundation for other scripters to use it and extend classes with it, and I'll probably make a few extensions myself which I've overlooked.

If you've got any questions, or have some ideas for this script, let me know :) Have an awesome day!

WIP Demo

If you're feeling super adventurous, you can download the work in progress demo from the video and test it out for yourself. Does not contain the RTP, and includes an item popup picture from my game. Please don't use the picture in your game as-is, or you'll make me super sad -> o(╥﹏╥)o

Link to WIP demo file

Credit

- Galenmereth

https://github.com/ai/easings.net For the wonderful elastic mathemagical algorithms

License

Free for commercial and non-commercial use. Credit is greatly appreciated but not required.
 
Last edited by a moderator:

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,005
First Language
Tagalog
Primarily Uses
RMVXA
Hmmm... seems nice... an alternative to using multiple move picture commands
 
Last edited by a moderator:

Galenmereth

Retired
Veteran
Joined
May 15, 2013
Messages
2,248
Reaction score
2,162
First Language
English
Primarily Uses
N/A
Yeah, it definitely is. The continuous need for multiple move picture commands is what drove me to make this; it was very difficult to get it to look just right, and it was a nightmare to edit when the number of events with such chains of commands started piling up...

I've made sure to make it very modular, so making your own custom algorithms is very easy. I'll write documentation for this with examples for the full version; you can do some very fun things with this :)
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,005
First Language
Tagalog
Primarily Uses
RMVXA
yeah it looks to be quite a nice helpful script... too bad I can't watch YT videos in the office... Y_Y
 

Galenmereth

Retired
Veteran
Joined
May 15, 2013
Messages
2,248
Reaction score
2,162
First Language
English
Primarily Uses
N/A
Aww, that's a shame. Make sure to take a look when you get home, and download the demo file if you feel like looking at it live and playing with it :)
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,875
First Language
English
Do the settings apply to all pictures, or just a specific picture?


For example if I have multiple pictures on the screen.
 

Galenmereth

Retired
Veteran
Joined
May 15, 2013
Messages
2,248
Reaction score
2,162
First Language
English
Primarily Uses
N/A
Do the settings apply to all pictures, or just a specific picture?

For example if I have multiple pictures on the screen.
Easing works on multiple pictures, with multiple durations, and they can all have different easing methods applied too. But the Game_Picture.easing method is reset to default after being used once, so if you use Move Picture two times in a row, only the first will be affected by the easing setting, and the second will get the default. You can solve it by setting an ease method before each Move Picture command (they can have individual easing methods applied), or by setting the default easing method using Game_Picture.easing_default :)

I'll make some shorthand script calls for this, and document it properly. Hope it makes sense, though.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,005
First Language
Tagalog
Primarily Uses
RMVXA
how about if I want two pictures to animate at the same time? (like using parallel process)
 

Galenmereth

Retired
Veteran
Joined
May 15, 2013
Messages
2,248
Reaction score
2,162
First Language
English
Primarily Uses
N/A
No problem :) The Move Picture extension hooks into the update loop, and updates using easing instead of the standard Ace algorithm. So it'll work with multiple pictures, individual easing methods (or the same, if you want), and just like Move Picture works. Here's a super quick video I took of multiple images with different durations and easing methods applied:




Edit shenanigans: Added the bounce easing addon. Watching the videos in fullscreen seems to alleviate the choppiness :)
 
Last edited by a moderator:

ShinGamix

DS Style 4Ever!
Veteran
Joined
Mar 18, 2012
Messages
3,906
Reaction score
458
First Language
April Fools
Primarily Uses
N/A
Could this script be used in conjunction with another one say an animated name script (Detika!)?
 

Galenmereth

Retired
Veteran
Joined
May 15, 2013
Messages
2,248
Reaction score
2,162
First Language
English
Primarily Uses
N/A
Definitely, but depending on how the script animates objects, you might have to change it slightly so that it utilizes easing instead.

Edit: Took a look at Dekita's Animated Map Name script, and while it's perfectly doable to implement the easing script with it, it animates its objects in a way that requires quite a bit of work to change over. But I'll take a look at it again after I'm done with the core of the Easing script :)
 
Last edited by a moderator:

Galenmereth

Retired
Veteran
Joined
May 15, 2013
Messages
2,248
Reaction score
2,162
First Language
English
Primarily Uses
N/A
It's been almost 24 hours (bar thirty or so minutes), so I'm going to brave the elements (aka. moderators) and bump this thing with an update :)

I added three more easing methods: Back (sort of like elastic but a bit more restrained, different algorithm), Circular (for quicker acceleration and deceleration), and Exponential (for twitchiness). Here's a video of them:




Progress on the core script is also going smooth; I optimized it a bit, started writing detailed comments on usage. Additionally I've been working on implementing the easing into the Rotate Picture and Tint Picture commands. You can set your easing method separately from the Move Picture command (that is, separately for both Move, Rotate and Tint), which means you can really make some fancy (or trippy!) effects. Oh, and I'm also going to implement easing into the Tint Screen, Fadein and Fadeout Screen commands. That will be very handy I think.
 
Last edited by a moderator:

Latest Threads

Latest Profile Posts

100 degrees here (38 degrees C) god I need ac
I wish I can work faster on my game. But I don't want to get burned out. :(
I've been working on something on and off for a few years now, and I've been reluctant to share any details on the project before I had anything playable because I did not want to generate hype only for the project to go back on hiatus. That being said I believe what I'm working on is very unique and pushes the boundaries of what RPG Maker projects can be. Bold claims, I know but just wait.
Happy Mother's Day to all the moms :)
Create Anime Art w/ AI, Tall Sprites with Aurora, Customize Variable Display | RPG Maker News #34

Forum statistics

Threads
111,207
Messages
1,059,265
Members
144,461
Latest member
Rookie
Top