Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App: Create state machine for animations #2532

Open
0reo opened this issue Mar 8, 2022 · 3 comments
Open

App: Create state machine for animations #2532

0reo opened this issue Mar 8, 2022 · 3 comments

Comments

@0reo
Copy link
Contributor

0reo commented Mar 8, 2022

Currently, avatar state information and animation code is stored in the avatar class. pr #2520 moves the animation code into a separate file, but state information is still stored in the avatar class, and state transitions are handled in a big if block. there should be a centralized state system which will:

  • be able to register any object for state tracking
  • trigger state activation/deactivation
  • hold related state data(state name, run time, etc)
  • provide access to all tracked objects, all the relevant state information for a those objects
  • be able to work along side the existing code base until a full transition can be done

Next steps for this will include

  • be able to associate animation functions to be triggered when a state is active(want to set up an animation factory class first)
  • execute animation functions internally
  • animation layers(different animations for different parts of a model)
  • complex animation chains(if state X, trigger state A, then B&C, then D, then back to A)
@gonnavis
Copy link
Contributor

gonnavis commented Apr 7, 2022

complex animation chains(if state X, trigger state A, then B&C, then D, then back to A)

Use XState achieved this first. #2762 (comment)

@avaer
Copy link
Contributor

avaer commented Apr 9, 2022

I think we need to get rid of all state in avatars. The avatar system should be like React, where it is statelessly rendering its inputs. Those inputs come from the player which owns the avatar. The player has state and the avatar does not.

I know the avatar has stateful hacks right now, but we should get rid of that.

We definitely do not want to add any more state objects to avatars. If it is important enough to be state then it should be an action on the player, and it must be network-replicable. Otherwise that state must be removed.

@avaer
Copy link
Contributor

avaer commented Apr 9, 2022

The avatar system should be easy to abstract into classes without losing any of the current functionality (exactly the same functionality and output).

It is already structured as a configurable animation chain, just that configuration has not been structured into classes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants