Jump to content

Timewarp Rotation Fix


skykooler

Recommended Posts

In Stock KSP, when you timewarp, your ship suddenly stops rotating. But this isn't very realistic. And I saw this thread that mentioned centrifuges and I realized that you couldn't do those in a realistic way (i.e. rotate the whole ship), so here is my solution. It will keep the ship rotating in timewarp and after you leave timewarp.

This is alpha. Expect bugs. Large ships could break. Please tell me about bugs you find.

Installation: put dll somewhere in GameData.

Update: Added license as GPLv3.

Download

Changelog:

v0.3:

  • SAS now enables orb-rate rotation. [Thanks BahamutoD for the fix!]

v0.2:

  • All vessels rotate during warp, not just the currently active one
  • Vessels remember their state and will continue to rotate even after closing the game and reopening it
  • Vessels do not try to rotate on the ground
  • SAS is available. If you turn on SAS, the following will happen:
    1. If you are still turning too fast, you will not stop.
    2. If you are very nearly stopped, you will stop; and
    3. If RCS is enabled, it will very slowly drain RCS to maintain orientation;
    4. otherwise it will draw ElectricCharge to maintain orientation.

v0.1:

  • Make vehicles continue to rotate during timewarp
  • Make vehicles continue to rotate when brought out of timewarp

Edited by skykooler
Link to comment
Share on other sites

How do you do this? I can't imagine being able to keep the rotation at x100000. It would not only look really weird but would likely crash the game easily. Did you make some kind of trick that reapplies the rotation when you exit timewarp or does it keep physics on all the time?

Link to comment
Share on other sites

I find it hard to believe that rotation is possible while on rails. I took a look at the source; does it apply torque based on the off-rails angular velocity and the time spent on rails? If so, it's going to obliterate your craft as soon as you disengage time warp.

Link to comment
Share on other sites

this looks promising, Specially when used in conjunction with the washers in infernal robotics, for proper centrifuges, finally.

how about leaving the ship and returning? will it make it stop? or is this just for the warps?

I hope it only saves how much your spinning before warping/leaving then when you stop warp/return it will reapply that rotation again.

Link to comment
Share on other sites

What is with the disbelief? Rotation while on rails is not impossible at all if you simply put the rotation "on rails" as well. Angular position will simply be a sine function of time.

What's even funnier is the download is there to prove it works....

Link to comment
Share on other sites

I wasn't bashing it or anything, I'm just wondering how it works before I get to try it. I'm guessing it remembers rotation and reapplies it when coming out of warp, similar to the KSPI warp drive. I will likely not use it since I've been abusing this mechanic for too long to willingly give it up. Good job on the OP for managing to do this.

Link to comment
Share on other sites

Conservation of angular momentum is something that should really be in stock KSP. Even if you don't display the rotation during time warp, the physics engine still knows what it was doing / what the state was when it went "off rails" and should really be resuming that when it goes back to simulation. (Edit: The current logic of cancelling rotation should then be banished to the F12/Debug menu.)

I had considered writing just such a plugin some time ago, but life intervened and I forgot. Really hope this is still up and available when I get home from work so I can check it out.

Source is included in the zip file, right?

Edited by Cydonian Monk
Link to comment
Share on other sites

Sorry about forgetting a license; it is GPL, I fixed that.

this looks promising, Specially when used in conjunction with the washers in infernal robotics, for proper centrifuges, finally.

how about leaving the ship and returning? will it make it stop? or is this just for the warps?

It doesn't do it when you leave a ship yet. That's on my todo-list.

Link to comment
Share on other sites

Just tried it.. Pretty sweet. Only problem so far for me (apart from the leaving ship thing which is on your list) was attitude control. Sounds obvious, but normally you have attitude control when out of timewarp.. and during timewarp its kinda predictable. Say I aim for the normal of my orbit.. Even the slightest rotational speed would make that.. Difficult, as I have no control on rails. Im not suggesting this is a flaw of the plugin, at all. Rather seems like a logical effect. Just curious if you have thought about workarounds?

edit. hope I mentioned how impressive the plugin is

Edited by plausse
Link to comment
Share on other sites

Right, I just tested it. Some general info for the people wondering how this works:

Your crafts rotation is put on rails. So you can see it spinning as you time warp.

SAS does not work during time warp, so when you hit higher levels of time warp your craft will still spin thanks to the small residual wobble.

Your craft does not experience G forces during time acceleration or anything wonky like that, it remembers perfectly how fast it was spinning.

As far as bugs goes, I had one probe spontaneously disassemble when coming down to 1x from maximum time warp in RSS (So with faster warp rates) and with a really heavy starting spin. I tried to reproduce it several times though, and it only happened once. So it might have been a random event from one of my many other mods.

A suggestion might be to arrest rotation when you detect SAS is enabled and the initial spin is below some threshold. I imagine the current state will make long transfers windows rather sickness inducing to the player :P

In any case, Thanks so much for this mod! It always bothered me that I could cheat the rotation during docking. Now I have yet another thing to worry about, which is exactly what I like about this game!

Link to comment
Share on other sites

Version 0.2 released!

Changelog:

  • All vessels rotate during warp, not just the currently active one
  • Vessels remember their state and will continue to rotate even after closing the game and reopening it
  • Vessels do not try to rotate on the ground
  • SAS is available. If you turn on SAS, the following will happen:
    1. If you are still turning too fast, you will not stop.
    2. If you are very nearly stopped, you will stop; and
    3. If RCS is enabled, it will very slowly drain RCS to maintain orientation;
    4. otherwise it will draw ElectricCharge to maintain orientation.

Link to comment
Share on other sites

Neato! That has always bugged me. It sure seems to freak out MechJeb's autowarp on ascent and landing though. That's not a fault of your mod -- that's just Mechjeb being Mechjeb.

MechJeb freaks out due to Jeb's natural acceptance of the freaky.

Link to comment
Share on other sites

Very impressive, but people is so used, even if it's completely incorect, to this ultimate stopper of everything rotation then I can't imagine it will become very popular.Some sort of paradigm shift. Maybe of Manly will begin to use it:).

Modders are continue to make what is "impossible to make" and "limitation of engine".

It's not as terrible(in breaking of habits) as it sounds, at least warp still kill any wobble, and this sas emuation is neat, but all is feels more believable. I always felt little guilty about using warp to stop things.

It even handy because give ability to very slow turns in non physical warp, if you have lot of time for maneuver you can even turn several hundreds tons vessel for hours from a tiny bit of rcs if you wish.

But as feedback I have some problem with one ship(one at kerbin orbit is work fine) - maybe it's because it's in interplanet space or maybe something other involved but it's shake in strange way. Actual rotation seems completely correct but ship durning warp by some reason flips every frame(more graphical glitch then real problem). I'm still not sure is this this mod by it self or something other make this mod to work incorrect but maybe you know what is gong on.

edit: It's a bit strange but when I load ksp again it's not doing it anymore, I don't know what it was.

Edited by zzz
Link to comment
Share on other sites

Neato! That has always bugged me. It sure seems to freak out MechJeb's autowarp on ascent and landing though. That's not a fault of your mod -- that's just Mechjeb being Mechjeb.

Yep, I was thinking about that problem when skykooler talked about his mod on IRC. MJ abuses the "warp stop rotation" thing a bit. I'll add it on the list of thing I should change.

Link to comment
Share on other sites

So, do i understand it right? If i point prograde at perigee and turn on SAS.. it will also point prograde on apogee after warp? That would be awesome!

Need to try that after work.

Edited by StainX
Link to comment
Share on other sites

If i point prograde at perigee and turn on SAS.. it will also point prograde on apogee after warp?

No, we need some special sas for it. Only if you turn off SAS and give to your ship some exactly needed amount of angular momentum it will work this way.

Link to comment
Share on other sites

I am installing this now, but I would like two clarification:

All vessels rotate during warp, not just the currently active one

Does this mean ships that are unloaded from the physics engine will rotate as well?

it will draw ElectricCharge to maintain orientation

Will it also gain ElectricCharge from solar panels and other sources?

Link to comment
Share on other sites

I have some problems with it. Especially "Veronica", other things sometimes broke too but most time more or less correct, this is save restored from backup, previous time "root" was little wierd too. Very possible it's just me, I have lot of mods. Maybe KJR or DamnedRobotics is broke it. Also some clues what this mod about.

Do not pay attention to music, it's just my player at background, and its a bit cropped.

Edited by zzz
Link to comment
Share on other sites

No, we need some special sas for it. Only if you turn off SAS and give to your ship some exactly needed amount of angular momentum it will work this way.

yeah, i see...

also your craft's look amazing! what mods ur using for them? Or maybe post some craft files in the exchange?

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...