Jump to content

SASed Warp [v2.4.0 for KSP2 v0.2.1]


Recommended Posts

Lincence: The Unlicense
Source: https://github.com/SunSerega/KSP2-SASed-Warp
Spacedock download: https://spacedock.info/mod/3538/SASed Warp
Technical discussion: https://discord.com/channels/1078696971088433153/1191869232766537758

This mod allows my absurd ion probe to spirale in and out of low orbits, by rotating the craft during warp towards prograde/retrograde/etc.

Demonstration:

In this video:
1. I turn on SASed Warp in tray.
2. Demonstrate you can choose any SAS direction during warp.
3. Start to spirale out of LJO. You can look at "Micro Engineer" or pinned AP and PE in map view dancing mesmerizingly... And slowly increasing too.
4. Then I teleport to highest possible Jool orbit. There, the numbers are big - and so is the precision loss. So it's a perfect place to trigger the "Delta error" bug.
5. After Alt+C (mod log) finished lagging out my game - you can see "Debug: SASed Warp" message. Basically, my mod prevented "Delta error" bug and logged the delta errors in question.

My "Delta error" bug report and explanation: 

And here is the main bug I made this mod for: 

Idk conventions of this forum, is it ok to necropost on that bug thread, linking here, so people have another way of finding this mod as solution?

Edited by Sun_Serega
Update demonstration and explanation to mod version 2.2
Link to comment
Share on other sites

9 hours ago, Sun_Serega said:

is it ok to necropost on that bug thread, linking here, so people have another way of finding this mod as solution?

Yes, that is allowed.  There are no formal rules on necroposting on the KSP Forums, although it's discouraged unless you are adding something useful to the dead thread.  In this case, you would be adding useful information.

Your mod post is missing license information in the post.  You can review mod posting guidelines here: 

 

Regarding license information, the license must be visible in 3 locations:

  • License type must be identified on the forum post of the mod (your above post)
  • Full text of license must be available on the service hosting the download files
  • License type must be clearly identified on the webpage where the download files are located (GitHub..)

Please review our Add-On Posting Rules (linked above), and add license information to your mod release post as soon as you can.

Link to comment
Share on other sites

Posted (edited)
1 hour ago, Falki said:

Did you solve thrust vector changing as well?

Do you mean the fact that thrust direction is copied when warp starts and the rest of warp is "on-rails"?

Kinda. I found that calling function that precomputes warp+thrust trajectory on every single update is acceptable: usually ~0.8ms for each  call, regardless of warp lvl or situation.
Ofc, this is not a long-term solution, as this just throws planned optimizations out of the window. But this is a bug-fixing mod, it only has to somehow work. As much as it pains me to write something like this, I want my ion probe to work dammit.

That said, that same function (VesselComponent.HandleOrbitalPhysicsUnderThrustStart) has another nasty bug, where in certain cases you case see a message in Alt+C:
 

Quote

[Error : Untty Log] [Flight] Delta error between petched orbit and NBody orbit too large. Cancelling Thrust under TimeWarp.


Basically, calculations become too inaccurate (or maybe someone forgot a minus somewhere?), causing the whole thrust under warp thing to turn off.
But trust itself doesn't turn off, so fuel keeps draining as if engines are on, without changing the orbit.
For now, I made it so with this mod the throttle goes to 0 and shows an alert in the top left corner when this happens.
(but only when you turn SASed Warp icon on in tray, otherwise it doesn't run any code)

Alas, the ion probe mentioned in the post header is still stuck because of this "Delta error" bug.
I was only able to move from low Kerbin orbit to a beautifuly-uninclined Tylo-level Jool encounter.
So I might be trying to fix that too in close future... Will probably append to this mod, because it's all needed together anyway.

P.S. Does bugreport of "Delta error" thing exists already? Haven't tried searching, but I have a save (multiple actually) where it reproduces frustratingly consistently, regardless of what I try to do to get rid of it...

Edited by Sun_Serega
Link to comment
Share on other sites

1 hour ago, 18Watt said:

Your mod post is missing license information in the post.  You can review mod posting guidelines here

Fixed. Idk how I completely skipped the rules when making first post, I usually don't...

Link to comment
Share on other sites

1 minute ago, Sun_Serega said:

Fixed. Idk how I completely skipped the rules when making first post, I usually don't...

It's all good, and thank you for responding so quickly!

Also, welcome to the KSP forums!

Link to comment
Share on other sites

Hello. I downloaded the Mod through CKAN and for me its not working.

I am in Warp and click for example on retrograde. then i open the menu bar and click on SASed-warp but nothing happens. the vessel is not turning towards retrograde while in warp

Link to comment
Share on other sites

Posted (edited)

Do you have thrust on? The main code doesn't run otherwise.
(this should probably be configurable, but I didn't make any real UI yet)

Also please describe your use case, especially if it's not thrust under warp.
But even if it is, in general I'm interested because so far I only made this mod for my specific situation, but I'd like to make it useful in more cases.

P.S. Ah, the demonstration is a bit outdated then... I recorded it during testing, before I even discovered that thrust direction during warp is stored separately...
P.P.S. Nevermind, thrust is on in the demonstration video. Even tho there are no engines, it should still work in the current (1.1) version of them mod. But I might fix that later, so it only activates when there is actual engine thrust.

Edited by Sun_Serega
Link to comment
Share on other sites

  • 2 weeks later...

I really like the idea of this mod and it should be a feature in the base game honestly, great work! I did encounter some strange behaviour though. Whenever I try to use SASed warp with my ship it starts spinning violently while under warp. I have only seen that with this ship, not with others. See the video.

 

Oh and I didn't manage to reproduce this for the video, but sometimes it will randomly explode after exiting SASed warp. :D

Edited by Rezania
Link to comment
Share on other sites

It's wierder when it doesn't spin. Because that's not a bug but a feature, see demonstration video above. (didn't find how to make it work without the spin)

About explosions after warp... I had them before I made this mod, so it's probably unrelated. Well, the main problem with that is reproduction - this bug always disappears after the reload, so I can't even test possible solutions. But it seems like a good old kraken attack on joints.

Link to comment
Share on other sites

Ah okay, I thought your craft was just spinning to show that it could continue to spin. Then weird that it wasn't spinning for me, wonder what happened.

As for the explosion, I haven't had that occur after warping without SASed warp active. Maybe because before I didn't warp under thrust. If it goes away after reloading, it might have to do with the dislocation bug. Just a guess.

Link to comment
Share on other sites

  • 1 month later...

Updated the mod to version 2.1

Made things a bit more intuitive and uniform.
Now SAS during warp also works with no thrust or if the "maneuver" direction is selected.

Also updated the demonstration video and added an explanation to it in the first post.

Edited by Sun_Serega
Link to comment
Share on other sites

Finally found a clue to why I had to use `vessel.transform.left` (with the violent spin) instead of a more meaningful `vessel.transform.forward`.
Turns out `vessel.transform` doesn't take into account control part direction (like command pod), and defaults to spaceplane orientation. So even if you build a rocked in VAB - this "forward" is still pointing to the side. And the "left" I was using - when in VAB it's somehow pointing up.

Found that `vessel.ControlTransform.forward` works, and doesn't require the "spin-stabilization", but it's still junky if the control part was rotated in any way. Need to test more before I make a release with this.

Also, while testing things for this found that warping while landed with this mod turned on in tray breaks the game, basically deleting all trajectory info.

Link to comment
Share on other sites

So, does this mod make them violently spin while warping at the moment or not? Because this seems like a wonderful addition but IDK if I want to spin violently

Link to comment
Share on other sites

Updated the mod to version 2.2

Fixed the junky-ness. Spin-stabilization is no longer needed. In other words, @Coin, it wouldn't spin violently anymore.

Also, this mod now works if you set speed mode to `Surface` or `Target`.

Link to comment
Share on other sites

On 3/6/2024 at 8:34 AM, Sun_Serega said:

Updated the mod to version 2.2

Fixed the junky-ness. Spin-stabilization is no longer needed. In other words, @Coin, it wouldn't spin violently anymore.

Also, this mod now works if you set speed mode to `Surface` or `Target`.

Niiiiice, top 5 KSP2 mod now! Seriously!

Link to comment
Share on other sites

Release v2.2.2

There were problems with publishing the changelog to the forum and Discord. I think I definitely for sure figured out everything, so time to shoot myself in the foot with live testing for the second (third?) time...

This one goes out to all the car emoji haters!

Download on SpaceDock

Link to comment
Share on other sites

Posted (edited)

Release v2.3.0

The fix to the thrust-on-rails will be a part of the "Community Fixes" mod, starting with v0.13
This version turns off the fix in this mod, but only if you have the right version of "Community Fixes", to avoid incompatibility.

Edited by Sun_Serega
the line break
Link to comment
Share on other sites

Posted (edited)

Release v2.4.0

Made the state of SAS during Warp persistent over game restarts.
Should've done so with 2.2, because junky-ness was the only reason I didn't want this to be persistent, but I forgor.

Edited by Sun_Serega
Link to comment
Share on other sites

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