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

No UI Animation System (Required for Terasology/Breathing#4 and #1639) #2271

Closed
viveret opened this issue Apr 1, 2016 · 9 comments
Closed
Labels
Topic: Architecture Requests, Issues and Changes related to software architecture, programming patterns, etc. Topic: UI/UX Requests, Issues and Changes related to screens, artwork, sound and overall user experience

Comments

@viveret
Copy link
Contributor

viveret commented Apr 1, 2016

There is not any UI animation system (to my knowledge) to support these features / fixes, which would be required by Terasology/Breathing#4 and #1639. What can we do about it?
I'm thinking something along the lines of Android's method of animation using a formatted text file (like JSON) to specify animation details.

@msteiger
Copy link
Member

msteiger commented Apr 1, 2016

Interesting suggestion. In my opinion, such a formal specification would be overdoing it, though.

I'd rather define a set of Java classes that define basic animations and put that in engine. Modules can use those out-of-the-box or define their own animations by overriding the update(float) method.

Such animators exist already for in-game entities: https://www.youtube.com/watch?v=0sAIA1eaUPQ
Code: https://github.com/Terasology/ItemRendering

I might be able to help working on the specifics.

@Cervator Cervator added Topic: Architecture Requests, Issues and Changes related to software architecture, programming patterns, etc. Topic: UI/UX Requests, Issues and Changes related to screens, artwork, sound and overall user experience labels Apr 1, 2016
@Cervator
Copy link
Member

Cervator commented Apr 1, 2016

Trying to work this out in my head - the health bar currently shows changes as the player gains / loses health. Is that just a UI element that's updating or an animation?

Once upon a time in legacy @small-jeeper had added a decoration where the toolbar would roll out (with some cogs on the side and everything!) into the full inventory. Was pretty neat but pre-NUI so it didn't get converted. Is that more of an animation than a simple update in the UI?

IIRC you can bind UI elements to a backing data element so they get updated automatically. I don't actually know off-hand how the health bar updates, either in Core or the hunger/thirst in Josharias Survival or Throughout the Ages.

Would animation be more for taking updated data (say 1-10 for health) then mapping each value to a specific state of a custom UI element like a paperdoll representation of the player's health? Sort of like you say specifying stages in a JSON file?

@viveret
Copy link
Contributor Author

viveret commented Apr 1, 2016

There would be default time and value interpolators for traversing animations, and the json file would describe starting and ending conditions.

The health bar currently just renders whole or half icon images without transition.

@viveret
Copy link
Contributor Author

viveret commented Apr 2, 2016

Based off the ideas on Android's Animating Resources

FrameComponent (basically a component that changes):

  • References to values or Objects to transition from / to

Frame:

  • List of frames components

Base Animation Mutator (Transitions between 2 or more frames):

  • From and To frames
  • Time delay and duration
  • Type of interpolation (linear, quadratic, exponential, logarithmic, square inverse...)
  • Repeat (set number (once, many), infinite)
  • Repeat mode (repeat, reverse)

@msteiger
Copy link
Member

msteiger commented Apr 2, 2016

Hmm .. interesting. A simple specification in JSON UI files and implementation in Java might have some potential.

I think the referenced objects shouldn't be Component instances - maybe UIWidget instances? This would be in analogy to how layouts refer to widgets.

Maybe you can try that out along one or two simple examples: UI buttons fading in/out when a screen opens or HUD elements moving in/out from the border (remember Warcraft 3 menus?)

@viveret
Copy link
Contributor Author

viveret commented Apr 2, 2016

Component in the generic sense of the word and not any sort of existing Component implementation. I mean components like rotation, translation, color, alpha, size, etc.

@viveret
Copy link
Contributor Author

viveret commented Apr 3, 2016

@Cervator Should I open a pull request (that shouldn't be merged until its finished) so that we can view the animation code?

@Cervator
Copy link
Member

Cervator commented Apr 3, 2016

@viveret If you've already got some code to review (cool!) then sure :-)

@Cervator
Copy link
Member

Closing as complete! Go forth and animate all the things! :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Topic: Architecture Requests, Issues and Changes related to software architecture, programming patterns, etc. Topic: UI/UX Requests, Issues and Changes related to screens, artwork, sound and overall user experience
Projects
None yet
Development

No branches or pull requests

3 participants