Jump to content

[1.0.4] AirPark


Smelly

Recommended Posts

I have no way of doing the map-view trajectory the way I have the mod set up short of rewriting the entire trajectory drawing system. The quicksave issue I never ran into in initial testing, but I went back and tested it some more after reading your post and only managed to get that moving over terrain warning when the vessel had engines on and was at about a 90 degree pitch. I don't fully understand why that happens. My only guess is that it has something to do with some oscillations or rotational speed in the vessel being above a certain threshold. I'm also guessing that the issue is pretty vessel and rotation specific. My 350+ part 500 ton exercise-in-computer-melting / Stock SSTO had no issues in level flight, and the VTOL I was doing testing with I managed to quicksave by altering it just a few degrees from that 90 degree pitch or simply turning off the engines. Freezing the physics position of every part to try and get rid of that rare bug doesn't seem worth it performance wise, so I suggest making sure engines are off and try to stop it from rotating (if it is) to get past that bug. Not a comprehensive solution I know...

Record the throttle state then zero it out when airpark is engaged, and reset it when disengaged. Probably best to only do this with manual airpark as autoparked vessels won't have a live pilot to deal with thrust differences as their jet engines ramp up.

Alternately, what happens if you add a vessel.landed = false into ToggleAirPark() right before or after the setvelocity? Just to be sure the game know the vessel is definitely flying again.

Link to comment
Share on other sites

  • 1 month later...

This mod reminds me of an old Looney Tunes.

Quote

[Bugs is plummeting to the ground in a bomber plane. He's tried everything, but he cannot fly it.  Just before he crashes into a suburb, the bomber freezes mere feet above the house.  Bugs turns to the camera casually.]

BUGS: What? Forgot the air brakes!

 

Definitely using it for my Eve mission!

Edited by MatttheCzar
Link to comment
Share on other sites

I made my Eve base.  The balloon fits in a 3.75m fairing.  The science lab has a porch for observations.  The rocket below is boosted to around 7500 m/s by the balloon and then released.  The rocket then boosts the two kerbals to a 110 km orbit.  I deem it a sucsesssful mission, all thanks to AirPark!
 

Spoiler

ZCxt5Oe.png

ef4KmkY.png

a8MCbdr.png

87Cdm3a.png

xHLeaeB.png

9TMW813.png

41mTmUN.png

KkgoDk2.png

tn72wJP.png

ajGOt5v.png

FpIx2nL.png

rTTtJJH.png

irQBoKU.png

KmlhjQM.png

xJfcQbl.png

bjy3I5a.png

djYtB96.png

 

Edited by MatttheCzar
Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

Hello, great mod. 

But I have a little problem. I am using airships of hooligan labs. They work fine by their own. But When I park one of them in mid air, something weird happens. The the one I park explode when I  get close (<2km). I use the same kind of ship with the same name to close up. Sometimes craft parked explode, sometimes not. So I am not sure what really happens. Any suggestions?

Edited by Phoenix1945
Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...
  • 1 month later...
On 23.04.2016 at 2:12 AM, MatterBeam said:

I can't wait!

Does your MM patch work? Can't get those buttons to display in Mk1 cockpit's menu.

Does anyone have that increased cabin wobble after returning to a vessel and resuming a flight too? I have that with FAR installed, feels like extra drag.

Edited by Ser
Link to comment
Share on other sites

21 hours ago, Ser said:

Does your MM patch work? Can't get those buttons to display in Mk1 cockpit's menu.

Does anyone have that increased cabin wobble after returning to a vessel and resuming a flight too? I have that with FAR installed, feels like extra drag.

Just MM and AirPark on a clean 1.1.2, patch works, buttons show on pods and they work.

I have noticed no extra wobble or drag after resuming a flight, but I'm not using FAR.

Link to comment
Share on other sites

  • 3 months later...

Hey all, 

I wanted to let everyone know that I have forked this even further and done some work around improving the code with a focus on parking boats.
http://spacedock.info/mod/936/AirPark Continued

Not much has changed with regards to Airships as far as I know however, I only really test on the water.

If you have any issues feel free to hit me up on Git hub here

I am new to plugin coding for KSP and am just looking to continue and help maintain a very useful mod. All credit is given to @Smelly for creating this and I will gladly merge my changes, if he would accept them, upon his return.

Regards,

Link to comment
Share on other sites

10 hours ago, gomker said:

Hey all, 

I wanted to let everyone know that I have forked this even further and done some work around improving the code with a focus on parking boats.
http://spacedock.info/mod/936/AirPark Continued

Christ, I was preparing my github repository to release a continued version of this but you were several hours faster :)

Well, if you really going to maintain this mod then I'll go with contributions because it's always easier than to provide full support and I have plenty of stuff to do with my own ones.

10 hours ago, gomker said:

Not much has changed with regards to Airships as far as I know however, I only really test on the water.

You really should test it with airships because it had some serious issues including Kraken attacks.

Anyway, I'll give it some tests and shall either merge my work into yours or continue to silently maintain my own version as I'm not going to deal with boats ever.

P.S. Don't you want to get rid of those parts? There's a nice module manager patch that adds AirPark functionality to every pod. That has at least three advantages: 1. Reduces part count 2. Doesn't take up space on a vessel (original part was just huge) 3. You can still air-park a vessel in case you forget to attach the part to it.

Edited by Ser
Link to comment
Share on other sites

@Ser 

To clarify , the  code changes I made should benefit all designed specifically to combat Kraken attacks all around. I just did not test on Airships as 1) I don't have any built 2) not sure what scenarios to test with.  If you have any craft to share that are good test cases that would help me collaborate with you on any changes.   In the end if you feel a fork is needed, one for boats and one for Airships we can go that route however, I am open to a group effort, I would like to learn as much as I can about KSP plugin coding from the community.

As for the parts, I have no objection with using a MM patch, SpannerMonkey and I are doing that for LBP and SMMarine for my HullBreach plugin. For boats may interfere with my sinking mechanism ,so  I think we are sticking with a single part and drop the Anchor  replacing with a "control panel" like single part. I would like to give the end user the option of using either.
If you have the MM patch could you send it to me or put in Git issue so I can include it.
 

Link to comment
Share on other sites

1 hour ago, gomker said:

As for the parts, I have no objection with using a MM patch, SpannerMonkey and I are doing that for LBP and SMMarine for my HullBreach plugin. For boats may interfere with my sinking mechanism ,so  I think we are sticking with a single part and drop the Anchor  replacing with a "control panel" like single part. I would like to give the end user the option of using either.
If you have the MM patch could you send it to me or put in Git issue so I can include it.
 

The patch has been posted here just a page back by @MatterBeam. I'll repost it:

////AirPark For All Probes And Command Pods
@PART[*]:HAS[#category[Pods]]:FINAL {
MODULE
{
	name = AirPark
}
}

The downside of this is that every pod on a vessel will have its own AirPark PartModule so some extra code is needed for the case of a vessel having multiple pods on it or else they'll interfere with each other. Though, the same problem arises if two AirPark parts are attached to the same vessel.

Edited by Ser
Link to comment
Share on other sites

@gomker, @Ser, I would like to see your collaboration on this mod guys! :) Because I feel need for functionality like this. I don't know why I did not see this mod earlier... I did not test this yet, but I will ASAP :)

Suggestions:

  1. Make MET (mission elapsed time) timer freeze on parking - so you actually can see, for example, how long it will take to boost back and land first stage from the mission start and such.
  2. Option to park vessel via action groups for fast operations in-flight.
  3. About addind park functionality to all pods - I would prefer an option to integrate this with antennas since antenna part will become an absolutely must have in near future of 1.2. And because pod parts usually nave a HUGE list of actions - easy to miss-click.
Link to comment
Share on other sites

3 hours ago, ZobrAA said:
  1. Make MET (mission elapsed time) timer freeze on parking - so you actually can see, for example, how long it will take to boost back and land first stage from the mission start and such.

If the question is only "how long it will take to boost back and land" then may be it will be enough to just record the time of parking and show it in the part menu?

If you do something like SpaceX landings, doesn't FMRS mod work well for that?

3 hours ago, ZobrAA said:

Option to park vessel via action groups for fast operations in-flight.

Or a hotkey. You may also use the Part Commander mod to make things easier.

 

@gomker, I gave this some tests and I'm not happy with it, man. It doesn't work for me as intended.

 

Edited by Ser
Link to comment
Share on other sites

There are lots of situations in which Airpark would be unsuitable or dangerous to use, You cannot park a rocket in flight  Removing the velocity from an orbiting rocket simply means that you'll be returning from space a lot sooner than you thought. 

Airpark was never intended to freeze time and I don't believe it should, you have a pause button for that. 

I have used Airpark with a lot of Airships and aside from bugs that affected everything else not just airships, which have since been dealt with, I've had no problems, my main reason for originally salvaging Airpark was for use with airships,( at the time I was doing at lot of part work for the HL Airships(hooligan labs continued) ) as they take so long to get anywhere, and it is in this function that Airpark works extremely well.

Any patch that applies Airpark to all pods or a particular part  should be marked as an extra, rather than a default inclusion, even without any more module additions the ships below are pretty unmanageable without part commander.

I've  dozens of craft Airparked around KSC  especially very large ships and marine craft, and will continue to do so.

Everything in the images below is Airparked

3ejvYQf.png?1

wyNW46o.png

aIk8hH8.png

cBBA4B8.png

Link to comment
Share on other sites

@gomker, I've misread a little, so should've been speaking of airplanes, not airships.

@SpannerMonkey(smce), not sure who you've written that to. But here are my steps:

1. Create a simple aircraft with AirPark part on it. Take off. As you get airborne, toggle parking on. The aircraft keeps moving in a strange linear path.

2. Enable "Auto parking" on this plane. Quickly go to the space center while it isn't crashed. Launch another one to wake up the first one. As you get close it explodes instead of resuming its flight.

3. Launch any spacecraft capable of going out of atmosphere (straight up with "Thumper" and a pod will do). Once it gets into space, go to the Space center and launch a new aircraft. Take off. Park it. Try to switch to the vessel in space via Map view or just try to go to the Space center. Most probably you'll get "Cannot switch vessel because it is under acceleration in atmosphere".

Does anyone experience that too?

 

Edited by Ser
Link to comment
Share on other sites

1 hour ago, Ser said:

Create a simple aircraft with AirPark part on it. Take off. As you get airborne, toggle parking on. The aircraft keeps moving in a strange linear path.

As @SpannerMonkey(smce) alluded to there are going to be issues when toying with Vessels state and situation - See API Reference
We are basically forcing something the game does not want us to do, and doing so has consequences.

One of those is that "vessel creep".  The code calls the OnFixedUpdate(), which runs every frame,  to check if you have asked to park and parking the vessel during that frame. Even though a Vessel is "LANDED" it still can move, so if you engines are On, you will creep a bit forward even though you are Parked, the effect is more pronounced for very powerful engines and I suspect never manifested much with Airships. I added code (in addition to @dunclaw's) zeroing out the velocity and acceleration but it still will creep a bit.  My changes were focused around "remembering" that previous state before parking. From what I understood of the original code and the "Airships" references, I always thought this was intended to park vessels that were already somewhat static.

1 hour ago, Ser said:

Enable "Auto parking"

I renamed this to "Auto UN-park" as this was confusing. The condition (which is from the original) is "if we're less than 1.5km from the active vessel and Parked, then wake up" BUT if you are 2km out , Park = true. This logic does need some review.

2 hours ago, Ser said:

Once it gets into space

The original (at least my fork) always had a hard coded condition to not allow parking out side of Atomoshpere

            #region can't Park if we're orbiting
            if (vessel.situation == Vessel.Situations.SUB_ORBITAL || vessel.situation == Vessel.Situations.ORBITING)
            {
                autoPark = false;
                Parked = false;
            }

 

Link to comment
Share on other sites

2 hours ago, Ser said:

1. Create a simple aircraft with AirPark part on it. Take off. As you get airborne, toggle parking on. The aircraft keeps moving in a strange linear path.

Spoiler

Followed method exactly and the craft behaves exactly as you describe, in the two attempts I did notice that the craft did seem to actually not be on rails, as it should be, all that appears to be happening is that the velocity is being reduced to zero, the craft subsequently falls out of the sky. Also noticed that in this condition it is possible to roll and generally move the Aircraft, which is not the behaviour I've come to expect. traditionally the craft was locked  and considered landed, to the extent a Kerbal could EVA and walk around on a craft parked mid air.

2 hours ago, Ser said:

2. Enable "Auto parking" on this plane. Quickly go to the space center while it isn't crashed. Launch another one to wake up the first one. As you get close it explodes instead of resuming its flight.

Spoiler

This all got a bit weird,

Locking the first aircraft resulted in the slow free fall, velocity having been reduced to zero, switched to second aircraft and launched, caught up with first aircraft and  aircraft 1 switched out of park and started to fall to the ground due to having no forward velocity. By this time aircraft 2 is above 2500 mtrs and I select park on aircraft2  and the aircraft stops dead, with no movement or motion whatsoever. I switch to and recover aircraft 1 from it's dive and fly to the position and altitude of aircraft 2, within 500mtrs I hit park and aircraft 1 comes to a dead halt.  Again with no movement or motion evident, it is also locked in position moving the controls has no effect on the aircraft.

Test two goes pretty much the same, except it seems to on occasion behave exactly as you'd expect, and mild amusement was had leap frogging between aircraft as on approaching each other they would alternate the park state depending on the park state of the other craft. While approaching head on a parked aircraft1  I toggled park on aircraft2 , this time  aircraft2 reversed direction with the exhaust plume blowing back along the fuselage, so in effect flying backwards while not having any indicate speed, or on checking the aero gui any lift being generated by the apparent motion. the log is full of the following

Spoiler

[WRN 18:08:22.829] Warning ! ActiveVessel is landed and heightFromTerrain are negative (-1)
[EXC 18:08:22.858] NullReferenceException: Object reference not set to an instance of an object
    Vessel.GetUnloadedVesselMass ()
    Vessel.GetTotalMass ()
    Vessel.CalculatePhysicsStats ()
    Vessel.FixedUpdate ()

 

2 hours ago, Ser said:

3. Launch any spacecraft capable of going out of atmosphere (straight up with "Thumper" and a pod will do). Once it gets into space, go to the Space center and launch a new aircraft. Take off. Park it. Try to switch to the vessel in space via Map view or just try to go to the Space center. Most probably you'll get "Cannot switch vessel because it is under acceleration in atmosphere".

Spoiler

 think this is simply because the craft's not on rails and parked as it should be.

Edited following the previous post, that'll teach me not to leave posts half finished

Edited by SpannerMonkey(smce)
Link to comment
Share on other sites

@SpannerMonkey(smce) This is something I do not completely understand, which may be related, this is only code that references a vessel inflight

 #region if we're not Parked, and not active and flying, then go off rails
	if (!Parked & !vessel.isActiveVessel & vessel.situation == Vessel.Situations.FLYING)
            {
                vessel.GoOffRails();
            }
 #endregion

Parking currently on toggles the Vessel Situation , is there a "GoOnRails()" that should be called, and what does "GoOffRails" do exactly, have not found docs on that.

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