Ezriilc

[1.9] HyperEdit [v1.5.8, July 10, 2018] - Cheat, Teleporter, Orbit/Planet Editor, & More

Recommended Posts

22 hours ago, linuxgurugamer said:

why not give the option to the user to use the controlling part as the reference, and to specify if it is a plane or a rocket?  Right now, it's a problem if you want to warp a really big ship to (for example) Eve to test it launching, if it arrives upside down it is almost impossible to rotate.

Hmm. I implemented something in the dev version, it will be included in the next release - when teleporting with the lander, orientation is preserved. That is, whatever was up (relative to the planet you're currently over) will still be up after you click "land", no matter where you teleport to.

I'll likely also add some absolute orientation buttons by the time it releases (buttons such that vessel up is up, vessel forwards is up, etc.).

Share this post


Link to post
Share on other sites
49 minutes ago, khyperia said:

Hmm. I implemented something in the dev version, it will be included in the next release - when teleporting with the lander, orientation is preserved. That is, whatever was up (relative to the planet you're currently over) will still be up after you click "land", no matter where you teleport to.

I'll likely also add some absolute orientation buttons by the time it releases (buttons such that vessel up is up, vessel forwards is up, etc.).

Oh, that's great, sounds like exactly what I want when I use HyperEdit.

If that code is done, can you send it to me so I can include it in KRASH?

 

Thanks

Share this post


Link to post
Share on other sites
1 hour ago, linuxgurugamer said:

Oh, that's great, sounds like exactly what I want when I use HyperEdit.

If that code is done, can you send it to me so I can include it in KRASH?

 

Thanks

Yeah, I just pushed. Also includes the button for "vessel up is up". https://github.com/Ezriilc/HyperEdit/blob/2c392d8481f6b4734f8f614533d76620e0ba4aed/Model/Lander.cs#L392

Relevant code (extracted) is:

var oldUp = vessel.orbit.pos.xzy.normalized; // can also be vessel.vesselTransform.position, I think
var newUp = teleportPosition.xzy.normalized; // teleportPosition is the orbitspace location (note the .xzy)
var rotation = Quaternion.FromToRotation(oldUp, newUp)*vessel.vesselTransform.rotation;
vessel.SetRotation(rotation);

 

Share this post


Link to post
Share on other sites
2 minutes ago, khyperia said:

Yeah, I just pushed. Also includes the button for "vessel up is up". https://github.com/Ezriilc/HyperEdit/blob/2c392d8481f6b4734f8f614533d76620e0ba4aed/Model/Lander.cs#L392

Relevant code (extracted) is:


var oldUp = vessel.orbit.pos.xzy.normalized; // can also be vessel.vesselTransform.position, I think
var newUp = teleportPosition.xzy.normalized; // teleportPosition is the orbitspace location (note the .xzy)
var rotation = Quaternion.FromToRotation(oldUp, newUp)*vessel.vesselTransform.rotation;
vessel.SetRotation(rotation);

 


Great, thanks

Share this post


Link to post
Share on other sites
1 hour ago, khyperia said:

Yeah, I just pushed. Also includes the button for "vessel up is up". https://github.com/Ezriilc/HyperEdit/blob/2c392d8481f6b4734f8f614533d76620e0ba4aed/Model/Lander.cs#L392

Relevant code (extracted) is:


var oldUp = vessel.orbit.pos.xzy.normalized; // can also be vessel.vesselTransform.position, I think
var newUp = teleportPosition.xzy.normalized; // teleportPosition is the orbitspace location (note the .xzy)
var rotation = Quaternion.FromToRotation(oldUp, newUp)*vessel.vesselTransform.rotation;
vessel.SetRotation(rotation);

 

Got the code in place and tested.

For KRASH, 95% good. 

When the teleport is done, the ship is not quite pointing vertical.  In all cases (many spots around the planet, tried different planets as well), the ship is slightly off vertical.  It is about 5 degrees off.

 

Share this post


Link to post
Share on other sites
On 3/11/2016 at 1:52 PM, linuxgurugamer said:

Got the code in place and tested.

For KRASH, 95% good. 

When the teleport is done, the ship is not quite pointing vertical.  In all cases (many spots around the planet, tried different planets as well), the ship is slightly off vertical.  It is about 5 degrees off.

 

Sadly, for some reason, when I was testing, i saw that in all cases, it is now pointing about 50 degrees away from vertical.  I've made other changes, but nothing to this code.

Just so you know what I'm doing, when a sim is first launched, it first goes to the launchpad (or runway).  Then, after physics has stabilized ( and then another cycle through DrawGUI for safety), I call the landed code.

If you could get me a compiled copy of what's up in github, I could test it against my code and see whats wrong.

Thx

Share this post


Link to post
Share on other sites
7 hours ago, linuxgurugamer said:

Sadly, for some reason, when I was testing, i saw that in all cases, it is now pointing about 50 degrees away from vertical.  I've made other changes, but nothing to this code.

Just so you know what I'm doing, when a sim is first launched, it first goes to the launchpad (or runway).  Then, after physics has stabilized ( and then another cycle through DrawGUI for safety), I call the landed code.

If you could get me a compiled copy of what's up in github, I could test it against my code and see whats wrong.

Thx

There's been a prebuilt version for a while now, available on http://www.kerbaltek.com/hyperedit the Beta2.dll

You're also free to clone and build it yourself, I tried to make it as easy as possible to build.

Edited by khyperia

Share this post


Link to post
Share on other sites

Long story but me and a space probe were messing around and kinda got carried away. Literally. Purposely easily misinterpreted phrasing aside, here's what the heck went down. Okay, I swear I'll stop now. Anyway,  I set my velocity to probably a few hundred times the speed of light and then decided to reverse once I was at around  8900T on the altimeter relative to the sun/kerbol. Then I time warped and next thing I know, everything's gone and the navball is black. I reloaded to launch and because of my careless time warping, it was over 44 days later. Navball is black and the planets are gone. Gonna reload and see what happens. I've put lots of time into that save and don't want it to go away!

 

Edit: I quit and reopened the game and everything's fine

Share this post


Link to post
Share on other sites

Backups are very useful

There are several mods which do automated backups.  I use S.A.V.E;  Automated Screenshots&Saves also does this.

 

Share this post


Link to post
Share on other sites
On 3/12/2016 at 8:50 AM, khyperia said:

There's been a prebuilt version for a while now, available on http://www.kerbaltek.com/hyperedit the Beta2.dll

You're also free to clone and build it yourself, I tried to make it as easy as possible to build.


I am hoping you can help me with this:

In the FixedUpdate code of the DoLander class, I have been having the problem of teleporting and sometimes being teleported below the surface, resulting in an explosion.

 

My example is:

Teleport to landing on Eve
Latitude:   6.6
Longitude: -48.5

The code:

var pqs = Body.pqsController;
var alt = pqs.GetSurfaceHeight(
                    QuaternionD.AngleAxis(Longitude, Vector3d.down) *
                    QuaternionD.AngleAxis(Latitude, Vector3d.forward) * Vector3d.right) -
                    pqs.radius;

returns an altitude of: 4791.78949197463

and then I'm adding a value to it.

If I add enough to the calculated altitude, it does appear properly, and when it lands, it shows that the calculated altitude not correct, but is at 4893.  So it appears that the GetSurfaceHeight is not correct.

This particular position is on a 30-40 degree slope, but I've seen similar when teleporting to other flatter areas.

Any ideas?

 

Thanks

 

 

Share this post


Link to post
Share on other sites
On 3/16/2016 at 9:23 AM, linuxgurugamer said:


I am hoping you can help me with this:

In the FixedUpdate code of the DoLander class, I have been having the problem of teleporting and sometimes being teleported below the surface, resulting in an explosion.

 

My example is:

Teleport to landing on Eve
Latitude:   6.6
Longitude: -48.5

The code:


var pqs = Body.pqsController;
var alt = pqs.GetSurfaceHeight(
                    QuaternionD.AngleAxis(Longitude, Vector3d.down) *
                    QuaternionD.AngleAxis(Latitude, Vector3d.forward) * Vector3d.right) -
                    pqs.radius;

returns an altitude of: 4791.78949197463

and then I'm adding a value to it.

If I add enough to the calculated altitude, it does appear properly, and when it lands, it shows that the calculated altitude not correct, but is at 4893.  So it appears that the GetSurfaceHeight is not correct.

This particular position is on a 30-40 degree slope, but I've seen similar when teleporting to other flatter areas.

Any ideas?

 

Thanks

 

 

I believe this is due to a longstanding bug in the lander, where after teleporting, some frame of reference is incorrect and KSP's velocity calculation is off. I think that the velocity of the ship is calculated in an orbital reference frame, whereas the surface is in the surface reference frame. An interesting case is that the navball states a surface velocity of near-zero, but quite clearly there's a movement >50m/s over the ground. That reference frame mismatch causes rapid translation of the vessel over longitude in unpredictable but consistent ways before OrbitPhysicsManager.HoldVesselUnpack times out and "normal" physics kicks in - in this case, going straight into the side of a hill. This is why the PQS GetSurfaceHeight is "incorrect" - you're not actually at that lat/lon anymore due to the translation.

I've attempted to fix this multiple times in the past and have never been able to find the source of the mismatch.

Share this post


Link to post
Share on other sites
4 hours ago, khyperia said:

I believe this is due to a longstanding bug in the lander, where after teleporting, some frame of reference is incorrect and KSP's velocity calculation is off. I think that the velocity of the ship is calculated in an orbital reference frame, whereas the surface is in the surface reference frame. An interesting case is that the navball states a surface velocity of near-zero, but quite clearly there's a movement >50m/s over the ground. That reference frame mismatch causes rapid translation of the vessel over longitude in unpredictable but consistent ways before OrbitPhysicsManager.HoldVesselUnpack times out and "normal" physics kicks in - in this case, going straight into the side of a hill. This is why the PQS GetSurfaceHeight is "incorrect" - you're not actually at that lat/lon anymore due to the translation.

I've attempted to fix this multiple times in the past and have never been able to find the source of the mismatch.

 

Ah, ok.  I understand, thanks.  I'll just tell people to either teleport high, or to go to flat areas.

LGG

Share this post


Link to post
Share on other sites

Is it possible to add the option to 'maintain current velocity'? I feel it'd be useful to have for filming shots of planes that really can't fly, but look cool

Share this post


Link to post
Share on other sites
34 minutes ago, MrMeeb said:

Is it possible to add the option to 'maintain current velocity'? I feel it'd be useful to have for filming shots of planes that really can't fly, but look cool

"Can't fly" is there such a thing in KSP my friend? ;)

One trick I've seen is hack gravity and fly on the engines. Hookswords made a few videos that way I believe.

Share this post


Link to post
Share on other sites
Just now, V8jester said:

"Can't fly" is there such a thing in KSP my friend? ;)

One trick I've seen is hack gravity and fly on the engines. Hookswords made a few videos that way I believe.

Well, it has to really fly in order to make filming easy ;)

Oooooh, that's an idea. Thanks!

Share this post


Link to post
Share on other sites

I'm going to test if this works in the 1.1 beta. Hope it does.

Edit: Looks like it doesn't. Well, it doesn't crash the game so it isn't too bad.

Edited by teag2

Share this post


Link to post
Share on other sites
17 hours ago, Darkstar616 said:

requesting update to 1.1 pre-release

Working on that right now, actually.  Watch this space.

It's out now!  http://www.kerbaltek.com/hyperedit  (See "Experimentals" at the bottom of that page.)

Edited by Ezriilc

Share this post


Link to post
Share on other sites
3 hours ago, Ezriilc said:

Working on that right now, actually.  Watch this space.

Really want it. :D This is one of the must have mods for KSP.

Share this post


Link to post
Share on other sites
1 hour ago, davidy12 said:

Really want it. :D This is one of the must have mods for KSP.

It's ready!  Please try it and tell me it works.  :cool:

HyperEdit BETA for KSP 1.1 is available now at:

www.Kerbaltek.com/hyperedit  (See "Experimentals" at the bottom of that page.)

Share this post


Link to post
Share on other sites
1 hour ago, Ezriilc said:

It's ready!  Please try it and tell me it works.  :cool:

HyperEdit BETA for KSP 1.1 is available now at:

www.Kerbaltek.com/hyperedit  (See "Experimentals" at the bottom of that page.)

Just did a couple of simple jumps into orbit and things seem to be working as expected.  Tried a couple small craft and one large station (which was all bent out of shape under gravity when on the ground, but it sorted itself out once hyped to orbit).  Nice one @Ezriilc, thanks for getting it updated and so quickly! Appreciated! This is going to make stress-testing 1.1 a lot easier. 

I did have one really weird thing happen, but I'm not sure if that was to do with hyperedit or the new heat shield. need to investigate further. 

Share this post


Link to post
Share on other sites
2 minutes ago, katateochi said:

Just did a couple of simple jumps into orbit and things seem to be working as expected.  Tried a couple small craft and one large station (which was all bent out of shape under gravity when on the ground, but it sorted itself out once hyped to orbit).  Nice one @Ezriilc, thanks for getting it updated and so quickly! Appreciated! This is going to make stress-testing 1.1 a lot easier. 

I did have one really weird thing happen, but I'm not sure if that was to do with hyperedit or the new heat shield. need to investigate further. 

You're very welcome of course, but please direct all thanks to khyperia - our staff coder and the creator of HyperEdit.

Also, thanks for the report!  :)  It helps a lot.

Share this post


Link to post
Share on other sites

seems to be working as expected lots of sat orbits /probe drops, nothing to report! great job all involved.

Share this post


Link to post
Share on other sites
3 hours ago, katateochi said:

I did have one really weird thing happen, but I'm not sure if that was to do with hyperedit or the new heat shield. need to investigate further

I've investigated further, it was nothing to do with hyperedit, happens in a fresh stock install. So far not had any HE related issues in 1.1

Share this post


Link to post
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.