Replies: 2 comments 7 replies
-
After investigating it a bit That being said I still need to figure out if it's possible to fetch the state of animations within the tree. |
Beta Was this translation helpful? Give feedback.
-
Addressing Animation Tool CompatabilityHere are my current thoughts on addressing this problem. Supporting AnimationPlayerVery straight forward. The player can tell us the current animation, it's length, and it's position in the playback. That's everything we'd need to know to support it. Supporting AnimatedSpriteSimilar situation to player. The sprite can tell us the current animation, current frame, frame count, and the FPS of the animation. Supporting AnimationTreeThe only solution I've thought of to support this is to insert function calls into the animation player at runtime. More details here: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Main Issue
The issue, as I understand it, is the difficulty in having a state machine react to specific points of interest within an animation. Given that the state machine primarily exists to represent a combatant's state within a game, many state transitions are understandably linked to the animation state (such as exiting a state on animation end). However, Fray's state machine lacks a straightforward method for handling animation state reactions.
Problems To Be Addressed
Assuming I identified the main issue, these are the mains problems I think a good solution should address:
Selective Animation Reaction: It needs to be "opt-in" in some form. Such as encapsulating this logic into some kind of
AnimationObserverState
. Even if the main purpose is combatant state management, I still want this to be a general purpose state machine. Not every state will be concerned with the state of an animation.Reaction To Arbitrary Points In Animation State: States within the state machine that are concerned with animations need to be able to access the state of an animation. I think knowing when an animation will end will be most common, but users may also want to be able to react to other arbitrary points.
Animation Tool Compatibility: Ideally the solution would support both the
AnimationPlayer
andAnimationTree
. If I'm not mistaken, though the animation tree uses the animation player I think the playback is handled within the tree. Meaning if only the player is observed then animation state wouldn't be properly reported. I may also want to consider supportingAnimatedSprite
.Conclusion
As of now, I'm just trying to full grasp the problems users have with the state machine. I don't have a definite solution in mind yet. Please let me know if I correctly understood the limitations, and whether you believe solving the mention problems would address those limitations.
Discussion Inspired By These Comments
From @Remi123
From @Remi123
From @Kuenaimaku
Beta Was this translation helpful? Give feedback.
All reactions