Jump to content

[1.12.x] Experiments Take Time


Recommended Posts

Posted (edited)

Experiments Take Time

A simple mod to make experiments which us the ModuleScienceExperiment module take time.

The following are the default values for the various stock experiments:

 

Part name Experiment                timeToRun maxTimeToRun     delayBeforeAbort
InfraredTelescope infraredTelescope         1 day 30 days 15 secs
sensorAtmosphere     atmosphereAnalysis          1 hour   15 secs
GooExperiment         mysteryGoo                 1 hour 1 day 15 secs
Magnetometer         magnetometer             1 hour 1 day 15 secs
science_module mobileMaterialsLab         1 day   15 secs
sensorAccelerometer seismicScan                 1 day   15 secs
sensorBarometer         barometerScan             1 day   15 secs
sensorGravimeter     gravityScan                 1 day   15 secs
sensorThermometer temperatureScan     15 secs
        15 secs
  crewReport                 Instantaneous   15 secs
         


All unlisted parts with experiments (other than crew reports)            10 minutes

While an experiment is running, the amount of time left before completion is show in the PAW

An experiment can only be started if the situation allows.  While in physics range, the situation is 
checked every second.  If a disallowed situation occurs for more than the delayBeforeAbort value, the research is terminated and will have to be restarted

When the research time is done the situation is checked to determine which situation the 
experiment/research will apply to.  So, if you have an experiment such as Mystery Goo, which can 
be run both in low and high orbit, and you start it in low orbit and then move to a high orbit, the 
high orbit situation will be the one to be completed.

Note that checks are not done on unloaded vessels

As of now, there are no displays to show any active experiments which are on unloaded vessels

Dependencies

Availability

 

To add custom configs, you need a patch which will look like this:

@PART[partName]:HAS[@MODULE[ModuleScienceExperiment]]
{
    @MODULE[ModuleScienceExperiment]
    {
        @name = ModuleTimedScienceExperiment
        timeToRun = 1d    // 1 day
        delayBeforeAbort = 15 // How many seconds the vessel can leave the defined situations
        maxTimeToRun = 30d // optional, 1 month of 6 hour days
    }
}

Replace the "partName" with the name of the part being changed.

Note that the timeToRun, delayBeforeAbort and maxTimeToRun can have an optional suffix of one the following:
    s    seconds (optional, if no suffix specified, will assume seconds) 
    m    minutes
    h    hours
    d    days

If maxTimeToRun is specified, then when the experiment is started, a random time will be calculated to be between the timeToRun and maxTimeToRun

delayBeforeAbort  specifies how many seconds the vessel can leave the allowable situations before the experiment is canceled

There is a commented out section for the Crew Reports, to enable them, just remove the double slashes at the beginning of the line

Edited by linuxgurugamer
Link to comment
Share on other sites

Thank you :) I waited for something like that since the "science only" config of Kerbalism doesn´t work so well in combination with another LS mod. I loved the science feature and the fact that science takes time, now i can have this again without bugging out my whole game.

Link to comment
Share on other sites

On 6/3/2022 at 11:56 PM, Wilds said:

I usually use hotkeys (1-9) for science, and am noticing that hotkeys are bypassing this mod. Love the idea!

Interesting.  So you use the experiment action to trigger the experiment.  I’ll see what I can do.

On another note, next release will have a simple window to show you what experiments are running in any vessels, this will help you keep track of long-running experiments.

Link to comment
Share on other sites

4 hours ago, linuxgurugamer said:

On another note, next release will have a simple window to show you what experiments are running in any vessels, this will help you keep track of long-running experiments.

Awesome.  This is definitly a non kerbalism great alternative.

Based on the above, will science time still accumulate even if the vessel is packedso if you go back later it will have completed?

Link to comment
Share on other sites

27 minutes ago, theJesuit said:

Awesome.  This is definitly a non kerbalism great alternative.

Based on the above, will science time still accumulate even if the vessel is packedso if you go back later it will have completed?

Yes

Link to comment
Share on other sites

New release, 0.0.1

  • Added tracking window, to show all experiments which are active
    • Added skin toggle button
    • Added button to close the window (x in upper right)
  • Fixed Events bypassing mod (ie:  Adding experiment to an event and triggering by a key)
  • Added displaying screen message when experiment started

New dependencies

  • ToolbarController
  • ClickThroughBlocker

 

Link to comment
Share on other sites

Our Guru, who art on Linux, gameful be thy design...

The urge to suggest variations on the times is strong, but knee jerk :)

Can I ask what sort of scope one has for variation? I mean, would it be possible to build on this a way to have tiers of the different experiments such as a dumb level 1 thermometer that needs 5s to take a reading (if it takes a day to read a thermometer, I'm never going to the drs office when I have indigestion again)? Can the amount of science a particular "study" gives be controlled, eg a device gives 5% if you get a minmum 5s sampling, but needs 60s+ to reward10%, 5 minutes to get 20, 1 day for 100%. { t<5 :- 0%; 5<=t<60 :- 5%; 60<=t<300 :- 10%; ... } (In gameplay terms: you can get flyby measurements, aerobraking measurements, and study measurements)

When most people think of the apollo landings their first mental image is either amstrong+flag or an astronaut in mid-stride carrying some complex looking piece of equipment: the latter was them deploying science experiments.

I think a lot of kerbal "player"s were expecting to land on planets and do ... something. Instead of land on planets, place a flag and think "next time I won't bother getting off the ladder".

The single most interesting science experiment in kerbal to date was the seismology one, which varied results based on how many probes you dropped, so you actually felt like you were even remotely involved in the science.

It would be awesome to have more science options that require you to actually spend time on the surface >doing<: "take 5 x 5 minute readings, 100m apart" with a +/-1m window. Surveying ... coordinating two kerbals to make measurements... ZOMG.

 

Thanks so much for this mod!

Link to comment
Share on other sites

Hello! I apologize in advance for my English!)

Is it possible to add to the experiments, in addition to the requirement for duration, also the requirements for the resource (electricity)? To create a task to provide the apparatus with the necessary amount of energy to carry out the entire series of experiments installed on it?

Link to comment
Share on other sites

Great mod. I noticed some (maybe) unexpected behavior related to the delayBeforeAbort. It doesn't really abort when we change situation. I tried to start a pressure scan while in high atmosphere (60km) going towards space. 15 seconds after I reached the 70 km mark, the experiment didn't automatically reset. Same thing when going from space low to space high. The only time I noticed an automatic reset, was when running a Magnetometer Boom while in space 70(ish) km and entering the atmosphere, where the experiment was abruptly interrupted.

Another thing I noticed is that we should always have the vessel loaded when the countdown timer ends. If it does while we are e.g. in the tracking station, the science dialog doesn't pop up, and when loading the vessel we do not have a "view stored data" option, the only thing we can do is resetting the experiment and running it again.

Other than that, everything worked as expected. This is a great mod for users who do not want to install kerbalism. 

I have a suggestion to make, more or less in line with one of the points @kfsone made. If there is a way to manipulate the science generated upon running the experiment, we could have the option to instead of resetting the experiment, to actually completing it, but with the science gained being proportional to the time spent running. E.g. when activating an experiment which takes 30 minutes to complete, while in low orbit, and after 5 minutes running we exit to high orbit, we would gain the "experiment X while in low orbit of body Y" which would normally give 100 science points, now will give 100 * 5 / 30 = 16. That would give us a reason to build an orbiter instead of just flybies to get science from other bodies. That, of course, assuming we can manipulate the output of the science completion dialog.

Link to comment
Share on other sites

This is a mod I've wanted for quite a while so thank you for making it. 

I do have a question about possible expansion though, I use Dmagic Orbital Science for a lot of my science experiments. I tried modifying your recommended patch for additional parts to apply to the DMModuleScienceAnimate module those parts use. It kind of worked for some parts though instead of it using the time I set, it used a random time (every time I reset and reran the experiment the run time was significantly different). I'm assuming that the cause is the fact that I'm trying to do something that the mod was not designed to do so it can't handle the differences between the 2 modules.  If this is true is there any chance that the mod could be expanded to also work with DMagic's DMModuleScienceAnimate?

Link to comment
Share on other sites

1 hour ago, Sarcanth said:

This is a mod I've wanted for quite a while so thank you for making it. 

I do have a question about possible expansion though, I use Dmagic Orbital Science for a lot of my science experiments. I tried modifying your recommended patch for additional parts to apply to the DMModuleScienceAnimate module those parts use. It kind of worked for some parts though instead of it using the time I set, it used a random time (every time I reset and reran the experiment the run time was significantly different). I'm assuming that the cause is the fact that I'm trying to do something that the mod was not designed to do so it can't handle the differences between the 2 modules.  If this is true is there any chance that the mod could be expanded to also work with DMagic's DMModuleScienceAnimate?

I took a look at the config file and it seems you should add the config for custom parts before the line where it says "All other generic ModuleScienceExperiments get caught here" almost at the end of the file. So it runs before the generic science parts patch.

Link to comment
Share on other sites

5 hours ago, mateusviccari said:

I took a look at the config file and it seems you should add the config for custom parts before the line where it says "All other generic ModuleScienceExperiments get caught here" almost at the end of the file. So it runs before the generic science parts patch.

Hmm, I had assumed that a separate cfg should be used for my edits as it's generally a bad idea to go around modifying the core files of a mod (but then I just fix computers, I'm not a programmer it's all Greek to me.) I'll give it a whirl later and see if it works. 

Edited by Sarcanth
Link to comment
Share on other sites

5 hours ago, ttikkoo said:

Hi, just wanted to give a heads up on a tiny issue: the table in OP states GooExperiment has a timeToRun of 1 hour but the config file lists it as 1s. 

BWKf0Hn.png

Thanks, I missed that one when finishing up (was using the 1s for testing)

for now, change the "s" to an "h", and I'll get an update out soon

Link to comment
Share on other sites

  • 2 months later...

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.

 Share

×
×
  • Create New...