Jump to content

Kuriosity Science [v0.1.3 for KSP2 v0.2.1]


Cadestronaut

Recommended Posts

Kuriosity Science
Kurious events that inspire our kerbals to complete some science!

Kuriosity Science on SpaceDock

Also available on CKAN!

https://github.com/Cadestronaut/KuriosityScience

Balance and other feedback most welcome!

Features

  • Generate completed science experiments from your kerbals whilst they're in flight
  • Each kerbal in flight is running a Kuriosity Experiment whenever possible
  • These experiments take a variable amount of time, depending on the specific experiment and how 'rich' (i.e. the science point multiplier) the particular location of the kerbal is
  • Each experiment has it's own conditions, and is typically not specific to a biome/location/situation - so most can only be completed once per kerbal
  • Different parts can support (or prioritize the running of) different experiments, and can also impact the rate at which experiments run - for example kerbals in a lab run experiments faster than those in a command pod
  • Ability to customize the rate at which experiments run, and the amount of science returned

Design goals

  • Aiming to give some more reasons to keep kerbals in space for prolonged periods, in a variety of different situations and craft
  • Ideally intended to work in conjunction with a life-support mod (for example the excellent **KLSS**)
  • Increasing the options for gathering early-game science, whilst not being OP in a more mature game
  • Extendable via **Patch Manager** patches to define new experiments and attach them to parts

 

Planned Features

  • UI to review experiments that each kerbal is running or has completed
  • Updated localization

 

Changelog:

Spoiler

v0.1.3

  • Added Russian localization (thanks to Topos)

v0.1.2

  • Changed the condition of tech unlocked and kuriosity experiments completed to handle a list of items rather than a single item
  • Added a feature to deprioritize an experiment (i.e. not run it) for all kerbals on a vessel once one of them has completed an experiment onboard
  • Added 8 more experiments, and adjusted conditions and running duration for several existing experiments (attempting to balance)

v0.1.1

  • Minor bugfixes

v0.1.0

  • First release

About modding KSP2
This has been my first experience modding a game, having been a fan of KSP & KSP2 since the early days. I had read a lot about some of the perceived challenges and barriers to modding KSP2 that some of the KSP community had expressed, and was curious to see for myself. Although the modding scene here is small, it's been able to (within ~15 hours) guide me to the point of creating the first version of this mod, by solely using the SpaceWarp wiki, Patch Manager wiki, lurking  in the KSP2 Modding Society Discord, and looking through some of the excellent examples of mods that have already been created. I'd like to call out a few of the modders whose work here has inspired and taught me, even if they don't know it... Cheese3660, Falki, Leonardfactory, Munix, Schlosrat, Safarte ...and many others

 

Licence: MIT

Edited by Cadestronaut
v0.1.3 release
Link to comment
Share on other sites

Updated to v0.1.2:

  • Changed the condition of tech unlocked and kuriosity experiments completed to handle a list of items rather than a single item
  • Added a feature to deprioritize an experiment (i.e. not run it) for all kerbals on a vessel once one of them has completed an experiment onboard
  • Added 8 more experiments, and adjusted conditions and running duration for several existing experiments (attempting to balance)
Link to comment
Share on other sites

  • 2 weeks later...

This is a great idea.

Do you have a screenshot or something to demonstrate how it works? I installed but am not seeing experiments being run or the option to, and would like to compare with the expectation before I start troubleshooting mod conflicts.

Link to comment
Share on other sites

This sounds like just what I need, but I'm also not sure how it works exactly. Do we have to initiate the experiments? Are the experiments tied to specific parts? How do we see the progress of a Kerbal's experiment?

Ok I decided to check the github and there's a lot more info on what to expect on there. The experiments are supposed to be more like hidden achievements or hidden miniquests. This makes it a good companion if you're playing with lower Mission rewards.

Since some of these hidden achievements require a certain amount of time and specific conditions it's meant to be balanced by playing with a life support mod.

 

(please let me know if I misunderstood anything)

Edited by Mitokandria
Link to comment
Share on other sites

Thanks both for trying out this mod and the feedback, it's really appreciated.

@jordanjay29 Thanks! I'll get some screenshots sorted and write up a little 'How this works' on the main post so that it's a little clearer

@Mitokandria Yup that's exactly it. 

 

In short:

  • Each experiment has a set of conditions (i.e. location, parts of craft, crew on craft, previous experiments triggered, if that experiment has been run by another kerbal on the current vessel, etc) that need to be met in order to allow them to be the current 'focused' experiment - of which there is only one focused on at a time.
  • Each Kerbal will automatically try and have a focused experiment going if possible.
  • For some experiments, the Kerbal needs to actually be in a specific part, and that part can also encourage / prioritize particular experiments, as well as decrease the time for the them to take.
  • The experiments complete after a certain time which is random and depends on the each experiment and the current situation/region science multiplier (i.e. Kerbin Low Orbit is low, but Eeloo landed is high). This means that it can be hundreds of days or could be just a few before an experiment triggers.
  • When an experiment does trigger, you'll get a notification about 'something kurious' noticed by one of your kerbals, and the experiment results are added to their stored science reports (could be data, sample, or both).
  • If a change in conditions mean that the current focused experiment is no longer valid, then progress on it will be paused and a valid experiment will automatically become the focus.
  • Progress on experiments is tied to the Kerbal themselves, not the craft - so it follows them on EVA, or if they change vessels, etc. Currently all progress is reset once they get recovered at the KSC (or killed!) - although if a Kerbal completes an experiment then that does persist between launches.
  • Currently there is no UI or visual indicator to show what experiments that Kerbal has completed, or what they are currently focused on. I'm having a busy time at work at the moment but as soon as it lightens off this is next on my list to put in place (along with better Science Arkive compatibility)

 

Do let me know if there is anything else that would be good to see, or if you have suggestions for new experiments to add?

Link to comment
Share on other sites

Okay, that helps a bit. I also dug through the files, trying not to spoil myself, but now that I see there's a long period during which they can trigger and some differing circumstances, I'm not ready to say for sure that my install isn't working.

I might suggest some faster, low-key experiments just to whet the appetite, as it were, for the Kerbals and players alike. Like spending a few hours in Kerbin orbit or something more readily achievable. The first Kuriosity experiment that appears is probably going to feel like magic!

Having some in-game indication of where/how an experiment might become eligible would help with direction. Like attaching them to the mission dialogues, or adding a mission for some of them, or adding on attributes to certain parts (to be seen in R&D or the VAB) that are used for experiments. Vague suggestions are fine, just some indication of: hey, spend some time in this area or this part and Kerbals might do some extracurricular science on their own.

EDIT: Or maybe some integration with Science Arkive?

Edited by jordanjay29
Link to comment
Share on other sites

Oo having missions for some of the more obvious experiments might work. Make the mission rewards 0 and you have a readily available list of easy to achieve experiments while leaving a lot of others as hidden.

As a nice bonus feature it would also help players to see if the mod is working. :valjoy:

Link to comment
Share on other sites

On 3/28/2024 at 7:59 AM, Topos said:

I'm added Russian localization, please accept the pull request

Thanks Topos! PR accepted and new release made.

I'm hoping to finally get a bit of focus to finish the next round of updates (and some screenshots) after next week, which should include some visual indicators of experiments running, I've just not had the time the last few weeks!

Link to comment
Share on other sites

Thanks for keeping us updated! I'm very pleased to see a couple of the experiments hit off for me during a long flight to Duna, so I'm pretty pleased by the mod so far.

Do you ever run into a lot of notifications at moderate-high timewarp at all? I only have this and Orbital Survey mods that add experiments, and I'm consistently running into Experiment Interrupted notifications when I go above 50x timewarp.  I'm guessing this is KS because other experiments are run in real time.

I turned off all the orbital survey parts that are launched, so all I'm left with is Kuriosity.

Link to comment
Share on other sites

  • 2 weeks later...

Hey, Kadestronaut, I'm finding KS absolutely slams my system after a while due to some memory management issues; I created a couple github issues, one before I had chance to look at the code and a second after I'd done a bit more digging which is kind of a sub-ticket I guess. The only non-work machine I have atm where I can install Unity is a Mac and since KSP2 doesn't seem to run on Mac yet, not sure if I'll be able to try and contribute fixes. TL;DR is the mod drives C#/Unity's memory management into craziness to the point that time runs at half speed inside KSP2 (e.g maneuver node countdown is 3 .. .. .. 2 .. .. .. 1 .. .. .. .. 0 instead of 3 .. 2 .. 1 .. 0). The problem is you're doing 'new' allocations like crazy, including for static lists:

    private List<KuriosityExperimentTracker> GetBestExperiments()
    {
        List<KuriosityExperimentPrecedence> precedences = new List<KuriosityExperimentPrecedence>
        {
            KuriosityExperimentPrecedence.Priority,
            KuriosityExperimentPrecedence.NonPriority
        };

        List<KuriosityExperimentState> states = new List<KuriosityExperimentState>
        {
            KuriosityExperimentState.Running,
            KuriosityExperimentState.Paused,
            KuriosityExperimentState.Initialized
        };

every time this method runs, it has to allocate two new lists, and then grow them to contain the priority/state lists, which it gets from the static lists you already have above.

You could immediately reduce this runtime cost with a simple change:

// Make the underlying static lists as members of the class so they are created at compile time not runtime
private static readonly KuriosityExperimentPrecedence[] precedences = new[]
{
    KuriosityExperimentPrecedence.Priority,
    KuriosityExperimentPrecedence.NonPriority
};

private static readonly KuriosityExperimentState[] states = new[]
{
    KuriosityExperimentState.Running,
    KuriosityExperimentState.Paused,
    KuriosityExperimentState.Initialized
};

But it would probably make sense to also try and avoid the other dynamic allocations you're doing in GetBestExperiments

Link to comment
Share on other sites

Had to give up on trying to get it to build on my system - not sure VS 2022 Preview likes JsonPeek and NewtonSoft.json - but I submitted a pull request that fixes some of the garbage-collection thrashing/performance issues.

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