[Open Beta] Procedural On-the-Fly Animation in UE4: iTween!

I’ll probably make a larger post about this at some point, but in summary, I’m sick of Blueprints or anything Generated by UE4. I get a lot of work done, and as soon as I go to package it and open it on iOS, everything crashes. These crashes always come from it attempting to load or link with Widget / or normal Blueprints. Since neither of these are openable in any human readable form, there is nothing I can do to fix these issues (my opinion is, they are the result of corruption from upgrading from various versions of UE4 over time). I first got rid of all blueprints converting my code to C++, but I continued to have issues with widgets too. Its not worth the days of lost time trying to submit bugs, then waiting even longer for fixes, so I’m going to dump UMG now and go all Slate. The worst case scenario when C++ code crashes, I get a line number in a human readable code. With blueprints and u widgets, you get an unreadable error message, then you go to the debugger, step through it, and you find it deep in a stack trace of the code attempting to load or run a blueprint at that point there is nothing you can do. UE4 has some work to do to make Blueprints or UMG a serious option, my game isn’t even that large yet, and I’ve encountered this constantly. I don’t know about other platforms since I’m focusing primarily on IOS at first. I’m a one man team too, so I can’t really take the setbacks UMG/Blueprints cause.

That’s a sad but salient point. I do plan to learn a bit more about Slate as time goes on, but as of now I’m no expert, sorry to say. But Slate-specific tweens are on the roadmap. For now, a second interface would be your best option. I’ll help you any way I can. Good luck!

I’ll let you know what I come with and share it with you :slight_smile:

You’re the best .

I PM’ed you some of my ideas.

I have couple of questions regarding performance, how does it effects the performance if I am tweening more then 100 objects and is calling itween function inside c++ increases performance?

Thanks,

I would like to thank publicly for his help getting iTween working directly with Slate. He’s sent me his code and I’ve been reviewing/implementing it with the new version which will be available soon. HUGE thanks!

I hadn’t done more than a few cursory stress tests on my high-end desktop and “let’s just see if it works” tests on a range of other computers until now, so thank you for your question. It forced me to actually sit down and check the performance impact of iTween.

The answer is: it ranges from no difference to more performant! :slight_smile:

I used a 2.4ghz i7 intel computer with no dedicated gpu to test. 16gb of ram. Hyperthreading on.
I tested two different projects - one blueprint only and one using C++.
The projects were set to the mobile preset, 2D or Scalable 3D, no starter content. Only a single box for the floor was used.
In this case, I created a 200x200x200 BSP box, converted it to static mesh, gave it a lightmap resolution of 4, and made it into a class.
I did a baseline check by adding a RotationMovementComponent to this class and tested it against using iTween’s Rotate From/To looping over and over.
I capped performance at 60fps for the project for the sake of simplicity. iTween does not cap your project’s performance.

Spoiler alert: It seems the fastest option is using C++ function calls, but the speed difference is hardly noticeable in gameplay. You can set the interval to force a certain fps for your tweens and gain considerable speed, but only up to a certain point - naturally, if you’re forcing an update that is more frequent than your current frames per second, you’ll suffer a performance hit.

are my findings:

Blueprint only with rotation component, no iTween:
~0 objects: 60 fps
~100 objects: 53 fps
~200 objects: 39 fps
~300 objects: 26 fps
~400 objects: 17 fps
~500 objects: 12 fps
~600 objects: 8 fps
~700 objects: 6 fps
~800 objects: 5 fps
~900 objects: 3 fps
~1000 objects: 3 fps
C++ only with rotation component, no iTween:
~0 objects: 60 fps
~100 objects: 58 fps
~200 objects: 40 fps
~300 objects: 27 fps
~400 objects: 18 fps
~500 objects: 13 fps
~600 objects: 9 fps
~700 objects: 6 fps
~800 objects: 5 fps
~900 objects: 4 fps
~1000 objects: 3 fps
Blueprint with iTween’s Rotate From/To looping (“I’m a Blueprinter exclusively”), updated every tick:
~0 objects: 60 fps
~100 objects: 55 fps
~200 objects: 39 fps
~300 objects: 26 fps
~400 objects: 18 fps
~500 objects: 13 fps
~600 objects: 9 fps
~700 objects: 7 fps
~800 objects: 5 fps
~900 objects: 4 fps
~1000 objects: 3 fps
Blueprint with iTween’s Rotate From/To looping (“I’m a Blueprinter exclusively”), updated every 0.033 seconds (~30 frames per second forced):
~0 objects: 60 fps
~100 objects: 60 fps
~200 objects: 46 fps
~300 objects: 18 fps
~400 objects: 2 fps
~500 objects: 2 fps
C++ with iTween’s Rotate From/To looping (“I’m a C++ user or both”), updated every tick:
~0 objects: 60 fps
~100 objects: 59 fps
~200 objects: 41 fps
~300 objects: 28 fps
~400 objects: 19 fps
~500 objects: 13 fps
~600 objects: 10 fps
~700 objects: 7 fps
~800 objects: 5 fps
~900 objects: 4 fps
~1000 objects: 3 fps
C++ with iTween’s Rotate From/To looping (“I’m a C++ user or both”), updated every tick, putting iTween return value into a variable:
~0 objects: 60 fps
~100 objects: 56 fps
~200 objects: 40 fps
~300 objects: 27 fps
~400 objects: 19 fps
~500 objects: 13 fps
~600 objects: 9 fps
~700 objects: 7 fps
~800 objects: 5 fps
~900 objects: 4 fps
~1000 objects: 3 fps
C++ with iTween’s Rotate From/To looping (“I’m a C++ user or both”), updated every 0.033 seconds (~30 frames per second forced):
~0 objects: 60 fps
~100 objects: 60 fps
~200 objects: 49 fps
~300 objects: 20 fps
~400 objects: 4 fps
~500 objects: 2 fps

Thanks for taking time and doing those test. Now I know where and how I can use iTween in my project properly.
Again thanks for creating such an awesome tool for UE4.

Thank you for using it! As always, we invite you to show us what you come up with!

Hi! This is great stuff I just learned how to use it :slight_smile:
I am trying to set it with a camera, and it works great- I can move the camera actor and make it look at a target- but I am having a hard time controlling the FOV of the camera, is there a way to do this with itween?
Thanks!

Thanks for jumping in!

There’s no built-in functionality yet for tweening a camera’s FOV - though there will be in the future as we move past version 1.0 which is the basic stuff. We hope to eventually have tweens for every piece of every component of the engine, but until then you can use the Float From/To Event.

I assume you’re using blueprints; let me know if you need a C++ tute!

Float From/To, like other Data Tweens, don’t act upon a specific object, they just work with a piece of data, like a float, and pass that information to an interface every time the tween updates.

's how I would set up a tweening rig for a camera’s FOV:

You’ll need to implement the iTInterface into your blueprint and call both float from/to and implement Event On Tween Data Tick. Pass in your current FOV and the new FOV you want among the other relevant data. Make sure you pass a reference to self as the OnTweenTick target. Then every time the tween updates it will send the interface message to the On Tween Data Tick and you can use that to fire off a set of your FOV.

Please note that in the next version, On Tween Data Tick will become On Tween Update and On Tween Data Tick and On Tween Tick will no longer be two separate concepts - they’ll both be condensed down into On Tween Update and float value will be part of a data values struct. However, setting it up today like I just showed you will be fine and will continue to work. I’m not removing the old stuff, just deprecating it. You’ll have to move over to the new stuff eventually, but you needn’t worry about it right now.

Best of luck! Let me know if you have any more questions!

No problem , i was ultimately helping myself and I rather it be part of the official release so I can keep getting updates without having to worry about reintegrating it every time :). iTween honestly has been the first ‘must have’ plugins I’ve used with UE4. Great work there!

At the risk of sounding like an ignoramus, it warms my heart to hear that :slight_smile:

I definitely will need to learn more Slate to get to a point of being able to regularly update the Slate portion of iTween, but that’s absolutely going to happen. Thanks for the kick in the pants!

If anything breaks let me know and I’ll do what I can to help!

I’m not sure how difficult is to make a build of your plugin with the new version or if it has to rebuilt for every preview update, but would it be possible to get a working build of iTween for 4.7 preview 4? I’ve reached the point of my new project where I can start developing gameplay again but need to use 4.7, however I can’t use iTween because it says it was built for a different version. Would really appreciate it but if it takes a significant amount of time no worries at all I’ll just try and work around it for the mean time.

Hey Swift, long time no see!

It’s certainly not difficult, but at the moment I am not on subscription, so I don’t have a build of 4.7 handy. I can give you a build with a 4.8 master branch build, but I doubt it would work in 4.7.

However, if you have or can get visual studio, I’ll be glad to walk you through compiling it yourself. It’s not as hard as it seems and I’ll take you through it all, step by step. Are you interested?

Hey :)! been awhile for sure, had a bunch of prep work for this next project but ready to start it now and use the power of iTween :D.

Oh, that’s understandable.

Would it require setting up a C++ unreal engine project or creating additional assets/compiling unreal engine itself? I’ve had nightmares attempting to compile the github builds in the past and would honestly rather avoid the timesink of attempting that again. If it’s more self-contained though with your iTween code I’d greatly appreciate it as it would make a really significant difference on the characters feel of motion and with that being my current core focus I’d like to not have to wait longer than necessary.
If it does involve the above though I’ll just have to revert to 4.6 for the time until you have the opportunity to update it.

Hey thank you for the help! I use a timeline instead :slight_smile: but looking forward to version 1 when everything is itweenable!

It doesn’t involve building the engine source, but you do have to make a new C++ project. Fortunately, you don’t have to do much beyond that. I have a few minutes today so I’ll make a video walkthrough for compiling iTween. :slight_smile:

Not a problem catalejo, whatever gets the job done! I wouldn’t expect everything to be tweenable by 1.0, what I meant to say was that really specific tweens would be the focus after 1.0 ships. But since everyone has cameras, I can certainly make that a priority before 1.0. Thanks for stopping by!

Oh sweet :)!
That’d be incredibly epic, thank you ever so much :D!!