Jump to content

[RESOLVED by compromise] Animations and time warp


Recommended Posts

I need to know how to properly manage timing during physics warp and high-speed warp (the non-physics variety).

Timing is required for my animations. I can use Time.time under normal scale and it works ok, but i need a timing variable / method that reads game time and is affected by both warp types. Note that MET is not acceptable since it does not run while vessel is landed.

Edited by fatcargo
Link to comment
Share on other sites

Sigh... I've come up with this, i just don't know if Time.time is the correct source (or the ONLY source of timing info, besides MET)
 

public float scaledTime
        {
            get { return Time.time * Mathf.Max(Time.timeScale,TimeWarp.CurrentRate); }
        }

After testing i've concluded that Time.timeScale is for physics warp and TimeWarp.CurrentRate is for high-speed physics-less warp. Also note that rate changes between two steps are gradual.

Link to comment
Share on other sites

Thanks for this, i did more tests and Time.time appears to be affected by physics warp only.

Planetarium.GetUniversalTime()  does respect both warp modes.

Hmmm... I just tested stock cargo bay. Animation playback speeds are affected by physics warp only. A compromise or a bug, i can't tell.

Another thing about gameplay : when high-speed (on-rails) warp is active, part menu buttons (defined with [KSPEvent] attribute in plugin) are not available, preventing players from activating animations that make parts move in this warp mode.

Can you imagine a 15 second animation accelerated by 10000x warp ? :)  To me it looks more and more like a compromise. Interestingly, action groups are not affected, so player could still execute them.

Edited by fatcargo
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...