phetsims / equality-explorer

"Equality Explorer" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
2 stars 3 forks source link

Does animation need to be stateful? #197

Open pixelzoom opened 1 year ago

pixelzoom commented 1 year ago

Some big design questions have come up in #192 during initial instrumentation. This sim has 3 types of animation, and its not clear whether they need to be stateful.

(1) Motion of terms: Terms animate to toolboxes or plates when they are released. These animations are handled via sim-specific code (step methods) called on each frame.

(2) Terms fade out when they sum to zero. This animation is handled by PhET's twixt repo, which is not currently instrumented.

(3) Universal Operations animate to the plates in the Operations and Solve It screens, then fade out when they reach the plates. This animation is handled by PhET's twixt repo.

(4) Game reward, which is provided by vegas RewardNode, and is not currently instrumented.

Do these animations need to be stateful?

If the answer is "yes", this means that common-code work is needed, and it significantly increases the difficult of equality-explorer instrumentation.

If the answer is "no", how do we prevent someone from saving state while animation is in progress?

@samreid @zepumph @arouinfar FYI.

pixelzoom commented 1 year ago

I should mention that these are general issues, and decisions here will likely apply to other sims that use twixt animations and vegas RewardNode.

pixelzoom commented 1 year ago

There are currently 8 TODOs in the code that reference this issue:

//TODO https://github.com/phetsims/equality-explorer/issues/197
pixelzoom commented 1 year ago

@amanda-phet @catherinecarter and I discussed this at 11/8/2022 design meeting. Summary:

Further discussion is needed with @kathy-phet to come to a conclusion.

arouinfar commented 1 year ago

The most practical way to address this is probably to document in Client Guide.

Agreed! Note that there is now a single PhET-iO Guide shared by all sims, so documentation should be written in a general way. It has a section for Limitations to Customizing State with a list of things that aren't stateful (e.g. transient behavior) so we can add animations to the list.