I am working with 2D animation and was wondering if there is a way to use Free Form Deformation in conjunction with it. I understand that it has not been officially implemented at the moment, but is there an asset (free or paid) that allows it, maybe a script that someone has developed for it?
I have seen this one here Free Form Deformation Extension for 2DAnimation Package , but I think it is very outdated and I would need the solution to be compatible with a recent version of 2D animation, as I use Sprite Swap.
Unfortunately, not that I know of. You’ll have to create bones for the vertices you want to move.
There is a third party asset called AnyPortrait that can accomplish this inside of Unity, but it’s a separate tool that won’t work with the built in skeletal animation.
Thanks for the help @Unrighteouss . Creating bones for the vertices is what I’m doing right now, but the process is certainly more tedious, and I’m worried about whether this will affect performance.
As for AnyPortrait, I didn’t know it so I’ve been checking it since yesterday. It seems to be a nice tool and I believe it has all I currently need, the reviews are good also… Do you happen to have any experience with it? If so, what is your opinion about it?
If I buy it I will have to migrate my current work to it, but I’m willing to do it if I don’t find any way of using FFD in Unity 2D Animation, as this is blocking me right now.
Also, price is more affordable than Spine Pro (only version that supports FFD) would be, all things considered.
Yeah, adding more bones will inevitably decrease performance, but with the collections package you should be fine as long as you only have a few characters. Unfortunately, skeletal animation is pretty terrible for games with dozens of characters on screen at once. Baking the animations into sprite sheets is the way to go for that, but that option doesn’t exist in Unity.
I have used it a bit and it’s really great, but it has a much steeper learning curve and is slower to use than Unity’s system. They have a bunch of tutorials on their website and youtube channel, so learning it isn’t too bad. The support is also really good in my experience, they’ll answer any questions you have.
The two reasons AnyPortrait is slower to use than Unity’s system in my experience are that editing imported PSD files is a lot trickier than editing PSB files in Unity (if you want to change stuff later on), and the automatic tools for geometry and weight painting aren’t good, you’ll likely have to do everything manually. Unity’s automatic tools in the 2020 version are the best around. Just be aware that automatic weights are super broken in 2021, but they do have a fix on the way apparently.
To summarize, if quality is your goal, go with AnyPortrait, but if you prefer speed, go with Unity. I don’t know about AnyPortrait’s performance, I’ve never tested it.
AnyPortrait has a free demo version, so definitely check it out if you’re interested.
Thing is I do need to have a high number of characters, as my project is an RTS for Windows. I had considered exporting the animations to sprite sheets to solve this problem, as I’ve seen it done in Spine, but didn’t know Unity doesn’t give the option…
I’m going to ask to AnyPortrait about this concern, their performance with a high number of animations and whether they allow to export them to sprite sheet, and I’ll come back here with the answer.
Thanks! That gives me a nice point of view, I believe I’ll prove it to see how much time I spend per animation once I learn the basic (considering I manage to solve the problem above, of course).
Hello Again!
I’ve written to AnyPortrait support and they have already answered me (incredibly fast to tell the truth).
My first question was how they would manage with a high number of characters for a RTS, considering 20 bones per character, 180x100 character size and some FFD. Their response has been that they do not believe their tool will work well in these circumstances.
The second question was if they allow to export the animation to sprite sheet, and they do. So basically using their tool I would need to export all animation to sprite sheet and use them in Unity. I will certainly do a test of this, but do you ( @Unrighteouss and anyone willing to answer) consider this to be a viable solution?
Also, they said that “RTS’s character creation pipeline and AnyPortrait’s are different”, which concerns me, but I don’t really know enough to understand the implications, so I’ll ask for details.
Finally, they said that “RTS project should use the “Instancing” technique, but unfortunately, AnyPortrait doesn’t support it”. Again, I don’t have enough expertise in animation to be familiar with this technique, anyone knows an animation software more focused to it?
I’ve never tested baking animations to sprite sheets with AnyPortrait, but assuming it works, then yes, it’s a viable solution.
The reason skeletal animation is so performance intensive is because when you animate bones, Unity needs to calculate the movement of each vertex based on its bone weight every single frame. Less weighted vertices equals less calculation. With sprite sheets, you’re just moving UV coordinates around which is simple by comparison. This is my understanding of it anyway.
The limiting factor of using sprites is memory, but with how much memory computers have nowadays and the fact that your sprites are a tiny 180x100, it shouldn’t be an issue. Even rendering hundreds of sprites at once should yield solid performance.
You may run into issues with your code though; for example, if you’re planning on duplicating characters with their own scripts, you may run into performance issues with that. I have no idea how to optimize an RTS game, but just thought I’d mention it.
I don’t have a clue what they’re talking about here. If you manage to get a sprite sheet out of AnyPortrait, that’s all you need.
AnyPortrait support team has assured me the same thing. I’ve also done an informal test this morning, using 340 sprite sheet animations on screen at once (120x120 each frame). I’ve released a version with it and tested it on the oldest computer I have on hand. The results have been solid, as the FPS haven’t gone below 60 (in fact they have remained well above).
Thanks for the explanation @Unrighteouss , I see now skeletal animation would have been difficult to implement in our game, I’m truly happy with the solution found.
Yeah, pathfinding was one of the problems in fact, but I’m using Aron Granberg library and it is working quite well. I’m also trying to be careful with heavy-cost operations in character scripts, and so far I don’t think I have encountered any blocking problems. I will have to test it all together though, but that will be a next step.
Thanks for all the help provided @Unrighteouss , you have been very kind. I will start recording animations in AnyPortrait and exporting them to sprite sheets. Let’s see what happens!