Jump to content

[1.12.x] Contract Pack: K-Planes 0.3.0 - Start/Early contracts alpha state (17th Dec 2022)


610yesnolovely

Recommended Posts

Quote

NOTE: Only just started so it's only the first flight contract. It's basically GAP milestones but planet and tech tree agnostic.  It may be extended out to stratospheric, sub-orbital, and orbital space planes and SSTO development, if I have time/motivation before KSP2 ships.  I'm currently playing KSRSS and Skyhawk Science System, so I have vested interest in making something.

Since it's in-dev, it's not yet on CKAN, but will be. I'd expect the GAP-like milestone contracts to appear quickly as-is, but these may be modified later. As noted, you could install it alongside GAP, just be aware that would mean lots of duplicated early contracts. I may or may not fix that.

Contracts1.png

Contract Pack: K-Planes

By: 610yeslovely

The K-Planes contract pack adds various contracts to encourage and reward building of planes from very early stages, through X-plane style rocket planes, to SSTO (single-stage to orbit) planes.

Origins

This mod is inspired by and indeed uses some assets, configuration from the original GAP mod, which is also a MIT license.

The original author of GAP inigma gave blanket permission to use anything and everything from GAP on the KSP Forums.

Purpose

This pack is planet pack agnostic and tech tree agnostic, but the description assumes either Stock, semi-Stock (2.5x or 2.7x scale like JNSQ or KSRSS), or Earth-scale planets (RSS/RO/RP-1). The pack can also be used alongside GAP or deriviatives and does not need them for any shared assets, though some of the early contracts are almost the same as the milestones from GAP (because they were copied and made planet agnostic).

Initially you will find contracts to build your first powered aircraft, then several contracts which increase the speed, height and/or distance that plane can travel. Bonus points are usually awarded for landing back at the KSC Runway, but you can land anywhere that is safe.

After these the real K-Plane contracts arrive: building rocket powered air-launched X-1 style aircraft, acheiving Mach 1, 2, 3, getting to the stratosphere (18km to 50km for Earth scale) for sub-orbital flights.

Later contracts are more speculative and involve reaching Mach 4, Mach 5, to space (80km), and orbital. Some contracts require SSTO (single-stage to orbit) and some let you use boosters, but still require wings (think Space Shuttle), and some involve leaving satellites or cargo in space.

Far future contracts might include taking certain tonnage to other moons or planets and returning the craft and landing back at Kerbin/Earth.

Installation

I highly recommend installing mods using CKAN as it will correctly add required dependencies, however for those who like a more tedious life you can manually install them and possibly get less of my attention if there are issues.

Required Dependencies:

Recommended Part Dependencies:

Recommended Helper Dependencies:

Recommended IVA Dependencies, to fly inside the plane:

How Scaling Works

Speeds

Speeds are measured in m/s and are always the same for any planet. Roughly speaking Mach numbers are multiples of 343 m/s, though the actual Mach number will vary depending on pressure, temperature and altitude. However, since speed records are usually constrained by altitude, which do scale, non-stock scale planets will be harder due to the altitude requirements.

Correctly limiting to an actual Mach number is pretty complicated, in the future this may change.

Altitudes

Altitudes are scaled by the planets FlyingHigh, SpaceLow and SpaceHigh altitudes as follows:

  • TroposphereLow : ~15% from sea level to FlyingHigh.
  • TroposphereHigh : ~30% from sea level to FlyingHigh.
  • StratosphereLow : ~40% from sea level to FlyingHigh.
  • StratosphereHigh : ~70% from sea level to FlyingHigh.
  • MesosphereLow : always equals FlyingHigh.
  • MesosphereHigh : ~20% from FlyingHigh to SpaceLow.
  • ThermosphereLow : ~40% from FlyingHigh to SpaceLow.
  • SpaceLow : is where space starts in KSP.
  • SpaceLEO : is roughly how high ISS travels, or about 12% from SpaceLow to SpaceHigh.
  • SpaceMEO : always equals SpaceHigh, which in KSP seems to mean MKO / MEO (Mid-Kerbin or Mid-Earth Orbit).

The computations are algorithms which will work for any planet scale, but here are examples for common scales.

For Stock (1x):

  • TroposphereLow: 3 km
  • TroposphereHigh: 5 km
  • StratosphereLow: 7 km
  • StratosphereHigh: 13 km
  • MesosphereLow, FlyingHigh : 18 km
  • MesosphereHigh: 30 km
  • ThermosphereLow: 40 km
  • SpaceLow : 70 km
  • SpaceLEO : 90 km
  • SpaceMEO : 250 km

For KSRSS, JSNQ (2.7x), the atmosphere is usually very similar to stock scale, though SpaceLow is usually 10km higher. Therefore only slightly harder for Modern / Future contracts.

  • TroposphereLow: 3 km
  • TroposphereHigh: 5 km
  • StratosphereLow: 7 km
  • StratosphereHigh: 13 km
  • MesosphereLow, FlyingHigh : 18 km
  • MesosphereHigh: 30 km
  • ThermosphereLow: 40 km
  • SpaceLow : 80 km

For RSS (Earth), the atmosphere is much thicker, so much higher altitudes are needed. Hard mode!

  • TroposphereLow: 5 km
  • TroposphereHigh: 10 km
  • StratosphereLow: 20 km
  • StratosphereHigh: 45 km
  • MesosphereLow, FlyingHigh : 50 km
  • MesosphereHigh: 70 m
  • ThermosphereLow: 85 km
  • SpaceLow : 140 km

Distances

Distance contracts are scaled by the planets circumference, again using algorithms that work for any scale. Below are examples for common scales.

For Stock (1x):

  • Shop Hop : 50 km
  • Domestic : 100 km
  • Continental : 250 km
  • Intercontinental : 750 km
  • Polar : ~1,885 km
  • Equatorial : ~3,770 km

For KSRSS, JSNQ (2.7x), over twice as far, not that much harder.

  • Shop Hop : 130 km
  • Domestic : 250 km
  • Continental : 700 km
  • Intercontinental : 2,000 km
  • Polar : ~5,000 km
  • Equatorial : ~10,0000 km

For RSS (Earth), distances are ten times stock scale, so this is Hard Mode!

  • Shop Hop : 530 km
  • Domestic : 1,000 km
  • Continental : 2,700 km
  • Intercontinental : 8,000 km
  • Polar : ~20,000 km
  • Equatorial : ~40,000 km

Changes

0.3.0 Release - Start and Early contracts second pass (17th Dec 2022)

  • Fixed distance contracts, now seem to work better.
  • Added Polar, Circum-Polar and Round The World distances.
  • Some testing, but still not recommended for general gameplay.

0.2.0 Release - Start and most Early contracts (17th Dec 2022)

  • Most of the GAP milestone contracts now present.
  • Progression should work, and everything should scale to homeworld scale.
  • Only slightly tested, so probably still not recommended for general gameplay.

0.1.0 Release - Start contracts (1st Dec 2022)

  • Not really functional, but general idea started.

License

All content is MIT licensed.

  • KASA logo derived from NASA svg downloaded from Wikipedia
  • KACA logo dervied from NACA svg downloaded from Wikipedia

Source

Source is available on GitHub.

KSP Forum is the home page for discussions.

Edited by 610yesnolovely
Link to comment
Share on other sites

Progress so far:

  • Rewards scaling based on planet scale
  • Goal heights, speeds, distances likewise based on scales
  • Descriptions, titles, etc have things like "at least 12.00km (Stratosphere Low)" where the values scale depending on the planet scaling
  • Contracts are generated from a table, so I can balance/add/remove easily
  • Partially localized

There's still only two semi-working contracts, the others currently won't work, so don't try to use head of GitHub right now. However I'd think it won't take too long to get all the milestone contracts from GAP ported. They will likely have slightly different targets, but should be enough for a pre-release that's interesting.

I also had a think and learned a bit more about Contract Configurator, hopefully I can work out how to do distance contracts (waypoints), and dual engine SSTO designs (resource consumption limited by speed and/or altitude). Payloads might be trickier, but CC allows code extensions.

Link to comment
Share on other sites

3 hours ago, Caerfinon said:

If you need any advice feel free to ask, Always good to see more  aircraft focused mods. Well done you. 

Thanks for all your great plane mods.

I'm making K-Planes mainly because I miss GAP and Kerbinside, but I thought rather than replicate them exactly I'd cover building X-Plane and SSTOs - I've not seen a contract pack that really does that. It'll also be agnostic to planets and try to model atmosphere layers and Mach speeds as goals.

As for help, there may be some tricky bits. I'm going to try to get the contracts to work without adding code as follows:

  • Alt and Speed is already easy as GAP does it, parameters with exceeding and duration at speed/alt or both.
  • Distance will be done by using the CC waypoint generator - min/max distance random points at half the goal distance - the player will have to return to near the KSC (or land on runway for bonus). The waypoint will give the player a solid goal, rather than having to figure out distances and need a mod.
  • Heli/VTOL/Seaplane taken from GAP. I'll add Jet and Rocket VTOL variants by disallowing/requiring certain parts/fuels as in GAP.
  • Unlike GAP, the speed/height/distance will allow rocket engines for the first version, and let versions will exist that disallow it. The X-1 was rocket powered, but later on they worked out how to build jets, so there will be a Mach 1 and a Mach 1 Jet contract later on.

Now comes the trickier bits:

  •  For most contracts I will disallow any staging/decoupling with NoStaging parameter in CC.
    • However for payload contracts I think a Not containing a NoStaging with a limit of one time, probably at a certain altitude and/or after reaching space.
    • A Behaviour that triggers on say reaching space would record vessel mass, and the Not NoStaging (hahah lame) would deduce the payload mass from vessel mass.
    • I suspect however that Not NoStaging parameter would fail immediately, so if that doesn't work, I'd code up an extension to do basically that (I'm a coder, so wouldn't be too tricky, I had a look at other mods that do this, RP-1 for example).
  • If I get payloads working, a more complex option would be to allow "air launch" - a single staging (with restrictions) where a secondary vessel is undocked which must then be validated as having wings, control surfaces, jets, no-oxidizer/no-srbs and both have to land safely. Likely there would be a specific "Air Launch" contract just before Mach 1 where the goal is to do this successfully, and then after that it's an option (but not a requirement).
  • For SSTOs, its similar to GAP restrictions but with a twist: SRBs are disallowed, but rockets or dual mode engines requiring oxidizer are allowed, but can only drain resources above a certain height (high stratosphere, so 10km up for stock).
  • Shuttles: anything goes, including SRBs, rockets, decoupling, but the returning vessel must have wings and must land.
  • Parachutes are allowed on vehicles but can only be deployed after landing (not sure if I can do that).

Some how I'd like to have the mod pack provide helpful hints on how to build succesfully: certainly in the contract description, the progression of contracts also helps understand how to build something that can go fast on jets, then quickly reach the mesosphere/sub-orbital/orbital, add payloads etc. Might also provide example Stock craft that work (I'd have to build them anyway for testing). Probably also have links in the README/OP here to good videos on the subject.

This is quite lot of work, so the least I shall try to achieve is a first working release with the GAP contracts, distance, and some extra height/speed based on those.

Edited by 610yesnolovely
Link to comment
Share on other sites

Sounds like a good plan. 

6 minutes ago, 610yesnolovely said:

Some how I'd like to have the mod pack provide helpful hints on how to build succesfully

One of the things I do when I want to provide more information on how to do things is to pop a dialog box behaviour based on a completed parameter.  The content rather than being txt is just an image that I create as a sort of an info graphic showing the details I want to convey.

It's a fairly low-tech approach that CC does quite well. I find that the majority of players tend not to read the contract details and notes very closely, but putting it right in the middle of the screen seems to work. 

Link to comment
Share on other sites

6 hours ago, Wilds said:

Oh this is great! I like to search every few weeks for a contract pack for planes on RSS , and you are making it! Gonna watch this thread. Good luck on finishing this awesome idea; hope you have fun!

Yes, I will be testing Stock, KSRSS Reborn and RSS - I use KSRSS Reborn personally.

Can't promise I'll finish, but I'll be using it myself, so there's some motivation to progress, though perhaps only as fast as I actually play.

The other thing to remember is KSP2 comes out early next year, so everybody will probably get distracted.

Link to comment
Share on other sites

  • 2 weeks later...

Some progress this weekend, all the Start (Wright Aeronautics) and Early (KACA) contracts are present and look okay (minimal testing), this cover most of the GAP milestones, but adds distance contacts.

The OP now describes how the planet scaling currently works. The idea is this pack works for Stock, KSRSS/JSNQ, RSS or any reasonable planet pack, however it's harder (but with more rewards) for large scale planets. Real scale/RSS will be particularly hard contracts.

There's probably still Kerbin/Kerbal specific concepts still there, and bugs, etc. Still not really recommended for adding to your normal game, as I'm not really testing doing the contracts, just making sure they look/read/unlock right.

Next up:

  • Polar, CircumPolar, Equatorial distances - for this I'd recommend a decent autopilot (Atmosphere Autopilot) and something that can up your physical warp time, and only trying this with fast high flying jets. It won't allow cheating (no going above Stratospheric heights).
  • Shuttle Contracts: stepping stone to a proper SSTO is to allow your shuttle plane (which must have wings) to have SRBs that are discarded, and discardable fuel tanks. So this would allow Space Shuttles, but not traditional rockets.
  • SSTO Contracts: derived from the shuttles, except you can't discard SRBs or fuel tanks.
  • Payload Contracts: leaving something in space in orbit and returning. I _think_ I can do this by requiring a vessel left in orbit that only contains parts from the launch vessel, and the landing vessel is what's left. The payload mass is likely possible by vessel mass before/after deploying the payload. If I can't get this easily in .cfg files, I'll write some code to do it.

Lots of testing remain:

  • Actually testing testing with just vanilla KSP.
  • Testing with modded KSP: KSRSS, *all the plane mods everrr*, BDB, Mk2/3 Expansion, OPT Spaceplane and a reasonable Probes-Before-Crew style tech tree (Skyhawk Science System).
    • Likely I'd spend the most time here, as this is my current playthru set up.
  • Testing a little bit with RSS scale planet (to make sure the numbers work only).

Contracts1.png?raw=true

Edited by 610yesnolovely
Link to comment
Share on other sites

All the Start and Early contracts are present, and distance contracts now work (they were borked). I'm still learning how to do contracts obviously :-)

0.3.0 Release - Start and Early contracts second pass (17th Dec 2022)

  • Fixed distance contracts, now seem to work better.
  • Added Polar, Circum-Polar and Round The World distances.
  • Some testing, but still not recommended for general gameplay.
Link to comment
Share on other sites

  • 3 weeks later...

Play testing continues, though I'm taking it far too seriously... :D. I've decided to also add some parachute and ejection progression contracts, safety is important.

I'll likely include the following craft in the pack, though they require a lot of mods. I may also build some stock only mods and make a video on how to build aircraft to go along with the mod. Long term ideas, may or may not happen (and probably not soon).

screenshot39.png?width=1867&height=1050

screenshot46.png?width=1867&height=1050screenshot61.png?width=1867&height=1050

screenshot66.png?width=1867&height=1050

screenshot71.png?width=1867&height=1050

Bill ejects from test plane without knowing how to parachute...

screenshot73.png?width=1867&height=1050

Fortunately Bill is an expert high diver, but is a bit miffed he has to swim all the way home. Which gives me an idea for another contract: jump out of plane without parachute and survive.

Edited by 610yesnolovely
Link to comment
Share on other sites

  • 4 months later...
Just now, linuxgurugamer said:

Did you install ContractConfigurator?

Yeah, I use a few contract packs already without any problems.

edit: A KPlanes directory is created in GameData\ContractConfigurator\log\ at least. But the contract pack isn't available to toggle on or off in game settings/difficulty/contract configuration.

Edited by Wilds
Link to comment
Share on other sites

1 hour ago, Wilds said:

Yeah, I use a few contract packs already without any problems.

edit: A KPlanes directory is created in GameData\ContractConfigurator\log\ at least. But the contract pack isn't available to toggle on or off in game settings/difficulty/contract configuration.

How about a log file for analysis? (see my sig for info)

Link to comment
Share on other sites

8 hours ago, Wilds said:

Nothing popped out in the log file.

I've created a simple install, KSP 1.12.5, CC and K-Planes.

After starting a new career, I went into the settings, and I do see K-Planes in the Contract Groups.

And, after doing an initial orbital mission, I did see 1 contract from K-Planes.

I'd suggest you start with a small install and build up from there

Link to comment
Share on other sites

Just now, linuxgurugamer said:

Nothing popped out in the log file.

I've created a simple install, KSP 1.12.5, CC and K-Planes.

After starting a new career, I went into the settings, and I do see K-Planes in the Contract Groups.

And, after doing an initial orbital mission, I did see 1 contract from K-Planes.

I'd suggest you start with a small install and build up from there

Thanks for testing and looking at my log. I also just created a new install of 1.12.3 and 1.12.5 and the K-Planes contract pack never appears in-game settings even after getting into space. Never appears in All contract view either.

I even tried doing ctrl-alt-f12 and spam finishing contracts.I am able to get GAP and PWP contract packs to load. But Kplanes never appears. I must be missing files or something. I am adding the KPlanes directory into Contract Packs.

May I please have instructions on where to put the other files? I am opening up Kplane-main and dragging the Gamedata folder into my KSP root directory. Should I be compiling something instead?

It comes with other files that I am not sure where to put. I tried the root directory, but it doesn't seem to do anything.

edit: Here is a screenshot of fresh 1.12.5 install with just CC and K-Planes. It definitely is loading the contract, but it won't appear in Mission Control -> All, or in Contract Configurator settings.

This is after I manually flew into space.

 

X9VEzl3.jpg

edit 2: Instead of clicking Code -> Download Zip, I also just tried clicking Tags - > 0.3.0 and downloading that. Still same result; not appearing.

Edited by Wilds
Link to comment
Share on other sites

Ok, got it working! This time I downloaded fresh copies of 000_ClickThroughBlocker, 000_Harmony, 001_ToolbarControl,  SpaceTuxLibrary, and WaypointManager.

I was only downloading CC, Module Manager, and other contract packs when trying to get K-Planes to work on fresh install.

I would definitely say Waypoint Manager and its dependencies are a requirement to get this mod to appear!

Even though I had all of these installed on my main install, one or more was slightly out-of-date which is not compatible with K-Planes.

 

Edited by Wilds
Link to comment
Share on other sites

On 6/2/2023 at 11:56 AM, Wilds said:

Ok, got it working! This time I downloaded fresh copies of 000_ClickThroughBlocker, 000_Harmony, 001_ToolbarControl,  SpaceTuxLibrary, and WaypointManager.

I was only downloading CC, Module Manager, and other contract packs when trying to get K-Planes to work on fresh install.

I would definitely say Waypoint Manager and its dependencies are a requirement to get this mod to appear!

Even though I had all of these installed on my main install, one or more was slightly out-of-date which is not compatible with K-Planes.

 

I've been away for a while (full time job keeps me busy). Thanks LGG for helping out in the meantime. I have no idea why WaypointManager might be needed, I checked the log, nothing obvious. It definitely makes it way easier for the distance based contracts (and for flying in general). I've added https://github.com/harveyt/KPlanes/issues/1

I happily surprised people are trying this out, though it's "Alpha", it's probably more "Beta" now. It is essentially a cut down version of GAP, with some distance contracts, but for scaled planets (I use KSRSS), so it is a niche but handy mod for some RSS/KSRSS (non-RP) players. I use this personally with 230+ mods, so I'm somewhat invested in making sure it works.

Eventually, when I have time, I'll do some later shuttle/SSTO contracts: doing it via pure CC / MM turned out to be almost impossible, so I'd have to build custom CC logic (not hard). Again, likely this will be when I get time to play KSP and progress to that point and realize I need such contracts.

Edited by 610yesnolovely
Link to comment
Share on other sites

  • 2 weeks later...

I'm really liking it on RSS. The round-trips feel satisfying and reaching mach 3 at 7km is proving difficult with the limited research on my save.  Definitely interested in shuttle contracts! I assumed they were part of the History of Spaceflight contract packs, but I don't see em.

SSTO on RSS is a fun challenge with stock parts. It is a good incentive for me to keep researching plane stuff in late-game career.

Link to comment
Share on other sites

Glad you're enjoying it! I've done most of my testing on Stock and KSRSS 2.7x, I'd imagine RSS is very hard for speed for sure. RO/RP-1 is definitely hard mode.

I've not been playing much KSP recently, but I'm feeling like dusting off and updating KSRSS 2.7x scale career,  and so K-Planes (and Reviva, Wacapella) may receive updates over the coming months (years?).

As yet K-Planes has no shuttle or SSTO contracts. History of Spaceflight only goes to Apollo, no shuttle contracts there unfortunately. However that's why I'm doing K-Planes, to cover from X-1 through Shuttle, SpaceX and things like Near/Far future SSTO (think Opt Spaceplanes). Though it's purposefully not historical, but goal oriented and will try not to limit solutions to particular mods.

Link to comment
Share on other sites

  • 6 months later...

For those that use this mod. I'm still around, and back playing KSP recently. I use this mod myself with KSRSS Reborn, and it works quite well as-is.

I still intend to develop the mod further, but that's likely going to be demand driven by my career progress, so be very patient if you want more. :-D

Link to comment
Share on other sites

  • 5 months later...

Just wanted to say thanks for the lovely mod, GAP really helped make planes feel useful in career and making it planet independent is really useful.  Using it with JNSQ.

Link to comment
Share on other sites

Good to hear!

Unfortunately for KSP modding (and me playing, sheesh, so many cool KSP things released recently), I've moved half way round the world and my gamedev PC is in a shipping container that won't arrive till mid-September, and currently I'm using a mobile phone for broadband and have a laptop, not really up to gamedev specs or playing KSP tho :-(

Fortunately for me, where I've moved to, western highlands of Scotland, is very beautiful, quiet/remote, but not too disconnected. The sort of place one can really concentrate and get stuff done once I'm settled. Also I won't be doing paid work until Spring 2025 at the earliest ... so I'll have some time on my hands hopefully soonish.

Co-operation/patches/pull-requests welcome!

Link to comment
Share on other sites

  • 2 months later...

Quick update: it's mid-September and my gaming/dev machine has indeed arrived. KSP playing and modding will commence soon, but there's no promises on when more content will appear: I'll need to invest time in proper up-to-date KSP dev setup, since to do what I've planned will require C# Contract Configurator extensions and proper development, plus as per usual real life happens.

But I've not forgotten this mod (or Reviva or Wacapella).

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