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 Edited 16 hours ago by ScienceDaemon typo in 1.0.1 Quote Link to comment Share on other sites More sharing options...
Rakete Posted Saturday at 09:31 PM Share Posted Saturday at 09:31 PM 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 Sunday at 11:13 AM Author Share Posted Sunday at 11:13 AM 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 19 hours ago Share Posted 19 hours ago 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 18 hours ago Author Share Posted 18 hours ago 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 16 hours ago Author Share Posted 16 hours ago 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...
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.