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

Add tweening support #204

Closed
nightm4re94 opened this issue Dec 21, 2018 · 5 comments
Closed

Add tweening support #204

nightm4re94 opened this issue Dec 21, 2018 · 5 comments
Labels
feature MAJOR This label is intended to distinguish major features from all the others.

Comments

@nightm4re94
Copy link
Member

nightm4re94 commented Dec 21, 2018

We should support some sort of xml-exportable animations for sprites to make more vivid games.
I imagine a node-based graph editor in utiLITI from where you can save newly created animations and import existing ones into your project.
To help you visualize the idea, this was inspired by this cool tweet I saw:
https://twitter.com/CodeManuPro/status/1075885060849582081?s=09

This should include the following features:

  • graphs for scale (x and y separately, maybe), rotation, x and y position. All with respect to time.
  • each graph has a list of nodes, and a list of predefined easing curves for the segments between the nodes (apart from linear functions, there's a lot of possibilities for predefined curves. https://easings.net/de offers a few great examples.)
  • possibility to export animations to xml files or add them to the .litidata file.
  • possibility to import animations from existing xml files
  • preview animations on any sprite that's already in the project
  • apply animations not only to sprites, but also to UI elements

Since there is not really a need for this window to be pinned to the utiLITI main frame, we should just directly write it in JavaFX and include it as an "animations" tab once utiLITI is ported to JavaFX as well.

@nightm4re94 nightm4re94 added feature MAJOR This label is intended to distinguish major features from all the others. tool: utiLITI labels Dec 21, 2018
@nightm4re94 nightm4re94 changed the title Add Graph-based Sprite animations Add Graph-based animations Dec 21, 2018
@steffen-wilke
Copy link
Contributor

Might be related to #120

@steffen-wilke
Copy link
Contributor

steffen-wilke commented Dec 21, 2018

We should also evaluate existing freely available solutions for this. Maybe there is a general data format for such animations that we can support or adapt.

@nightm4re94
Copy link
Member Author

nightm4re94 commented May 15, 2020

As a more abstract approach, we could consider implementing or referencing a tweening framework.
Probably the most well-known Java Tweening framework is Aurelien Ribon's Universal Tweening Engine. With its permissive Apache 2.0 License, we could reference and tweak it to our needs.
Downside: The project seems somewhat abandoned since 2012, but there is a fork on GitHub which has addressed some open issues.

I think that tweening would be a sufficient, streamlined, and generally reusable approach to modify numeric values over time. In fact, the aforementioned Tweening engine implements every single easing function defined by Robert Penner, which are available under BSD and MIT (this is the implementation in TweenEngine). In the end, we just need an interface that can be implemented by GUIComponents, Entities, Images, Sounds,... to modify their numeric attributes over time.

Building node-based animations might be nice in terms of individualism - but let's be honest: Such a feature, including the corresponding UI in utiLITI and import / export capabilities, is probably out of scope for LITIENGINE.

@nightm4re94 nightm4re94 changed the title Add Graph-based animations Add tweening support May 15, 2020
@nightm4re94
Copy link
Member Author

I've managed to come up with a working prototype for tweening support using the suggested Tweening Engine. It looks very promising and was super easy to implement.

@nightm4re94
Copy link
Member Author

#352 has added basic Tweening functionality which will be expanded upon as discussed in #353.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature MAJOR This label is intended to distinguish major features from all the others.
Projects
None yet
Development

No branches or pull requests

2 participants