ScienceDaemon Posted February 12 Share Posted February 12 (edited) Tired of constantly having to manage data for mobile labs on stations you have flying around? Automatic Lab Housekeeper is for you. Let's set the stage, you have a few space stations in Kerbin's SOI, a ship currently in orbit around Duna, waiting for a transfer window back, and a ship currently on its way to Eeloo. Each of them has a mobile lab on-board, turning data into science. The transfer to Eeloo takes at least another three years and you can't wait to finally go explore it, but hang on. With your labs eventually filling up with science, you gotta stop warping every X amount of days, transmit science home and fill the lab back up with data you have stored. Using more efficient modded labs and well-seasoned scientists, that amount of days can easily go below 10. That does not sound fun, and I don't think I have to tell you that it isn't. When warping (or not), every chosen amount of in-game days, Automatic Lab Housekeeper will check any loaded or unloaded vessels for labs it might have on-board, transmit its science back home, and fill up its data whenever there's space. As this mod checks for the Science Lab module instead of part names, its functionality shouldn't have an issue with mods that add new science lab parts into the game (like Nertea's Stockalike Station Parts Expansion). In detail, the mod does the following: In Flight Mode: Checks loaded and unloaded vessels every chosen amount of in-game days, regardless of time-warp In Tracking Station & Space Center: Checks unloaded vessels every chosen amount of in-game days, regardless of time-warp Looks for module ModuleScienceLab on-board vessels For loaded vessels: Checks if there is science >= 1 on-board. If there is science, it transfers it (as whole numbers, leaving the rest in the lab) to R&D For unloaded vessels: Using the module ModuleScienceConverter and part cfg data, simulates how much science has been created since the last update, if science has accumulated, transfers it to R&D Checks if an ExperimentStorageUnit has been selected for this lab. If so, calculates data size for all experiments and checks if any or all of them fit into the Lab, if so, pulls data into lab. WHEN FIRST INSTALLING THE MOD, ALL DESIRED LABS HAVE TO BE LOADED AT LEAST ONCE (this is because ModuleManager only applies changes to part configs and not unloaded vessels) Example of what receiving science looks like: The settings for in-game intervals and enabling of AutomaticLabHousekeeper can be performed through the game difficulty settings menu For each loaded Lab, a Part Action Window exists, in which the automatic transmission and automatic data pulling can be changed individually When pressing the "Select Experiment Storage Unit" Button, a Part containing module ModuleScienceContainer may be selected from which experiment data will be pulled This mod is currently localized in English and German Dependencies ModuleManager Considered for future implementation are (in order of priority): Implementation of Strategia's scientist experience level enhancements Checking if unloaded vessel has an established CommNet connection to home. Checking if unloaded vessel has enough electricity on-board. Adding a tab into game difficulty settings that includes CommNet and electricity settings Download via CKAN Spacedock Installation Simply merge the downloaded zip with the GameData folder Source GitHub License MIT Known Issues When using Strategia's Scientist Focus, the enhanced Scientist Experience isn't considered in the background simulation of science When first installing mod, all labs have to be loaded once for AutomaticLabHousekeeper to implement its module (could be changed with injection in the future, risky approach however) When trying to report a new issue, please enable debug mode in game difficulty -> AutomaticLabHousekeeper settings and provide KSP.log This is my first mod, so I hope you'll like it. Naturally there might still be some additional issues. Edited February 19 by ScienceDaemon mod added to CKAN Quote Link to comment Share on other sites More sharing options...
theJesuit Posted February 14 Share Posted February 14 What a great idea! I'm looking forward to seeing how this develops. Peace. Quote Link to comment Share on other sites More sharing options...
ScienceDaemon Posted February 16 Author Share Posted February 16 (edited) Happy to announce the following changes have been added in the newest versions: alpha-1.1.1 Added Localization (currently en_us and de_de) Added settings menu in game settings Added ability to turn ALH on and off globally Added customizability for in-game days interval Added debug mode (for detailed debug messages) alpha-1.2 Added Part Action Window Tab to labs for Automatic Lab Housekeeper Added new Module for all parts containing ModuleScienceLab, containing Automatic Lab Housekeeper settings Added description into lab parts in VAB/SPH Added dependency on ModuleManager Added Automatic Data Pulling for loaded and unloaded vessels alpha-1.2.1 Fixed incorrect data calculation issue (data calculation for data pulling resulted in lower values than in-game) beta-1.0 Fixed incorrect science accumulation simulation for unloaded vessels Fixed issue that ALH sometimes takes a while to start Transmission/Data-Pulling Routine when previously having loaded a quicksave Fixed incorrect initialization during scene change and quickload 1.0.0 Added version file for CKAN Mod has been added to CKAN 1.0.1 Restructured code to support multiple on-board labs Removed initialization in Sandbox Mode Fixed compatibility issue with Mk3Expansion 1.0.2 Fixed scientist recognition error some users have been reporting Added more debug lines Edited April 7 by ScienceDaemon update for 1.0.2 Quote Link to comment Share on other sites More sharing options...
Rakete Posted March 8 Share Posted March 8 How does the mod behave of there are more than one lab on the vessel? Is every lab treated individually? And does the transmission happen at once? In flight it takes in stock mechanism almost forever to transmit data especially when you use larger modded labs with greater input and output storages. Quote Link to comment Share on other sites More sharing options...
ScienceDaemon Posted March 9 Author Share Posted March 9 Interesting question. I didn't consider the possibility of multiple labs on-board the same vessel. Looking at the code, the transmission and data pulling might still work with multiple labs, but there are a few functionalities that will not work properly, e.g. if one of the labs is disabled, ALH won't process any of them. I will fix this as soon as I find the chance. When it comes to transmission, yes, the transmission is instant. The TransmitScience() method does not exist for unloaded labs, so I just decided to default to removing science from the lab and add it to R&D… which is instant. Quote Link to comment Share on other sites More sharing options...
DragonRoco Posted March 11 Share Posted March 11 I'm amazed this wasn't a mod already. It's a really, really good idea. I am however running into issues with the Mk3 lab from Mk3 expansion, it causes an ArgumentNullException. Repo'd on an install with the following mods: Mod DLLs found: Stock assembly: Assembly-CSharp v0.0.0.0 ModuleManager v4.2.3.0 AutomaticLabHousekeeper v1.0.0.0 B9PartSwitch v2.20.0.0 / vv2.20.0 Folders and files in GameData: AutomaticLabHousekeeper B9PartSwitch CommunityResourcePack Mk3Expansion Stock folder: Squad ModuleManager.4.2.3.dll Repo steps: Give lab data and start research Time warp past the threshold defined in the settings (left as stock in this case). Data is not automatically transmitted back. The full log is here (had to remove the loading section to fit on pastebin, but it's a fresh testing install from CKAN). Lab Testing is a vehicle with the Mk3 lab, Lab Testing 2 is a vehicle with the stock lab. The core of the error seems to be: [LOG 22:36:59.130] [AutomaticLabHousekeeper] Checking science for ALL vessels... [LOG 22:36:59.130] [AutomaticLabHousekeeper] ============================================================ [LOG 22:36:59.130] [AutomaticLabHousekeeper] Simulating Science for Unloaded Lab in Vessel Lab Testing [LOG 22:36:59.130] [AutomaticLabHousekeeper] dataStored 383.3242 [LOG 22:36:59.130] [AutomaticLabHousekeeper] storedScience 38.40623 [LOG 22:36:59.131] [AutomaticLabHousekeeper] isActivated True [LOG 22:36:59.131] [AutomaticLabHousekeeper] scienceCap 1000 [EXC 22:36:59.132] ArgumentNullException: Value cannot be null. Parameter name: value System.Number.ParseSingle (System.String value, System.Globalization.NumberStyles options, System.Globalization.NumberFormatInfo numfmt) (at <9577ac7a62ef43179789031239ba8798>:0) System.Single.Parse (System.String s, System.Globalization.NumberStyles style, System.Globalization.NumberFormatInfo info) (at <9577ac7a62ef43179789031239ba8798>:0) System.Single.Parse (System.String s) (at <9577ac7a62ef43179789031239ba8798>:0) ALH.AutomaticLabHousekeeper.SimulateScienceProcessingForUnloadedLab (Vessel vessel) (at <018955d84aeb4db388fdab0659ecf921>:0) ALH.AutomaticLabHousekeeper.ProcessScienceForAllVessels () (at <018955d84aeb4db388fdab0659ecf921>:0) ALH.AutomaticLabHousekeeper+<DailyScienceCheck>d__6.MoveNext () (at <018955d84aeb4db388fdab0659ecf921>:0) UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <12e76cd50cc64cf19e759e981cb725af>:0) UnityEngine.DebugLogHandler:LogException(Exception, Object) ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object) UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object) [LOG 22:36:59.133] [UIApp] OnDestroy: Contracts This error also stops any other labs from being processed in the background. When I load Lab Testing (Mk3 lab) it does transmit back science, but it's of a low value and the lab still has remaining science in it's buffer. It seems that the math that calculates the science to transmit does not behave correctly. Lab Testing 2 (stock lab) does then transmit back data fine, even when it is still unloaded (Lab Testing was on the mun, Lab Testing 2 on minimus) Let me know if you need anything else! Quote Link to comment Share on other sites More sharing options...
ScienceDaemon Posted March 11 Author Share Posted March 11 Yeah, the issue seems to be quite simply that the Mk3Expansion mod does not include the dataProcessingMultiplier variable in its lab's part config. That's a variable needed for calculating the amount of accumulated science. I'm surprised that the Mk3Expansion's lab works normally, even without ALH installed, since KSP needs that variable as well, for science processing. My guess is that KSP just defaults to a certain dataProcessingMultiplier value if none are provided. I can do the same thing for ALH and whip up a quick fix that defaults to a certain value if none are provided. Thanks for pointing it out. Quote Link to comment Share on other sites More sharing options...
ScienceDaemon Posted March 11 Author Share Posted March 11 The Mk3Expansion compatibility issue and multiple on-board labs issue have been fixed in the latest update 1.0.1 Quote Link to comment Share on other sites More sharing options...
DragonRoco Posted March 12 Share Posted March 12 Yep, my Mk3 lab is now working perfectly with the 1.0.1 release, thanks! Quote Link to comment Share on other sites More sharing options...
Rakete Posted March 13 Share Posted March 13 On 3/9/2025 at 12:13 PM, ScienceDaemon said: Interesting question. I didn't consider the possibility of multiple labs on-board the same vessel. Looking at the code, the transmission and data pulling might still work with multiple labs, but there are a few functionalities that will not work properly, e.g. if one of the labs is disabled, ALH won't process any of them. I will fix this as soon as I find the chance. When it comes to transmission, yes, the transmission is instant. The TransmitScience() method does not exist for unloaded labs, so I just decided to default to removing science from the lab and add it to R&D… which is instant. This usecase is relevant if two sciencelab-equipped rendez-vous and dock with each other... otherwise i wouldn't build multi-lab-vessels on purpose. But it might be a edge usecase that might be advisable to be dealt with, to avoid crashes etc. Quote Link to comment Share on other sites More sharing options...
Rakete Posted March 16 Share Posted March 16 Okay... for me the Mod doesn't work. The science counter at KSC does not increase at all. When i switch to the science ship with the lab, all processed science data is set to zero and is counting up. The transmission seems not to happen. The menue buttons at the lab and in the settings are there, so the mod is correctly installed. I use a vessel with the big cronus centrifuge by nertea (with a bit increased processed science data storage (5000). In timewarp at KSC there also no messages popping up, saying that Science was received from the vessel as your screenshots show. Automatic transmission was activated at the vessel, and also the pulling of data from experiment storage was enabled, as you described. Here my debugging data: https://www.filemail.com/d/nlemadkwexkcxnr Quote Link to comment Share on other sites More sharing options...
ScienceDaemon Posted March 18 Author Share Posted March 18 That is really odd. There are multiple issues here. Apparently ALH doesn't recognize your scientists as scientists and therefore doesn't simulate any science. To your knowledge, do you have any mods installed that might mess with Kerbals, their titles, or their skills? Looking through your installed mods that get recognized, I didn't immediately find anything that might interfere with that. This issue could also be caused if there are no scientists in the lab in the first place, but I'm assuming you made sure there are. About the issue of transmission not being performed in-flight. I think it could be because you might have some mods installed that interfere with the way the day length is calculated. Currently I just check whether Kerbin time or Earth time is used and divide the recorded time by either 6 hours or 24 hours, then check in that interval of game time. However I tried to reproduce this issue with Real Exoplanets, Kopernicus and OPM installed with no luck so far. Could you provide your .ckan file? Then I can try debugging with your personal modpack. Also in the future, please enable debug mode in the ALH game difficulty settings when submitting log files... unless you did enable it, then we apparently have additional bugs. Quote Link to comment Share on other sites More sharing options...
Rakete Posted March 18 Share Posted March 18 (edited) No I don't have any mods, that do stuff to my Kerbals or the labs. The only science relevant stuff, that I have, is Nerteas Near and Far Future and station parts mod, that come with new labs, but they use stock science mechanics. Most of my mods are part mods, visuals, BDA+, etc. Nothing else... the only thing, that does a lot of fixes (maybe science stuff too) is KSP Community Fixes by Gotmachine. My Ksp Install uses the normal 6h-day. No Realscalesolarsystem or somthing like that. Normal Kerbin. I tried timewarping in KSC-View but no science transfer happened. So i was not in the flight scene. And yes, the lab has currently 3 Kerbals in it. Without the mod installed science is created and can be harvested manually as vanilla ksp has implemented it Edited March 18 by Rakete Quote Link to comment Share on other sites More sharing options...
ScienceDaemon Posted March 21 Author Share Posted March 21 That is unfortunate. I haven't been able to reproduce any of your issues, even with KSP Community Fixes, Planet Mods, or anything else that I thought might look suspicious for ALH, installed. Short of you providing your entire game files for me to test, I don't know where to go from here. Quote Link to comment Share on other sites More sharing options...
Rakete Posted March 23 Share Posted March 23 (edited) I can offer a whole mod list if this helps (screenshot of the folder)... or otherwise try to compress the whole gamedatafolder into three or more archives, if this helps... Edited March 23 by Rakete Quote Link to comment Share on other sites More sharing options...
Rakete Posted March 23 Share Posted March 23 (edited) Here the full mod list: Ignore the crossed out folders, as they contain just some of my own Configs for e.g. KerbalKonstructs and they change some parts of mods... but nothing science related. Edited March 23 by Rakete Quote Link to comment Share on other sites More sharing options...
pbristow Posted April 3 Share Posted April 3 On 3/18/2025 at 6:42 PM, Rakete said: No I don't have any mods, that do stuff to my Kerbals or the labs. The only science relevant stuff, that I have, is Nerteas Near and Far Future and station parts mod, that come with new labs, but they use stock science mechanics. Most of my mods are part mods, visuals, BDA+, etc. Nothing else... the only thing, that does a lot of fixes (maybe science stuff too) is KSP Community Fixes by Gotmachine. My Ksp Install uses the normal 6h-day. No Realscalesolarsystem or somthing like that. Normal Kerbin. I tried timewarping in KSC-View but no science transfer happened. So i was not in the flight scene. And yes, the lab has currently 3 Kerbals in it. Without the mod installed science is created and can be harvested manually as vanilla ksp has implemented it Excellent bit of issue-reporting/clarification, there. Very thorough, and very detailed. I can't help you with your problem, but I can say you seem (to me) to be a bug-hunter's dream of a user! =;o} P.S. thankyou, ScienceDaemon, for this mod; and for the work you have put/are putting into tackling Rakete's problem. Quote Link to comment Share on other sites More sharing options...
stephensmat Posted April 4 Share Posted April 4 Works perfectly on my game. I've been waiting for something like this since I launched my first Orbital laboratory. Many thanks. Quote Link to comment Share on other sites More sharing options...
Sanidi Posted April 4 Share Posted April 4 Hey @ScienceDaemon I got the exact same bug as @Rakete Here's my log: https://www.filemail.com/d/ajoebkowwutiheu Mods installed: https://ibb.co/nMVw78qZ Thanks Quote Link to comment Share on other sites More sharing options...
ScienceDaemon Posted April 5 Author Share Posted April 5 Yes, it seems the scientists don't get recognized in this case as well. But at least your loop is active with regular game time. Indulge me with trying it with this dll? I adjusted the scientist recognition logic. https://www.filemail.com/d/vbhvuuapgmsxlnp Also remember to activate debug mode in ALH game settings when submitting log files. When enabling debug mode, note that settings are generally bound to saves, so when you enable debug mode and load a quicksave, the settings will reset to the settings in the quicksave. Quote Link to comment Share on other sites More sharing options...
Sanidi Posted April 6 Share Posted April 6 Just tested the DLL ... it works ! Thank you ! If ever it helps you, here's my log with the mod now working: https://www.filemail.com/d/tavzndqreqhbdmg Quote Link to comment Share on other sites More sharing options...
ScienceDaemon Posted April 7 Author Share Posted April 7 Perfect! I'll whip up a new release... Thanks for testing it Quote Link to comment Share on other sites More sharing options...
Sanidi Posted Tuesday at 08:09 PM Share Posted Tuesday at 08:09 PM Out of curiosity what was the issue? Quote Link to comment Share on other sites More sharing options...
ScienceDaemon Posted Tuesday at 10:56 PM Author Share Posted Tuesday at 10:56 PM When simulating science for an unloaded vessel, i use the skill level of each scientist on-board. The scientists used to get recognized by checking for the protoModuleCrew.experienceTrait.Title and checking whether or not it is equal to "Scientist". Now I check whether the protoModuleCrew.experienceTrait.Effects containts "ScienceSkill" Essentially, instead of checking whether the Kerbal is called "Scientist", i check whether or not it has the "Science Skill" or not. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.