Jump to content

Mod to Generate Science Contracts by Searching Science Archives to Find New Science to Do


arkie87

What should the name of this mod be?  

34 members have voted

  1. 1. What should the name of this mod be?

    • Contract Configurator Pack: Field Research
      16
    • Contract Configurator Pack: Undiscovered Science
      12
    • Contract Configurator Pack: Science Explorer
      2
    • It's own mod: Do Science!
      4


Recommended Posts

I'm currently working on a giant list of all of the science in the game excluding Asteroids. Have some updates to work through seeing as some experiment limits have changed as of 1.0. So far, I have a total of 1,975 experiments. "[x] Science" mod shows a listing of 2,209 experiments, but a quick browse shows experiments that I certainly can't confirm to be possible (e.g. Crew report while splashed down on Kerbin's deserts).

It's a lot of effort, and it's not a top priority for me at the moment as I've got so many other things to enjoy besides science and so little free time. Only things I've noticed regarding science, not all biomes can support all types of experiments (e.g. Laythe's The Sagen Sea doesn't allow you to perform a seismic scan while landed -- could be a tiny plot of land labeled Sagen Sea where you CAN, but I don't know about it if there is one).

The sun also may or may not (probably doesn't) have an atmosphere or an area close enough to be labeled as "in flight" rather than "in space low." A suborbital trajectory below a certain height in space near Kerbol might just put down a "flying" situation for a brief time before you have to burn back to get on an orbit before things start to explode.

Link to comment
Share on other sites

It's a lot of effort, and it's not a top priority for me at the moment as I've got so many other things to enjoy besides science and so little free time. Only things I've noticed regarding science, not all biomes can support all types of experiments (e.g. Laythe's The Sagen Sea doesn't allow you to perform a seismic scan while landed -- could be a tiny plot of land labeled Sagen Sea where you CAN, but I don't know about it if there is one).

I think that is due to the vessel situation being splashed down rather than landed when you are in the ocean, but I'm not sure how to classify a biome as ocean other than doing it by hand. There are places where you can get an ocean biome while on land, the island airfield has areas of the water biome on land, for instance.

The sun also may or may not (probably doesn't) have an atmosphere or an area close enough to be labeled as "in flight" rather than "in space low." A suborbital trajectory below a certain height in space near Kerbol might just put down a "flying" situation for a brief time before you have to burn back to get on an orbit before things start to explode.

I'm not sure about the sun anymore. It used to not have an atmosphere, but I've heard that you can aerobrake in the sun now, so maybe they added a proper atmosphere.

The "flying" situation is only achieved when both ends of the orbit intersect the planet, that is why aerobraking maneuvers won't give you flying high/low results (unless you are using my experiments, which rectify that :))

Link to comment
Share on other sites

The "flying" situation is only achieved when both ends of the orbit intersect the planet, that is why aerobraking maneuvers won't give you flying high/low results (unless you are using my experiments, which rectify that :))

Could you elaborate on this? If it worked like that, ScienceAlert would be horribly broken. I just tested aerobraking in Duna's atmosphere and the vessel situation is definitely "flying" but now you have me concerned that it's broken in a non-obvious way which has gone unreported

Experiment crewReport@DunaFlyingHigh just became available! Total potential science onboard currently: 0 (Cap is 25, threshold is Unresearched, current sci is 0, expected next report value: 25)

Edited by xEvilReeperx
Link to comment
Share on other sites

From the KSP Science wiki: http://wiki.kerbalspaceprogram.com/wiki/Science

"KSP only considers a craft (or Kerbal) to be flying in an atmospheric region if it is on a sub-orbital trajectory. For example, taking readings while aerobraking in the upper atmosphere will return data for the "In Space Low" situation instead of "Flying High" even if the altitude is below the edge of space."

Haven't done tests on that myself, but it did sound a little suspect. My memory was telling me that it was the other way around if anything ... that a suborbital trajectory from space near the sun would return a "flying at the Sun" situation, but that would be incorrect. According to the wiki, if Kerbol had an atmosphere, you would need to perform a complete deorbit as well as get close enough to the surface to perform science tests while "flying."

This could also be true only for vessel recovery and experience factors. I do know that a suborbital trajectory from, say, the Mun grants a bigger recovery science bonus when returning to Kerbin than does an orbital trajectory.

Link to comment
Share on other sites

Doesn't look like it's accurate based off that description. It's possible it was changed since the wiki was edited, but as far as I know it's been this way since ScienceAlert was created

bea9979195.png


public class VesselSituationDumper : MonoBehaviour
{
private Rect _rect = new Rect(0, 0, 300f, 100f);

private void OnGUI()
{
_rect = GUILayout.Window(342323, _rect, DrawWindow, "Situation Monitor");
}

private void DrawWindow(int winid)
{
GUILayout.Label("Vessel Situation: " + FlightGlobals.ActiveVessel.situation);
GUILayout.Label("Experiment Situation: " + ScienceUtil.GetExperimentSituation(FlightGlobals.ActiveVessel));

GUI.DragWindow();
}
}
[KSPAddon(KSPAddon.Startup.Flight, false)]

Link to comment
Share on other sites

Can't tell from the screenshot or the test code whether the Apoapsis is above the atmosphere, but it certainly looks like you've disproven the wiki entry. Being a recent member of the KSP Science wiki program, I'm going to go ahead and delete that entry. If new data comes along that reconfirms it, there's always an "undo" button. I guess I'll just have to put it down to "rumor control." Cheers.

Edited by Barking Sands
Link to comment
Share on other sites

Doesn't look like it's accurate based off that description. It's possible it was changed since the wiki was edited, but as far as I know it's been this way since ScienceAlert was created

Does this work on an escape trajectory too? My recollection is that the vessel situation will remain escaping even while in the atmosphere and ScienceUtil.GetExperimentSituation() relies on that. This is the reason why I don't use that method and instead just look at the vessel's altitude when checking the experimental situation.

I'm not so sure non-escape orbits that dipped into the atmosphere, maybe they always reported flying, but I'm pretty sure that escape trajectories at least used to behave that way.

Link to comment
Share on other sites

Does this work on an escape trajectory too? My recollection is that the vessel situation will remain escaping even while in the atmosphere and ScienceUtil.GetExperimentSituation() relies on that.

You're right! I knew as soon as you mentioned it that I'd have to find out what you were talking about because this is exactly the kind of thing to go unnoticed for ages. I actually need to use the stock broken way for ScienceAlert in this case or the alerts won't work right but this is very good to know. It does mean I'm missing some alerts for your experiments though. I'll have to fix that.

ad761d9b33.png

Basically all possible, but the control flow is different. It would be more like:

  1. Select a CelestialBody with biomes that have science to be done.
    targetBody = LandedBodies().Where(cb => cb.BunchOfStuffThatINeedToComeUpWithToCheckForScience()).Random()


  2. Select a biome from the celestial body that has science to be done.
    biome = @targetBody.AllBiomes().Where(b => b.SomeCheckForScience()).Random()


  3. Build a list of experiments
    experiments = biome.SomeOtherFunctionToGetExperiments().Where(exp => exp.SomeFunctionForCheckingIfScienceAvailable())


  4. Dump the experiments into a bunch of CollectScience parameters (as was done in the gas-giant contract above).

These aren't too bad but the problem is filtering out the "bad" auto-generated experiments. Is it possible for Contract Configurator to put a marker on the planet surface? If you selected a specific location (+radius of that point) on the planet it would be much simpler to identify "impossible" entries and avoid offering "check the temperature while splashed down in this desert"-type entries.

Here's a quick brain barf:

[KSPAddon(KSPAddon.Startup.Flight, false)]
public class UtilTester : MonoBehaviour
{
private void Awake()
{
var subjectQuery = new ScienceSubjectQuery();
var visited = new VisitedCelestialBodyQuery();
var possibleResults = new PossibleExperimentResultsQuery(subjectQuery);
var remainingScienceQuery = new RemainingScienceQuery(subjectQuery);
var nextReportValueQuery = new NextScienceReportQuery(subjectQuery);

print("Running tests");

// all possible subjects on planets we've visited and taken some science from
var allPossibleResults = visited.Get()
.SelectMany(
cb =>
ResearchAndDevelopment.GetExperimentIDs()
.Select(ResearchAndDevelopment.GetExperiment)
.SelectMany(experiment => possibleResults.Get(experiment, cb)))
.OrderBy(ss => ss.id)
.ToList();

// return only those we've done so far
var partials = allPossibleResults
.Where(scienceSubject => scienceSubject.science > 0f);

// return only those that haven't been done at all
var unresearched = allPossibleResults.Where(subject => Mathf.Approximately(subject.science, 0f));

// return those worth at least X science
var worthAtLeastX = allPossibleResults.Where(subject => remainingScienceQuery.Get(subject) > 25f);

// return the best value orbital experiments (of planets we've already visited)
var bestOrbitalValue = allPossibleResults
.Where(
subject =>
subject.IsFromSituation(ExperimentSituations.InSpaceHigh) ||
subject.IsFromSituation(ExperimentSituations.InSpaceLow))
.OrderByDescending(subject => remainingScienceQuery.Get(subject));

foreach (var ov in bestOrbitalValue)
print("You could " + ov.id + " for " + remainingScienceQuery.Get(ov) + ", next report will be worth " + nextReportValueQuery.Get(ov));
}
}

// because ScienceExperiments are related to certain subjects and the ScienceSubject only contains
// a string to identify it ... we could split the string but how ugly is that?
public class PossibleScienceSubject
{
public ScienceSubject Subject { get; private set; }
public ScienceExperiment Experiment { get; private set; }

public float scienceCap
{
get { return Subject.scienceCap; }
}

public float science
{
get { return Subject.science; }
}

public string id
{
get { return Subject.id; }
}

public PossibleScienceSubject(ScienceSubject subject, ScienceExperiment experiment)
{
Subject = subject;
Experiment = experiment;
}

public bool IsFromSituation(ExperimentSituations situation)
{
return Subject.IsFromSituation(situation);
}
}

// The purpose of this query is to avoid putting empty entries into R&D building by accident
public class ScienceSubjectQuery
{
public PossibleScienceSubject Get(ScienceExperiment experiment, ExperimentSituations situation, CelestialBody body,
string biome)
{
var defaultIfNotResearched = new ScienceSubject(experiment, situation, body, biome);

return new PossibleScienceSubject(ResearchAndDevelopment.GetSubjects()
.SingleOrDefault(researched => defaultIfNotResearched.id == researched.id) ?? defaultIfNotResearched, experiment);
}
}


// just about does what it says
public class NextScienceReportQuery
{
private readonly ScienceSubjectQuery _subjectQuery;

public NextScienceReportQuery(ScienceSubjectQuery subjectQuery)
{
if (subjectQuery == null) throw new ArgumentNullException("subjectQuery");
_subjectQuery = subjectQuery;
}


public float Get(ScienceExperiment experiment, CelestialBody body, ExperimentSituations situation, string biome, float xmitScalar = 1f)
{
return ResearchAndDevelopment.GetScienceValue(
experiment.baseValue * experiment.dataScale,
_subjectQuery.Get(experiment, situation, body, experiment.BiomeIsRelevantWhile(situation) ? biome : string.Empty).Subject,
xmitScalar) * HighLogic.CurrentGame.Parameters.Career.ScienceGainMultiplier;
}

public float Get(ScienceExperiment experiment, ScienceSubject subject, float xmitScalar)
{
return ResearchAndDevelopment.GetScienceValue(
experiment.baseValue * experiment.dataScale,
subject,
xmitScalar) * HighLogic.CurrentGame.Parameters.Career.ScienceGainMultiplier;
}

public float Get(PossibleScienceSubject possibleSubject, float xmitScalar = 1f)
{
return Get(possibleSubject.Experiment, possibleSubject.Subject, xmitScalar);
}
}


public class RemainingScienceQuery
{
private readonly ScienceSubjectQuery _subjectQuery;

public RemainingScienceQuery(ScienceSubjectQuery subjectQuery)
{
if (subjectQuery == null) throw new ArgumentNullException("subjectQuery");
_subjectQuery = subjectQuery;
}


public float Get(ScienceExperiment experiment, ExperimentSituations situation, CelestialBody body, string biome)
{
var subject = _subjectQuery.Get(experiment, situation, body, biome);

return Get(subject);
}

public float Get(PossibleScienceSubject possibleSubject)
{
return possibleSubject.scienceCap * HighLogic.CurrentGame.Parameters.Career.ScienceGainMultiplier - possibleSubject.science;
}
}


// return bodies which have at least one non-zero (transmitted or recovered) science result
public class VisitedCelestialBodyQuery
{
public IEnumerable<CelestialBody> Get()
{
return FlightGlobals.Bodies
.Where(cb => ResearchAndDevelopment.GetSubjects()
.Any(ss => ss.IsFromBody(cb) && ss.science > 0f));
}
}


public class PossibleExperimentResultsQuery
{
private readonly ScienceSubjectQuery _subjectQuery;

public PossibleExperimentResultsQuery(ScienceSubjectQuery subjectQuery)
{
if (subjectQuery == null) throw new ArgumentNullException("subjectQuery");

_subjectQuery = subjectQuery;
}


public IEnumerable<PossibleScienceSubject> Get(ScienceExperiment experiment, CelestialBody body)
{
var situations = Enum.GetValues(typeof (ExperimentSituations)).Cast<ExperimentSituations>();

return situations
.Where(sit => experiment.IsAvailableWhile(sit, body))
.SelectMany(sit =>
{
var biomesPlusKsc = (experiment.BiomeIsRelevantWhile(sit)
? ResearchAndDevelopment.GetBiomeTags(body).ToArray()
: Enumerable.Empty<string>()).ToList();

var biomes =
biomesPlusKsc.Where(
biome =>
body.BiomeMap != null && body.BiomeMap.Attributes.Any(attr => attr.name.Replace(" ", string.Empty) == biome))
.ToList();

var kscStatics = biomesPlusKsc.Except(biomes);

return (biomesPlusKsc.Any() ? biomes : new List<string>{string.Empty})
.Select(biome => _subjectQuery.Get(experiment, sit, body, biome))
.Union(sit == ExperimentSituations.SrfLanded // static KSC items can only be landed on as far as I know
? kscStatics.Select(
staticName =>
_subjectQuery.Get(experiment, ExperimentSituations.SrfLanded, body, staticName))
: Enumerable.Empty<PossibleScienceSubject>());
});
}
}

It still has some problems like asking for splashed down experiments in the desert and not being hugely tested. If we can't choose a specific location, it might be possible to roughly determine which biomes aren't covered by ocean (I think stupid_chris had some PQS height code that could help with this) which would eliminate most false positives

Edit: I just realized there's a small bug in that last query that would prevent experiments with nonrelevant biomes from working correctly; updated code

Edited by xEvilReeperx
Edit: small bugfix
Link to comment
Share on other sites

That's a good question: is it possible to put a marker on the planet's surface using Contract Configurator?

I think it should be optional in this mod, since some players will want to find the biome themselves; others will want a marker so they can target it and land on it.

Link to comment
Share on other sites

That's a good question: is it possible to put a marker on the planet's surface using Contract Configurator?

I think it should be optional in this mod, since some players will want to find the biome themselves; others will want a marker so they can target it and land on it.

The marker is certainly possible (via a waypoint), but that's for a specific location. A biome is a big blob - you'd need some other way to mark it.

xEvilReeperx - I'll take a look at that code shortly, but looks good.

Link to comment
Share on other sites

Hi Barking Sands, thanks for letting me search for this post ;) Well anyway here I found it so:

[…]Haven't done tests on that myself, but it did sound a little suspect. My memory was telling me that it was the other way around if anything ... that a suborbital trajectory from space near the sun would return a "flying at the Sun" situation, but that would be incorrect. According to the wiki, if Kerbol had an atmosphere, you would need to perform a complete deorbit as well as get close enough to the surface to perform science tests while "flying."[…]

Now I can't really quickly verify this but afaik prior to 1.0 it was as described in the wiki: A suborbital hop would obviously count as “in space†(if your craft was high enough), otherwise it would be impossible to gather scientific data from space without orbiting and I guess almost everyone who played career mode did a suborbital hop before doing a proper orbit to collect new science points from the new situation. And you don't need to get close to the surface to get science while flying that way. You “just†need to get the apoapsis inside the atmosphere.

Fabian

Link to comment
Share on other sites

Hi Barking Sands, thanks for letting me search for this post ;) Well anyway here I found it so:

Now I can't really quickly verify this but afaik prior to 1.0 it was as described in the wiki: A suborbital hop would obviously count as “in space†(if your craft was high enough), otherwise it would be impossible to gather scientific data from space without orbiting and I guess almost everyone who played career mode did a suborbital hop before doing a proper orbit to collect new science points from the new situation. And you don't need to get close to the surface to get science while flying that way. You “just†need to get the apoapsis inside the atmosphere.

Fabian

Yeah, sorry about that; I forgot to use quotes when I was posting again. It's always a nice reminder when my reply ends up at the top of the next page. :blush:

Erm ... this stuff has me totally confused. I get the bit where you say that you can get science from "in space" while suborbital from space low, there's never been a question about that. Where you said "just need to get apoapsis inside the atmosphere," I think you may have meant "periapsis." I believe the debate was on whether the periapsis needs to just be under the atmosphere, or whether it needs to be gone altogether -- which xEvilReeperx showed that it need only be under the atmosphere with his screenshot. What I couldn't determine from the screenshot is his apoapsis which may have been under the atmosphere as well (if that makes any difference, which I doubt, but just being thorough).

-- And now with this escape trajectory stuff. It's starting to sound like you might not be able to gather science while flying inside an atmosphere while "aerocapturing" from an encounter to a potential escape. You may need to wait until an orbit is established before gathering science or else you'll get an escaping situation instead of a "flying at," which might result in getting science from "space low" even under the atmosphere. I don't believe that's the case, but I'm not ruling it out yet. As to what does any of this have to do with gathering science from an atmosphere that Kerbol probably doesn't even have? Nothing. There's no way to be on an escape trajectory from Kerbol in KSP.

The real hard stuff about filtering this list of all things KSP science: landed vs. splashed down. I've heard that it's possible to gather science while "splashed down" in Kerbin's grasslands. I've tried it (involves splashing down in a river instead of in the ocean) and I've only gotten yet another "splashed down at Kerbin's shores" situation, but I'm still convinced it's not entirely impossible. What's really gonna give me trouble is how many places on Eve and Laythe can you splash down and get a biome that isn't normally a liquid surface. Same goes for landing on biomes that are supposed to be liquid surfaced. There are some places on Kerbin that aren't shores but also don't require water wings in order to get the "Kerbin's water" biome while landed -- same is possible on Eve and Laythe I'm guessing, but it takes forever to get real data on any of this.

Link to comment
Share on other sites

Here is the breakdown of how your current situation relates the experiment subject:

  • On solid ground, or the launchpad (prelaunch)
    • Surface Landed

    [*] In the water/ocean

    • Surface Splashed; regardless of biome

    [*] In space; any type of orbit: sub-orbital, orbit, escape trajectory:

    • In Space Low if below the threshold
    • In Space High if above the threshold

    [*] Inside of a planet's atmosphere; the only tricky one:

    • In Space Low if on an escape trajectory, regardless of whether you are headed out or in
    • Flying Low if you are below the threshold with any other type of orbit: sub-orbital, orbital with periapsis and/or apoapsis inside the atmosphere
    • Flying High if you are above the threshold with the same orbital characteristics as above

The only one that doesn't make sense is an escape trajectory while in the atmosphere.

None of that really has any bearing on the topic though.

About nonsense biomes while splashed down or on the surface, there is no way the game registers a biome-situation combination as invalid. Biomes are determined using a low-resolution color map, if your current position is inside one color then you are in that biome (there is some blending at the borders of colors, which is why you can get Tundra a few km west of the KSC). The low resolution of the map means that small islands or small lakes might be considered an ocean or surface biome, respectively, even when the experimental situation doesn't match.

I'm not sure of how to handle this other than manually marking biomes-situation combos that generally don't make sense, or some extremely slow, tedious method of checking the elevation at a biome to see if it's under water.

My understanding of FinePrint is that it checks if a survey point is valid only after selecting a location. That doesn't work if you just want to know what experiments are left to conduct.

Link to comment
Share on other sites

The low resolution of the map means that small islands or small lakes might be considered an ocean or surface biome, respectively, even when the experimental situation doesn't match.

Uh, if you're talking about the biome used in the science report they'll always match. If you're talking literal ExperimentSituations then the biome map doesn't play any part in that, only altitude (to determine whether the vessel is at ocean level or not, if the body has ocean).

The slow tedious elevation check is why I was pushing for a target location. I think any manual entry would be a mistake and far more tedious, especially if you want to support the various planet modifications or the rarer case of edited biomes

Edit: I see what you're saying. I'm not concerned about the "that doesn't really make sense" entries. I'm more concerned that we make sure the contract is indeed completable. If there's a location on the planet where you can SrfLanded and take a temperature measurement from Ocean, I would let it pass since it's feasible to do that crazy as it is. But if you take a contract for SrfSplashed in Desert and there's literally no place on the planet where you could possibly succeed, that's a problem

Edited by xEvilReeperx
Link to comment
Share on other sites

Uh, if you're talking about the biome used in the science report they'll always match. If you're talking literal ExperimentSituations then the biome map doesn't play any part in that, only altitude (to determine whether the vessel is at ocean level or not, if the body has ocean).

I was referring to biome-situation combos that don't make sense, SrfLandedWater, or SrfSplashedDesert, etc...

The only thing that determines biome is your location (actually the biome string can be anything, it doesn't have to match one of the actual biomes, this is how I generate anomaly "biomes"), the only thing that determines the experiment situation is the vessel situation (on the ground at least).

Link to comment
Share on other sites

I thought it was possible to get splashed down everywhere on Kerbin (although not necessarily easily). I was sure I'd seen a thread/post or something about it somewhere. The closest I found was this one that gives a few examples:

@Karretch

There are different situations in which experiment can be performed on same biome. Landed and splashed is same thing as lower and higher atmosphere or low and high orbit. Same experiment can be performed in each of this situations if it is predefined in experiment definition. With landed and splashed it is little confusing because places where you can do both situations are rare, for example, you need to find lake in grassland biome to make splashed experiment or find part of water where it is overlapping with land to make "landed" on water experiment (like old airfield).

Here is picture of some of biomes around KSC that can be splashed (sorry for bad picture).

Stock experiments that can be performed in both situations are Crew and EVA report, Goo, surface sample, material lab, temperature, barometer and gravity scan.

All splashed experiments have higher science value.

KSP_0156.jpg

@netmonger

Where did you found splashed for Highlands?

Edit: Never mind, found it, it's a lake north from my desert marker.

- - - Updated - - -

And an update on the Contract Configurator enhancements - spent most of the weekend with the kids, so little progress, but slowly pulling stuff from xEvilReeperx's code post a few pages back. Shouldn't take too long to get something workable, and then I'll worry about if there's anything I can do about the difficult combinations in CC.

Link to comment
Share on other sites

I thought it was possible to get splashed down everywhere on Kerbin (although not necessarily easily). I was sure I'd seen a thread/post or something about it somewhere.

Definitely true. Not 100% sure about Eve and Laythe, though.

Link to comment
Share on other sites

I was thinking of it in broader terms -- contracts for every planet, including mod planets, edited biomes and stuff like that. But I realize I'm ahead of myself and right now getting the basics working should be the priority and not worrying that a few percent of the offered contracts might not be completable

edit: I mean in context of achievable contract requirements

Edited by xEvilReeperx
Link to comment
Share on other sites

Well, I see no reason why what I've got so far wouldn't work for mod planets or edited biomes. Anyway, I think I've got it past the first post - I can now use Contract Configurator to generate random valid subjects (for some values of valid. :D) and then throw that into a CollectScience:

T44yptC.png

Next up I've got to add a bunch of stuff around it so that it's actually controllable in a meaningful way (ie. genering for specific situations/experiments, filtering specific things, only generating where current science is zero or below a threshold, etc.). Then I'll put together the documentation, release and throw up some example contracts to get you started, arkie.

Link to comment
Share on other sites

is there a way to fetch what is at a certain location in a biome? It would be useful to be able to have code that you can say [body, Lat, Lon.] and get [Alt, Biome, Sea Level].

Let's see... biome for a given location I don't have the code for, but SCANsat does, something along these lines. Terrain height at a given location would be:

        public static double TerrainHeight(double latitude, double longitude, CelestialBody body)
{
// Sun and Jool - bodies without terrain
if (body.pqsController == null)
{
return 0;
}

// Figure out the terrain height
double latRads = Math.PI / 180.0 * latitude;
double lonRads = Math.PI / 180.0 * longitude;
Vector3d radialVector = new Vector3d(Math.Cos(latRads) * Math.Cos(lonRads), Math.Sin(latRads), Math.Cos(latRads) * Math.Sin(lonRads));
return Math.Max(body.pqsController.GetSurfaceHeight(radialVector) - body.pqsController.radius, 0.0);
}

Altitude of sea level at a given location would be (I assume you must've meant something different though :D):

        public static double SeaLevel(double latitude, double longitude, CelestialBody body)
{
return 0.0;
}

Link to comment
Share on other sites

Well, I see no reason why what I've got so far wouldn't work for mod planets or edited biomes. Anyway, I think I've got it past the first post - I can now use Contract Configurator to generate random valid subjects (for some values of valid. :D) and then throw that into a CollectScience:

http://i.imgur.com/T44yptC.png

Next up I've got to add a bunch of stuff around it so that it's actually controllable in a meaningful way (ie. genering for specific situations/experiments, filtering specific things, only generating where current science is zero or below a threshold, etc.). Then I'll put together the documentation, release and throw up some example contracts to get you started, arkie.

Wow! Awesome! Thanks so much!

Is it easier to just focus on surface experiments/experiments in biomes on surface?

It is possible to make it instruct you to do ALL available (researched) science experiments? Or maybe pick up to 3?

Link to comment
Share on other sites

Is it easier to just focus on surface experiments/experiments in biomes on surface?

Already got it so you could filter it any which way - it'll be just as easy to do surface only, orbital only, flight only, biome-specific, etc.

It is possible to make it instruct you to do ALL available (researched) science experiments? Or maybe pick up to 3?

Ugh, I thought I was just about done, but realized I don't have anything for looking at what experiments can actually be DONE by the player. Research is part of it, but there are other aspects:

  1. Does the player have the pre-requisite building upgrade (EVA and samples)? For EVA it's even uglier, because you can do EVAs on the surface of Kerbin without an upgrade, so it's got some special cases.
  2. Asteroid sample experiments are a big outlier. Hypothetically, you can do it right on day 1, but I wouldn't want to offer the player "do an asteroid sample while landed in Kerbin's grasslands" in a simple 1-star contract. :)
  3. Is there even a way to tell that a given experiment requires a part? I'll have to look closer at that.

Link to comment
Share on other sites

Asteroid sample experiments are a big outlier. Hypothetically, you can do it right on day 1, but I wouldn't want to offer the player "do an asteroid sample while landed in Kerbin's grasslands" in a simple 1-star contract

For those, just wait till the player has unlocked the grapple hook thingy.

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