Whitecat106

[1.0.4] Contract Pack: Maritime Missions and Boat Navigation Plugin [V1.3.2] 14/09/2015

Recommended Posts

Maritime Missions Pack

A series of missions set at sea for a better use of Kerbin's vast oceans!

Description:

 

This contract pack currently adds 28 missions (8 repeatable), which range from SOS investigations to Deep Sea Diving, this pack is intended for use alongside Fengist's Maritime Pack.

6hwYB4i.png

Contents:

- 5x S.O.S missions where the objective is to rendezvous with a sinking ship and recover its crew. (More to come)

- 5x Space Hardware Recovery missions where the objective is to return spent boosters/ splashed crewed pods to the KSC.

- 2x Repeatable Scuttle missions, destroy a vessel in a location to build an artificial reef.

- 2x Wreck Investigation missions, visit the site of a wrecked ship. (More to come)

- 3x Diving missions to reach various depths at specific locations (More to come)

- 3x Buoy deployment missions to deploy buoys at specific locations (More to come)

- 2x Derelict investigation missions to investigate sightings of missing vessels (More to come)

- 3x Cruise missions, visit multiple destinations across Kerbin and return to the KSC for a large payout. (More to come)

Future Plans:

- Implementation of Contract Configurator's new DialogBox behavior.

- More waypoint trickery for Returning to KSC docks.

- Diving relics such as Atlantis and sunken ships.

- More of each type of mission.

- River cruises.

- Transoceanic cruises. -- Added in V1.0.2 (More to come)

- Exploration missions and Circumnavigation.

- Greater depth to the Derelict investigation story lines (Flying Dutchman, Mary Celeste, Serendipity).

- More repeatable missions.

Further ideas are welcome!

Boat Navigation Plugin

A small plugin which adds background movement of vessels in water from place to place in real time or in time warp.

Description:

 

This plugin adds navigation commands and a library of location coordinates for vessels to move to when not active, the progression from one point to another can be interrupted at anytime by switching to the navigating vessel. Furthermore it (as of 1.3.0) adds direct sea spawning options for SPH vessels.

N5xe4Hn.png

Contents:

- Ability to enter a desired Latitude, Longitude and Speed to navigate to from the vessels current position.

- Ability to select and add a new destination to a library of 25 named locations around Kerbin. (Eve and Laythe to come)

- The vessel will move in real time or in timewarp across the surface of Kerbin in the background, at intervals of 30 seconds per position update (to avoid lag).

- Ability to spawn a vessel directly into the sea! (No more complex ship carrying rovers!)

This all means that a voyage that would normally take hours of 4x physics warp can now be achieved by setting a destination and a speed, switching to do something else and returning to the vessel once it has arrived (or at various points across its journey)!

Future Plans:

- Capping of the speed input field to the max speed of a vessel (if anyone knows how I could work out the max speed from a vessels part information please let me know!)

- Optimization of Config loading code

- Active vessel navigation (currently only SAS steering to desired bearing)

- Possible branching into Rover Navigation (now possible by adaption of this plugin - Interested parties please message me)

- Locations and name suggestions are welcome for addition to the coordinate library!

Dependencies:

 

Contract Configurator V1.7.0 or greater - Required for any contract to work.

Fengist's Maritime Pack V0.1.4 or greater - Required for the contract to spawn vessels (necessary for all missions except Recovery and Diving).

I would also highly recommend KAS to assist with recovery contracts, furthermore BDArmoury may be helpful for the Scuttle missions to destroy the required vessels.

Download:

 

Release & Source:

KerbalStuff

 

This download contains both the Contract Pack and the Navigation Plugin, I would recommend keeping both unless you are a diehard salty sea Kerbal that's determined to visit each location in real time.. In which case I salute you!

License:

This pack and associated plugin is Licensed under CC-BY-NC-SA-4.0.

Credit is also noted for nightingale for a derivation of his SpawnVessel code used in ContractConfigurator under the MIT license, without it the Navigation plugin would not exist!

Other Mods by me:

Orbital Decay - Add realistic orbital decay in the background to all vessels on or off rails, in or out of timewarp.

Historic Missions Pack - A series of 400 contracts based on real space missions spanning from 1945 to 2015.

Edited by Whitecat106
Update - Bugfix

Share this post


Link to post
Share on other sites

Current Issues:

- Max speed in the plugin destination tab is not capped to the vessels max speed (Just don't cheat okay?) - Hopefully I can work out a way of calculating the maximum possible speed of a vessel some how...

- During high timewarp a forceful interrupt will occur if a background vessel reaches its destination cutting the timewarp rate to 0 instantly, this spike drops FPS momentarily, in the next plugin update I will change this to a slow spool down.

- There are probably one or two issues with some contracts (should be alright but if there are any issues please let me know) :)

Next update (V1.1.0) plans:

- More contracts, plugin vessel max speed cap, plugin support for vessels moving across shore biomes (navigation during river travel) and bugfixes! Enjoy :)

Share this post


Link to post
Share on other sites

This will be even more fun when Infinite Dice refreshes his Boat Parts pack. I recommend adding KerbinSide bases to the preset coordinates.

About the plugin - if two points on the ocean are not navigable in a straight line, does it plot a path to avoid intervening landmasses? What happens if there is no solution to this problem (i.e. the craft is in a landlocked water body)? Can it be used to navigate the rivers?

Share this post


Link to post
Share on other sites
This will be even more fun when Infinite Dice refreshes his Boat Parts pack. I recommend adding KerbinSide bases to the preset coordinates.

About the plugin - if two points on the ocean are not navigable in a straight line, does it plot a path to avoid intervening landmasses? What happens if there is no solution to this problem (i.e. the craft is in a landlocked water body)? Can it be used to navigate the rivers?

Indeed Infinte Dice's pack was one of the best of all time, however Fegists pack is really coming along fast!

I will look into adding Kerbin Side bases, all it really needs is one big port somewhere that can launch vessels directly into the water but I don't think this has yet been done in Kerbin Side.

At the moment no, there is no fancy path plotting (I will look into it), basically right now the ideal route of getting places would be to go from point to point to avoid the next coordinate lying within a biome other than water (if the biome is not water the code notifies the user that the auto navigation has been turned off leaving the vessel at the last 'jump' coordinate before the 'bad' coordinate was processed, this means the user has to enter a new coordinate to navigate to instead), I will produce a map this afternoon of all the coordinates in the Library so that these may be used as individual points.

I aimed to try and make the plugin as non cheaty and realistic as possible hence why the vessel isn't just teleported to the new location after a set time, however I was thinking that a series of waypoints (coordinates) could be entered by the user into a list on the UI and the navigation code would then go to each point in order (kind of basic user made pathfinding). This would mean that the user would not have to switch to the vessel 3/4 times to set new coordinates especially with locations on the West Side of Kerbin that are a real pain to get to.

As for rivers: since the code currently stops navigation when the biome is not water, and that all of the rivers on Kerbin are in a shores biome there is no way of differentiating between solid ground and water (even altitude/height doesn't seem to work as an indication due to the PQS stuff to do with Kerbin), so navigation across rivers is going to take a while (I just don't want to end up beaching anyone's boat). However the Library does contain coordinates for the Delta of each major river on Kerbin, so these can be navigated too but in the meantime the player must navigate the river themselves sorry :(

The landlocked problem I think would only be solved with a Kerbin Side base, I will look into this but I am no part modeller..nor texture maker of any kind so it may take a while..

Enjoy anyway! :) I will look into Kerbin Side this afternoon and make an in game displayable map showing all the locations in the library!

Edit: 15:03 I have fixed the logo issue in the contract pack where the logo's were not appearing correctly. Updated to 1.0.3

Edited by Whitecat106

Share this post


Link to post
Share on other sites

The Oceania pack has water launch sites, but wasn't up to date for a recent KS release, so wasn't included.

If a boat uses fuel, some sort of means of depleting it would stop oceanic travel on zero fuel.

Are craft oriented in the direction they are navigating to? We don't want them heading off on the wrong direction the moment they are switched back to.

Edited by colmo

Share this post


Link to post
Share on other sites
The Oceania pack has water launch sites, but wasn't up to date for a recent KS release, so wasn't included.

If a boat uses fuel, some sort of means of depleting it would stop oceanic travel on zero fuel.

Are craft oriented in the direction they are navigating to? We don't want them heading off on the wrong direction the moment they are switched back to.

I will look into what I can do about the Oceana pack tonight, at the moment I have just completed some work on v1.1.0 mostly to do with the plugin, a labelled map view is now avaliable for locations on both Kerbin and Laythe.

As for the fuel issue... I tried to manage something similar for my Orbital Decay Plugin and honestly it was so buggy and damaging that it completely derailed development of the mod, until someone can present me with a simple way of bulk resource counting, and removal after time I cannot implement this in my pack (I have examined TAC and Interstellar code heavily and I honestly cannot whack my brain around it!). In the mean time I have added a penalty of funds for each 'jump', that way long journeys cost more funds (hence why my contract pack rewards are somewhat generous).

The craft orientation and navigation for an active vessel is still in progress, basically the limit of its ability at the moment is a redirection of the heading of the craft to the calculated bearing when the SAS key is pressed and navigation is active (For some reason I cannot activate the SAS key from within the code? I must be missing something somewhere..)

Navigation plugin - great idea! Downloaded.

Thanks wasml! :)

--- So a note on work so far:

Version 1.1.0 (tonight or tomorrow)

- Maps for Kerbin, Laythe and eventually Eve when I can find one :S

- Changes to the Library system

- Fixes for icon bugs

- Possibly some Active vessel navigation additions if I can work out an appropriate method.

- Possibly one or two more contracts (If I feel like it tonight basically)

Version 1.2.0

- Shores biome support

- List mode for navigation between more than one Coordinate at a time

- Ferry and Exploration (Landlocked Kerbin seas, Eve oceans and Laythe oceans contracts)

Share this post


Link to post
Share on other sites

I'm trying the celeste contract too early in career mode. I peeked the config file to know where to go. I went to the coords, nothing. also, I tried loading ur craft file, I don't have FS.Battery20 in my game becuz I felt it was redundant to procedural battery... =\

Share this post


Link to post
Share on other sites
I'm trying the celeste contract too early in career mode. I peeked the config file to know where to go. I went to the coords, nothing. also, I tried loading ur craft file, I don't have FS.Battery20 in my game becuz I felt it was redundant to procedural battery... =\

Ahh thats the issue, most of the contracts spawn a vessel/object at the required coordinates, if you don't have all the parts the vessel cannot spawn, I will change some of the .craft files to remove some unnecessary parts but the FS.Battery20 is required for the Serendipity mission anyway (needs power for active lights :S) I will change as much as I can to stock parts. But with all the parts the vessel would spawn and you could find the coordinates by looking at the map view rather than needing the config.

--- I will release the next update within afew hours, in light of AlonozoTG's comment I shall also change some .craft files in the contract pack to reduce the number of required parts.

Share this post


Link to post
Share on other sites

Re: Rivers - they could become navigable with plenty of set coordinates along their path, or if you could approximate them using a curve. Terrain detail variation is likely to cause problems though, as you probably already suspect.

I think the ISRU code has a mechanism to change resources on a craft without being focused on it. Navigation plugin fuel use could do the same in reverse?

Share this post


Link to post
Share on other sites
Re: Rivers - they could become navigable with plenty of set coordinates along their path, or if you could approximate them using a curve. Terrain detail variation is likely to cause problems though, as you probably already suspect.

I think the ISRU code has a mechanism to change resources on a craft without being focused on it. Navigation plugin fuel use could do the same in reverse?

That's a good idea, it would certainly save trying to make changes to allow specific types of shores, and it could be implemented in a sequence of points just like my intention of adding a sequencing ability to travel to harder to get to destinations, thanks! 1.2.0 will be soon I promise!

Really? I had not thought of that, it makes sense though, do you have any links to the KSP ISRU code? At the moment the old modders API is very outdated, and it saves a lot of time tinkering if there is an available .class file lying around! If it works it could solve alot of issues in this plugin as well as my orbital decay one!

Share this post


Link to post
Share on other sites

Roverdude is the guy to ask, I haven't a clue how it works.

Here's a repost from the Boat Parts thread I made that might fire a few more lightbulbs - it might be partly doable with current Maritime parts:

I was checking out the Contract Configurator mod and a lightbulb went on - this is perfect for the carrier.

Instead of having to faff around with launching a carrier, it can be spawned wherever the contract requires. Contracts might be docking with the carrier (i.e. a landing) or some other condition consistent with landing (e.g. stationery) on or near (in the case of a sea plane) a carrier. Spawning it a good distance away comes in handy and adds challenge. Putting extra vehicles on the spawned carrier allows daisy-chaining missions e.g. land on carrier, then take a small boat to another surface location for a science survey.

Share this post


Link to post
Share on other sites
Roverdude is the guy to ask, I haven't a clue how it works.

Here's a repost from the Boat Parts thread I made that might fire a few more lightbulbs - it might be partly doable with current Maritime parts:

Thanks Ill ask him, that contract idea certainly sounds interesting too, I had planned on having some carrier based missions!

I have just released v1.1.0 this fixes all of the contracts (none appeared to be working - silly me but its all working now!) and adds the map tab to the UI. Enjoy! :)

Share this post


Link to post
Share on other sites

Currently working on a few fixes to the Plugin and an additional 5 contracts to the pack, (3 carrier based missions (of a series of 10 planned, each follows the story line of the Kerbal Navy's new carrier: the Nautilus), 1 addition to the Mary Celeste story line and the beginning of the Flying Dutchman story line) (Don't worry the pack won't just become story line based, I will add to the other missions (I aim to fill the pack to around 50 contracts of varying types)) So think of this next update as v1.1.5.. Hopefully should have a release by tonight or tomorrow. :) Please let me know if there are any issues in the existing contracts!

Edit 01:35

No release just yet, I am working on a bigger amount of missions added (Most of the Carrier-Nautilus program) However I am having issues with a few missions (Such as the carrier landing mission Colmo suggested), basically the carrier parts in Fengists CVE pack are just a bit too narrow to produce a nice gliding carrier craft that can reliably land (and thus complete the contract parameter) without crashing or overshooting (Some sort of arrest system would be incredibly helpful here!). Still trying to code some parts of the new Course coordinate system too (trying to make C# dictionaries within dictionaries and the like..), so an update may wait till Wednesday - unless a bug is found that I can fix easily!

Edited by Whitecat106

Share this post


Link to post
Share on other sites
I'm playing around with this a bit more, while it is a great concept, it's not quite there yet. Have a look at:

https://en.wikipedia.org/wiki/Great-circle_navigation

for the maths needed to pilot a ship properly.

These are the formula's I have used, check out the source code in 'VesselData.cs'. Although the implementation in KSP could do with some work, the basic idea is the same, there are only changes necessary for timewarp (hence I included an ETA field so that the time passed in game also affects the next update point (this is what makes it messy in KSP, plus the fact that I am only updating the points every 30 seconds to avoid major lag and FPS drops)). The bearing, and next points are calculated using the great circle method already. The only thing that is 'as the crow flies' is the distance to the destination point, purely because this doesn't really matter and would be an unnecessary process writing and reading from a .cfg setup. However the distance between points are calculated with the haversine formulas.

So I think the maths are properly done (if not jumps would appear random or simply not work), it is just KSP's conceptualization of the process (with such small distances (relative to the Earth), fast vessel speeds and long time gaps between updates), the visual bow-like movement is lost.

Share this post


Link to post
Share on other sites

oops, srry.

yeah, the GUI doesn't really work right now and lags the game horribly when open. You should probably try to steal some code for Mechjeb because it has surface targeting nailed cold.

Share this post


Link to post
Share on other sites
oops, srry.

yeah, the GUI doesn't really work right now and lags the game horribly when open. You should probably try to steal some code for Mechjeb because it has surface targeting nailed cold.

This was an issue within the 'Navigation' tab caused by the config file 'vesselData.cfg' filling up to the brim with old vessels and Debris, this will be fixed in the next update (1.2.0) tonight! :)

Share this post


Link to post
Share on other sites

Hi everyone,

I have released version 1.1.1 as an intermediate version (still having some issues with the new course navigation system coming in 1.2.0), this version fixes bugs causing lag in the UI, I would recommend deleting your 'WhitecatIndustries' folder in the game data before installing this new version. This version also adds some features to the contract system in preparation for 1.2.0 (Hopefully by Saturday at the latest!)

Whitecat

Share this post


Link to post
Share on other sites

Hello there

Awesome idea!

I've been giving it a try. Do you know why the Nautilus carrier just sits 45° tilted to the right until you manage to get some kerbals into the crew cabin?

Also, can it even reach 30m/s? I've tried my best pushing it to its limit, but the best she could do was 25m/s (and with a weird tendency to turn left)

EDIT: I was able to reach up to 46m/s after juggling around with water compression and engine limiters. However, I've noticed something... the nautilus mission is impossible to complete! It requires the ship to be at the shores, the island AND the atoll at the same time! Simply visiting all of them or even dropping one of the subships in each location did not fulfill the requirement. So, sadly, this mission is currently impossible

Edited by zeropositivo

Share this post


Link to post
Share on other sites
Hello there

Awesome idea!

I've been giving it a try. Do you know why the Nautilus carrier just sits 45° tilted to the right until you manage to get some kerbals into the crew cabin?

Also, can it even reach 30m/s? I've tried my best pushing it to its limit, but the best she could do was 25m/s (and with a weird tendency to turn left)

Hello ZeroPositivo,

Thanks! Ahh this issue is due to the ballast in the vessel being uneven, I'm afraid this is due to my own creation of the Nautilus carrier, I had tried it out and I only just managed 30.5m/s you may have to adjust the ballast in the ship by using the compressor and de compressor, it is all due to the waterline of the ship so if you change the ballast around this should fix this... I think.

The 45 degree list may be due to the spawning initially from the contract (sorry about this!)

I will fix the above for the next update! :)

Share this post


Link to post
Share on other sites
Hello ZeroPositivo,

Thanks! Ahh this issue is due to the ballast in the vessel being uneven, I'm afraid this is due to my own creation of the Nautilus carrier, I had tried it out and I only just managed 30.5m/s you may have to adjust the ballast in the ship by using the compressor and de compressor, it is all due to the waterline of the ship so if you change the ballast around this should fix this... I think.

The 45 degree list may be due to the spawning initially from the contract (sorry about this!)

I will fix the above for the next update! :)

Thanks for that!

Ah, sorry, edited my message after you responded to it. Here's what I added:

EDIT: I was able to reach up to 46m/s after juggling around with water compression and engine limiters. However, I've noticed something... It requires the ship to be at the shores, the island AND the atoll at the same time! Simply visiting all of them or even dropping one of the subships in each location did not fulfill the requirement. So, sadly, this mission is currently impossible

Share this post


Link to post
Share on other sites

I wouldn't fret too much about an arrestor system. When Infinite Dice made his, we didn't have much in the way or airbrakes or VTOL without mods.

Now, it's trivial - even regular control surfaces can be setup for airbraking, the trick is to deploy them so one set offsets the pitch imparted by another set. There's always a repackageable chute for emergencies.

I'm still a bit grumpy that the basic engine got nerfed so hard it doesn't have sufficient thrust to be a VTOL engine stowed in a Mk2 cargo bay. I'm hoping the little 0.625m jets PorkJet previewed for next release can do the job.

Share this post


Link to post
Share on other sites

Hi everyone,

Working on the next update 1.1.2 now, this will fix the issues with multiple contracts including waypoints. However if I can finally get this new course navigation system to work I will skip 1.1.2 and go straight to 1.2.0 with that system implemented and a method of visualizing waypoint coordinates (rather than guessing at the nearest marker!), this will probably be done by just adding a note in the contract.

So I am trying my best to fix some of these issues and make the pack playable!

Whitecat :)

EDIT 16:12

Okay everyone, contracts are fixed, waypoint coordinates are available and the course navigation system works, all I need now is some courses... (Yes don't worry the big windy river on Kerbin is coming... Its just going to take hours to make (I have to find the precise coordinates of every bend and write these down...)) So expect a release this evening or tomorrow morning with maybe one or two initial courses! Still looking for a method of determining whether the vessel is on water or land since this is indistinguishable by the 'shores' biome...

Edited by Whitecat106
More info

Share this post


Link to post
Share on other sites

Okay the next update is out, courses and contract fixes are here. Delete your old version before installing this one though! Next update will be 1.2.1 to fix bugs and include more contracts and courses!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now