Jump to content

[1.8.x] DMagic Orbital Science: New Science Parts [v1.4.3] [11/2/2019]


DMagic

Recommended Posts

All of my parts use or inherit from DMModuleScienceAnimate which allows for the experimentLimit field. Just add that field, specify a number, and it should allow you to collect multiple experiments from a single part before needing to transmit/collect/reset the instrument.

You can use DMModuleScienceAnimate for the stock science parts, just remove the standard ModuleScienceExperiment, replace it with mine, and make sure all of the fields are filled out correctly. Most fields are the same as for stock science parts, there are just a handful of extras that need to be filled out, most of which you can probably figure out by looking at my standard parts (ie not, US science and not anything that doesn't use DMModuleScienceAnimate).

Link to comment
Share on other sites

You know, I've noticed that when you restore the compact mystery goo and materials science experiments (the roverable ones in this mod), the animations don't reset properly. No idea if that is messing anything up or not.

As for the problem earlier on this page, I guess the best thing to do is just wait for 1.1 and Unity 5? I'm surprised more people haven't reported it or something.

Link to comment
Share on other sites

So been playing around with it and I came up with the following.

Only issue is that for some reason it starts open. Any ideas on that?


$PART[science_module]:NEEDS[DMagic]:Final
{
@name = science_module_test
%title = 0 Material Bay - Limit of 3
%manufacturer = Stuff Inc.
%description = Not too good, but not too bad

!MODULE[ModuleScienceExperiment] {}
!MODULE[ModuleAnimateGeneric] {}

MODULE
{
name=DMModuleScienceAnimate
animationName = Deploy
startEventGUIName = Deploy
endEventGUIName = Close
actionGUIName = Toggle Doors
showStartEvent = false
showEndEvent = true
showToggleEvent = true
showEditorEvents = true

customFailMessage = The materials bay is not safe to open in this environment.

experimentID = mobileMaterialsLab

experimentActionName = Observe Materials Bay
resetActionName = Reset Materials Bay

useStaging = False
useActionGroups = True
hideUIwhenUnavailable = False
rerunnable = False
experimentLimit = 2
resetLevel = 1

xmitDataScalar = 0.3

dataIsCollectable = True
collectActionName = Collect Data
interactionRange = 1.8
externalDeploy = True
usageReqMaskExternal = 8

asteroidReports = True
asteroidTypeDependent = True

sitMask = 63
bioMask = 3


}
}

Link to comment
Share on other sites

So been playing around with it and I came up with the following.

Only issue is that for some reason it starts open. Any ideas on that?

Try adding or changing the following fields. Also get rid of the actionGUIName field.


experimentAnimation = true
experimentWaitForAnimation = true //will wait for the doors to open before giving results
waitForAnimationTime = -1 //will wait for the duration of the animation
keepDeployedMode = 0 //will behave like the stock part, resetting the animation after resetting the experiment

showEndEvent = false
showStartEvent = false
showToggleEvent = true

Link to comment
Share on other sites

Chapter 1: Radio and Plasma Wave Science

Chapter 2: Magnetometer

Chapter 3: Telescopes and Imaging Systems

Chapter 4: Laser Ablation

Chapter 5: Core Drill and Biological Experiments

Chapter 6: Neutron Reflections and Subsurface Water

Chapter 7X-Ray Diffraction and Surface Composition

The dynamic albedo of neutrons (DAN) experiment included in my parts (and inspired by Sethnizzle's experiments) is taken directly from one of the Curiosity rover's instruments.

The Instrument

The instrument is made of two separate components. An elongated flat object mounted within the body on one corner of the rover is the neutron generator. The other component is made up of two partially exposed, helium-filled cylindrical detectors and the electronics package, it is mounted on the other side of the rover. The figure below shows each component and their placement in the rover.

sHyI1Wv.png

Pulsed Neutron Generator

Passive neutron measurements can be made using cosmic-ray radiation, but these provide only rough estimates of subsurface hydrogen, as the energy, number, and direction of the neutrons can't be controlled. By using an active neutron source all of these factors can be controlled to give much more accurate measurements.

The DAN neutron generator is basically a small particle accelerator, which bombards a tritium target with deuterium ions through a vacuum tube. This reaction produces helium and neutrons. Short pulses of neutrons are generated with a duration of about 1 microsecond with a well-controlled energy, scattered neutrons from this pulse can then be measured by the detector.

Detector

Each of the two cylinders in the detector module is used to measure neutrons through scintillation counters based on products of the helium-neutron interaction. Relatively slow moving neutrons (thermal neutrons) interact with the helium nucleus (specifically, helium-3, which has two protons and only one neutron) to produce a proton and a tritium atom. That proton is detected by the scintillation counters.

One of the detectors is coated with a thin layer of cadmium, which blocks the slow moving, thermal neutrons, while the other is transparent to them. Both detectors will measure the background, high-energy neutrons, this allows for an accurate count of thermal neutrons.

Neutron Scattering

The purpose of this controlled release and detection of neutrons is to measure the amount of subsurface hydrogen, and to generate an accurate representation of the layering structure of hydrogen up to 1m below the surface. Hydrogen concentration is inferred through neutron scattering based on the amount of low-energy, thermal neutrons detected by the instrument. Neutrons are slowed down and scattered by interacting with hydrogen molecules, this both lowers the energy of the neutrons and delays their return to the surface and subsequent detection. By comparing the amount and timing of low energy neutrons detected with the amount of higher energy neutrons, an estimate of subsurface hydrogen can be obtained.

GuKre1O.png

Note that despite what this image implies, thermal neutrons are slower and of a lower energy than epithermal neutrons.

Since most of the hydrogen bearing compounds detected on Mars have been either water or hydrated minerals, this method generates a good estimate of the amount of water just under the surface. By fitting the results of repeated measurements to complex mathematical models (and making some assumptions about surface composition) a detailed map of both the amount of hydrogen, and therefore water, and its distribution in the soil stack can be obtained.

The figure below show a hypothetical, two-layer scenario. The neutrons pass through the low water content area with relatively little scattering, but are quickly scattered and returned to the surface by the higher water content in the lower layer.

The figure on the right shows real-world measurements made by Curiosity over its time on the surface. Both active (using the neutron generator) and passive (neutrons from natural sources, which produces results while using far less power) have been made repeatedly by Curiosity. These show how different regions produce different rations of low to high energy neutrons.

6frilJx.png

We'll try to dig into X-ray diffraction and surface composition for the next segment.

Edited by DMagic
links
Link to comment
Share on other sites

Try adding or changing the following fields. Also get rid of the actionGUIName field.


experimentAnimation = true
experimentWaitForAnimation = true //will wait for the doors to open before giving results
waitForAnimationTime = -1 //will wait for the duration of the animation
keepDeployedMode = 0 //will behave like the stock part, resetting the animation after resetting the experiment

showEndEvent = false
showStartEvent = false
showToggleEvent = true

Thanks! I'll try it out tonight.

~snip

Very interesting. These experiment posts are really cool.

Link to comment
Share on other sites

I am still playing with KSP 1.0.2, (with DM OS 1.0.4) I noticed that I cant retract Soil Moisture experiment once its deployed. (Clicking the button did nothing) IS this something that is fixed in a later version?

(Just launched a probe that deployed it in LKO, then flew all the way to Minmus, landed and returned to Kerbin with the experiment still deployed the whole way)

On a side note it looks like it DID stow itself when I hit Kerbin atmosphere.

Link to comment
Share on other sites

Okay, this is wierd, after I was forced to force-close KSP after running into the problem mentioned back here (went into map mode and back and Gilly vanished, then I couldn't get back to KSC), things decided to get glitchier.

On return, I EVA'd and collected the science, then suddenly the micro goo-canister decided to break when I retrieved data and it spit out this exception:


InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.Collections.Generic.List`1+Enumerator[ScienceData].VerifyState () [0x00000] in <filename unknown>:0

at System.Collections.Generic.List`1+Enumerator[ScienceData].MoveNext () [0x00000] in <filename unknown>:0

at DMagic.Part_Modules.DMModuleScienceAnimate.ResetExperimentExternal () [0x00000] in <filename unknown>:0

at BaseEvent.Invoke () [0x00000] in <filename unknown>:0

at UIPartActionButton.OnClick () [0x00000] in <filename unknown>:0

Then when I tried returning to the ship, this happened:

screenshot90_zpsuzqihmkk.png

Going to KSC and back cleared that, but the goo canister is still being broken in that it thinks no more samples can be collected:

screenshot91_zpsujtmrfgq.png

Output log: http://sta.sh/01ttiyn3l0cu

Game save: http://sta.sh/02dlbnl3re9o

Going to see if a game reload helps. Also, this is the first time I've ever seen an exception come from the goo canister. Maybe related to the issue linked?

Edit: Nope, the goo canister still thinks it has been used up when it hasn't, well, I know there isn't data in there because I removed it. The persistent file may be of help here I guess.

Edited by smjjames
Link to comment
Share on other sites

Okay, this is wierd, after I was forced to force-close KSP after running into the problem mentioned back here (went into map mode and back and Gilly vanished, then I couldn't get back to KSC), things decided to get glitchier.

On return, I EVA'd and collected the science, then suddenly the micro goo-canister decided to break when I retrieved data and it spit out this exception:


InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.Collections.Generic.List`1+Enumerator[ScienceData].VerifyState () [0x00000] in <filename unknown>:0

at System.Collections.Generic.List`1+Enumerator[ScienceData].MoveNext () [0x00000] in <filename unknown>:0

at DMagic.Part_Modules.DMModuleScienceAnimate.ResetExperimentExternal () [0x00000] in <filename unknown>:0

at BaseEvent.Invoke () [0x00000] in <filename unknown>:0

at UIPartActionButton.OnClick () [0x00000] in <filename unknown>:0

That's a bug in how it's handling collecting and resetting data from parts that can store multiple experiments. Though it looks like the error you saw was triggered when trying to reset the experiment from EVA; it would be easy to click the reset button when trying to click the collect button, given how terrible right-click menus are on EVA.

I'll have to go through and see if there are any other instances where it's trying to modify a list in a way that .net doesn't like.

Some persistent file editing should get the part working again. I can't say for sure right now which fields need to be adjusted, probably experimentNumber, Deployed, and maybe Inoperable.

Edited by DMagic
Link to comment
Share on other sites

I'd just like to say that this mod is what science parts in KSP *should* be. Representations of real space experiments, complexity in considering how to use them, and not all being super tiny. I love the laser experiment, when I activated it and the laser and camera sprung into action I was surprised and delighted.

Link to comment
Share on other sites

I've found a problem with the DMagic contracts, not sure if it's a new one or related.

Getting contracts to place satellites in specific orbits for a set period of time.

When quitting and restarting KSP the orbit and duration parameters of the contract get reset so they're no longer achieved.

Couldn't find anything in any log related to it.

Link to comment
Share on other sites

That is a nice idea. And I wonder if it could be made to work with resource scanning for mod radioactive resources?

That would work only for extremely localized, rover explorations. I meant a normal usage of the counter which is on like every probe ever launched. :)

You know, for van Kallen belts, etc. :)

Link to comment
Share on other sites

I'd just like to say that this mod is what science parts in KSP *should* be. Representations of real space experiments, complexity in considering how to use them, and not all being super tiny. I love the laser experiment, when I activated it and the laser and camera sprung into action I was surprised and delighted.

Thanks, I had a lot of fun making that laser animation, even if it is horribly complicated.

DMagic, this is still one of my very favorite parts mods, and makes my probe missions much more fun. A recent mission:

Excellent pictures again.

I've found a problem with the DMagic contracts, not sure if it's a new one or related.

Getting contracts to place satellites in specific orbits for a set period of time.

When quitting and restarting KSP the orbit and duration parameters of the contract get reset so they're no longer achieved.

Couldn't find anything in any log related to it.

I'll need more details for this. Is this a magnetic field survey contract? Those are the only contracts of mine that ask for any kind of specific orbit.

Will this mod get a Geiger counter in the future?

Possibly. I have in mind adding a lot of boring-looking, but interesting science experiments (most space instruments seem to consist of basically a box :P). Most of my parts have been made with one of the primary requirements being that they look interesting in some way.

A while back there was a [thread=120748]thread about overhauling how science collection works[/thread]. Agathorn hasn't been around for over a month, and the GitHub repo hasn't been updated in over two months. I've been mulling over ideas for this kind of science system overhaul since about the time I started on Orbital Science. I haven't contacted Agathorn yet, but a lot of what's included in RealScience is similar to ideas that I have had.

I've been poking around in it a bit, and thinking about to how to implement a working version of it (the existing release works, but not in a practical way; only really as a demonstration). Agathorn has some ideas written down in the project's wiki about how science instruments and experiments might work, but I'm not sure how practical some of it will be to implement. Some of the ideas about combining science data from multiple instruments might work better as contracts (and the way they are described is very similar to how the contract system is setup) than as a separate thing.

The system primarily changes how science is collected. Instead of the click once-per situation/biome, it allows for a great deal of customization in setting collection conditions. It also provides an interface for controlling everything, rather than right-click menus.

Most of all, it should remove some of the tediousness of how science collection currently works. Instead of getting into orbit and clicking every time you move over a new biome (or when something like Science Alert tells you to) you can setup experiments to just gradually collect data while in orbit (up to a defined limit), or while in flight, or near an asteroid. You can set requirements for physical conditions like g-force, orbital parameters, velocity, etc..., and there are many other types that can easily be added.

If Agathorn isn't going to continue development then I hope to be able to release a working version of it at some point.

Link to comment
Share on other sites

That would work only for extremely localized, rover explorations. I meant a normal usage of the counter which is on like every probe ever launched. :)

You know, for van Kallen belts, etc. :)

Well there's no reason it can't do both. DMagic already has parts that do dual duty as science experiments and ScanSAT parts. What I'm imagining is that the Geiger Counter might be configured to work like the stock Surface Scanning Module for selected mod resources.
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...