Jump to content

[0.25] [x] Science! v4.0 (2014-10-24) [Old thread]


Bodrick

Recommended Posts

I have it working. I have the correct ksp biomes showing and invalid biome - situations filtered out. The only problem is that the experiment update function seems really slow. I don't know if its because I have a lot of mods installed or something is wrong.

Link to comment
Share on other sites

I have it working. I have the correct ksp biomes showing and invalid biome - situations filtered out. The only problem is that the experiment update function seems really slow. I don't know if its because I have a lot of mods installed or something is wrong.

Could you share it please? Looks like the license allows derivatives, as long as you include the original license and credit where it is due. :) I don't have many mods on my game.. (like 5) I could give you a rundown of the speed on mine.

Link to comment
Share on other sites

Not really sure how to comply with the license conditions so if anyone does not like this I can always remove immediately. Please not this is just a quick hack and may be buggy. Just copy over original dll. https://mega.co.nz/#!5Z0H1Jzb!aWpkQfRVLqWIvBYl6TJWn4XkcHMf-GpwP-4GIg-8vxM

Edited by BeafSalad
Link to comment
Share on other sites

Not really sure how to comply with the license conditions so if anyone does not like this I can always remove immediately. Please not this is just a quick hack and may be buggy. Just copy over original dll. https://mega.co.nz/#!5Z0H1Jzb!aWpkQfRVLqWIvBYl6TJWn4XkcHMf-GpwP-4GIg-8vxM

To comply with the license you'll also need to provide the source code for your changes (bundling it along with the .dll is one easy way to do that). Plus maybe it'll give Bodrick a head start on officially updating this.

Aside - has anybody PM'd Bodrick? According to his profile, he still logs in to the forums daily, so it's not like he's not around... (come back Bodrick, we all love your mod!)

Link to comment
Share on other sites

  • 2 weeks later...
I have it working. I have the correct ksp biomes showing and invalid biome - situations filtered out. The only problem is that the experiment update function seems really slow. I don't know if its because I have a lot of mods installed or something is wrong.

It was also abominably slow when I tried it in 0.25, I also had a lot of mods though. But I don't see why the number of mods would change anything, I am guessing it's just some problem in the code?

Link to comment
Share on other sites

It was also abominably slow when I tried it in 0.25, I also had a lot of mods though. But I don't see why the number of mods would change anything, I am guessing it's just some problem in the code?

Just glancing at it, I have some suggestions:

IsUnlocked = ScienceExperiment.id == "evaReport" ||
ScienceExperiment.id == "surfaceSample" ||
ScienceExperiment.id == "crewReport" ||
PartLoader.Instance.parts.Any(x => ResearchAndDevelopment.PartModelPurchased(x) && x.partPrefab.Modules != null && x.partPrefab.Modules.OfType<ModuleScienceExperiment>().Any(y => y.experimentID == ScienceExperiment.id));

Just look at all that work this single line does, and likely every frame, for these three experiments. Replace that entire thing with ScienceExperiment.IsUnlocked.

And this one:

		public static List<ScienceData> GetOnboardScience () {
var onboardScience = new List<ScienceData>();
var vesselIds = new List<string>();
foreach (var v in FlightGlobals.Vessels.Where(x => x.loaded)) {
onboardScience.AddRange(v
.FindPartModulesImplementing<IScienceDataContainer>()
.SelectMany(y => y.GetData() ?? new ScienceData[0]));
vesselIds.Add(v.id.ToString().ToLower().Replace("-", ""));
}

// :|
var node = new ConfigNode();
HighLogic.CurrentGame.flightState.Save(node);
var vessels = node.GetNodes("VESSEL");

onboardScience.AddRange(vessels.SelectMany(x => x.GetNodes("PART")
.SelectMany(y => y.GetNodes("MODULE")
.SelectMany(z => z.GetNodes("ScienceData"))
.Where(z => !vesselIds.Contains(x.GetValue("pid")))
.Select(z => new ScienceData(z)))));

return onboardScience;
}

It's possible I'm misunderstanding the intent here. I would assume experiments would only deploy for the active vessel. If Bodrick wants loaded vessels to deploy their experiments, there are better ways of going about this. I'd rip this out and replace it with a cached list of IScienceDataContainers

ScienceAlert does a couple of optimizations to avoid doing a bunch of work every frame:

  • Cache a list of all IScienceDataContainers on the vessel
  • Each experiment observer keeps a list of all ModuleScienceExperiments that are directly related to it.
  • These lists are updated when the vessel changes (switched, destroyed, modified, docked to something etc)
  • Every frame, generally only a single experiment state gets checked. Checks are run more often only if the player exceeds a certain TimeWarp threshold

This is all just glancing through the online repository so it's possible these methods aren't as expensive as they potentially could be, but there are plenty of opportunities to improve performance here

Link to comment
Share on other sites

The reason it is slow is because of the experiment update function updates every experiment and gets the science data of every vessel. That is fine if you are at the space centre and are just checking the list but when you are flying and filtering active vessel all you are interested in the ship you are flying. I have noticed a bug as well in the way it filters the experiment list of the active vessel. When I was orbiting the Mun it was showing my current situation and biome but the experiments were not showing for some biomes. I think it was eva report while flying low over Nortern Crater or something.

To be honest I have not looked at it for a while as it was doing my head in but it sure is in need of optimisation. At the moment I am just playing the game and are using science library but I do prefer the UI on this one.

Link to comment
Share on other sites

Been working on this tonight and got all biomes working with current vessel.

https://mega.co.nz/#!kM9zWJIB!dT8wJ4OpOZPVeNftdOiAIiTbBCV3skG0gch3OnZgDec

Update:

Sorry guys I just noticed now there is a problem with some KSC biomes. Will work on it tonight.

Ok seems that it is working now. I tried to filter out some KSC biomes that show twice but it did not like that and didn't work so right now on the full list you will see duplicate entries for Launch Pad, Runway and KSC. The previous problem that I noticed with some experiments in various biomes of the Mun not being filtered for the current situation is now fixed. For example eva report while in space over Mun's Midlands would work but not for Twin Craters. I have not tested every biome but hopefully it will work.

Edited by BeafSalad
Link to comment
Share on other sites

Hi Beaf, Thanks for trying to get this working until Bodrick reappears. I installed it yesterday afternoon and I'm getting an empty [X]Science window when I view it. It just shows the title and nothing else. I was in the KSC main window (where you select which building to go to) when I saw this. Any ideas on what I should look for?

Link to comment
Share on other sites

Fingers crossed hoping that Bodrick updates this. I really enjoy this UI over the stock research archives.

Of all the "science library" type mods, this one has done it in the way most usable in-game and in-flight. It was especially useful for Better Than Starting Manned since the early struggle for science points made finding each and every biome crucial to even get to Mun/Minmus.

Link to comment
Share on other sites

Thanks for picking this up for the time being beafysalad gonna test your patch version tonight. Hopefully this will fulfill my OCD completionist tendencies.

Having to constantly switch to space center to check and with it only display already acquired types of science is really annoying.

Link to comment
Share on other sites

Hi Beaf, Thanks for trying to get this working until Bodrick reappears. I installed it yesterday afternoon and I'm getting an empty [X]Science window when I view it. It just shows the title and nothing else. I was in the KSC main window (where you select which building to go to) when I saw this. Any ideas on what I should look for?

After making changes I am testing this in windows on a KSP install with just this addon and two others so that it is quick to load. On my test it worked just fine but then I tested it on my main career game which is linux64. It didn't work so I copied dll from the windows test install and it worked, I don't know why as the dll in the zip should be the same. I did redo the zip and I am sure I uploaded it, I just tested the zip from the mega link in the previous post and it was fine.

The problem with this version is that if you have a lot of science addons and I do have a s**t load in my linux install it gets really slugish. I have been working on that over the last day to try and remedy that. Basically it is just a seperate list of experiments for just the active vessel and rather than all experiments being updated when science is collected it is just the few that you have on the active vessel. I have it working but the list not updating correctly when science is collected plus it would need to be tested in my linux install to make sure that there is some speed improvements.

Link to comment
Share on other sites

  • 2 weeks later...

can someone explain to me how to install this "4.1" update, I looked through the 4.1 source, found the .dll and the .version and overwrote both of them in a 4.o install in 0.90, but ksp still tells me that its in 0.25 and to use another version

Link to comment
Share on other sites

  • 2 months later...

Yes I can.

I have it compiling and apparently working. Also it doesn't seem anywhere as slow as it was.

I haven't had a chance to really test it but it seems to be working for KSC/Shores/Grasslands. I can also view and filter all the other stuff.

I'll give it a bit more of a go and then package it up.

I am a bit worried about Bodrick / Forum mods / whatever license this had.

Not keen on getting myself banned or whatever. If anyone has any advice I'd love to hear it.

I tried a PM to BeefSalad but didn't get a reply. If I really have got it working I guess I don't need him.

Think I ought to PM Bodrick too out of politeness.

Anyhow I also love this mod. It is way better than the stock Science Lab thing. I love the sense of achievement it provides. Bodrick really did get the thing about right. I'll be very happy to take it on if I can just figure out how to get it released properly.

- - - Updated - - -

I sent a PM to Brodrick, see what he says.

The license is https://creativecommons.org/licenses/by-nc-sa/4.0/ ([x] Science! is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International license.)

I have no idea about those things but it actually looks OK to me.

Link to comment
Share on other sites

Hi all,

Sorry I haven't had time to update this mod recently - lots of RL stuff getting in the way, and I can't find the time to give this the amount of work it needs for me to be happy with it.

If anyone wants to carry on with this mod (thanks to everyone who kept it going without me!) - please feel free. I've had a few people message me about the license - the general gist of it is that I'm happy to let anyone do whatever they want with my original code except sell it, pass it all off as their own, or change the license.

If the community gets behind a fork of my code by someone for 1.0+ that they're all happy with, feel free to continue using the [x]Science! name. However, don't start squabbling over calling dibs on the name or anything silly like that.

All the best.

Link to comment
Share on other sites

Hi all,

Sorry I haven't had time to update this mod recently - lots of RL stuff getting in the way, and I can't find the time to give this the amount of work it needs for me to be happy with it.

If anyone wants to carry on with this mod (thanks to everyone who kept it going without me!) - please feel free. I've had a few people message me about the license - the general gist of it is that I'm happy to let anyone do whatever they want with my original code except sell it, pass it all off as their own, or change the license.

If the community gets behind a fork of my code by someone for 1.0+ that they're all happy with, feel free to continue using the [x]Science! name. However, don't start squabbling over calling dibs on the name or anything silly like that.

All the best.

Thank you!

- - - Updated - - -

[x] Science! for KSP V1.0 - Is here

http://themoose.co.uk/ksp/downloads.html

Direct link: http://themoose.co.uk/ksp/x-science-v4.1.zip

That is built and fixed by Z-Key Aerospace, any bugs are my responsibility. [x] Science! is originally by Bodrick.

LICENSE: Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License

Until we get some use feedback please be careful with it. If you download it - please could you let us all know how you get on with it?

Link to comment
Share on other sites

Didn't even know this mod existed! Like it alot! Thanks for updating it. :)

Minor feedback, in the Blizzy Toolbar button selection window the title for it is "test". Has no impact on functionality at all, purely aesthetic.

Link to comment
Share on other sites

Thank you!

[x] Science! for KSP V1.0 - Is here

I'm glad this mod still exist and you are taking it into 1.0, thank you!

Would be nice if this get added to CKAN

http://forum.kerbalspaceprogram.com/threads/100067-The-Comprehensive-Kerbal-Archive-Network-%28CKAN%29-Package-Manager

https://github.com/KSP-CKAN/CKAN-support/wiki/Adding-a-mod-to-the-CKAN

Link to comment
Share on other sites

I'm glad you all like this. I'll get a GitHub for it and maybe start a new thread. Yes, I'll have a look at CKAN too.

It will be next week though. I'm gonna be away-from-keyboard for a few days. In a tent.

Re "test" - That button has been like that forever! No one has ever mentioned it before. Still, I don't think it will be a hard fix :)

I'm pretty sure you guys can manage with it like it is for a while. I've got a bit of real-life to sort out then I will get back to this mod.

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