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

Interpolate drawing position to make slowed time smoother. #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SiegeLord
Copy link
Contributor

This is WIP, many things are broken but I'd like to know if this is a good enough idea/worth it to pursue it futher.

The idea is simple: use linear interpolation between current and old positions when drawing in slow time (e.g. when invoking Domina powers) to make everything move smoothly despite the slower update rate.

Here it is in action: https://www.youtube.com/watch?v=DR_ZJn3OIZQ

Many things work, but some don't (e.g. for some reason missile trails are broken despite using the same particle system as engine trails which work fine). There are a few bigger issues with this approach:

  • It requires hunting down all the locations where we need to interpolate the drawing position
  • If any place is missed, it'll look worse than it did before this change, because the viewport position is always interpolated and its essential to cancel this out for moving objects.
  • This introduces a 1 frame drawing lag because we're interpolating from old to new.
  • Not everything has an 'old position', and estimating it based on velocity is not perfect. This might require making more things track their old position.

Tell me what you think.

@gmoromisato
Copy link
Member

Awesome, and I think it is a good approach.

The only thing I'm worried about is the 1 frame drawing lag that you mentioned. What does this mean exactly? Is this just during slow-motion or during normal play?

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

Successfully merging this pull request may close these issues.

2 participants