Benimator is no longer a bevy plugin! #91
jcornaz
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone.
benimator
is no longer a bevy plugin!From version 4, it will be a rust library, and it will not depend on bevy at all (not even via feature flag).
It can still be used from bevy
Of course, it is still perfectly compatible and usable for bevy games (as bevy is still my favorite engine).
The examples will also continue to showcase how to use
benimator
frombevy
.Let's quickly summarize here what it changes in practice.
The types must be wrapped to be used as a component and/or asset
Note how I made the
Animation
aComponent
for this example. You could make it an asset instead if you prefer. Or save it into a resource. You now have more freedom to store it wherever you like.You need to write the animation system yourself
This example is very generic. In practice, you may query other components alongside it, and/or perform additional logic.
You can also choose the source of delta-time, or alter it. Making the
PlaySpeedMultiplier
component unnecessary.But... why?
Bevy is an awesome engine. But it is very unstable. It's API is broken every 3 months.
I would like to improve
benimator
stability. I don't mind too much a breaking change if that's required for a major API improvement. Though in my experience, with enough care, the API can often be improved without breaking anything, and I will always try to avoid breaking changes as much as I can anyway.But to release a breaking change just because bevy's API has been broken is something I no longer want to do. Not to mention, that each bevy release puts unnecessary pressure on me because I have to update and publish a new version of benimator. Even if someone contributes the migration, I still have to at least review, test, and publish. I'd rather work on other stuff, or spend time with my family.
At first, I thought about using optional dependencies as I do with impacted. But that didn't work out because
web-sys
does not comply with cargo semver, which makes it impossible to depend on bothbevy_sprite 0.7
andbevy_sprite 0.8
at the same time (even optionally).After thinking about it a little more, I realized that being a bevy plugin brings very little value for quite a high cost. By not being a bevy plugin, we get appreciable advantages:
benimator
to update first!bevy
.Animation
a component, an asset or something elseI think these benefits are well worth the cost of around 10 LOC of "boilerplate" in user code. And that "boilerplate" will not even be always the same, as one can now leverage the increased flexibility differently on each project.
Beta Was this translation helpful? Give feedback.
All reactions