Jump to content

[WIP 0.90] KerbalFeels 0.0.1 - plugin for inter-kerbal relationships (3/26/2015)


wpatter6

Recommended Posts

Hello everyone. So I had this idea the other day about how a plugin could possibly track the relationships between the kerbals in the space program and how those relationships could affect their performance during missions, and I've spent the last day or so coding furiously to make it work (sort of). This is my first attempt at modding with the unity engine, and I've thrown it together quite quickly so it's still a bit raw and lacking on the GUI side (which is one thing that's definitely never been my specialty, links to any guides or mods that make a lot of use of the GUI would be really nice). It does seem to work fairly well during the semi-thorough testing I've done so far. Anyway, here's what it does:

Based on the different personalities of the kerbals (and RNG), kerbals will begin to like or dislike each other after spending time with each other in spacecraft. Kerbals who have very different stupidity levels may be more likely to have negative results, while a non-courageous kerbal may take a quick liking to one who is more courageous (though that feeling may not be reciprocated!)

Once they reach a certain threshold of liking (or disliking) another kerbal, they will gain a "feeling" towards the other kerbal. There are three different positive feelings and three negative feelings which are chosen at random once the threshold is passed. When they are on a mission, they will gain or lose personality traits and experience levels based on their feelings towards the other kerbals on their mission. These feelings are:

Positive traits give +1 experience level:

  • Playful: Raises stupidity
  • In Love: Raises stupidity and courage
  • Inspired: Lowers stupidity

Negative traits give -1 experience level:

  • Scared: Lowers courage
  • Annoyed: Raises stupidity
  • Hateful: Raises stupidity and courage

These changes aren't permanent, and are only in effect while the kerbal(s) they have the feelings towards are sharing a vessel with them.

Kerbals also have a certain amount of "sanity" which will depreciate over longer missions. It will go down faster if they have negative feelings towards kerbals in their vessel, and slower if there are more kerbals they feel positively towards in the ship. Lower sanity will increase the amount that RNG impacts their feelings towards the other kerbals at the end of the mission. My goal is for sanity to play a few different roles in the future as well, mentioned below.

Right now the only GUI that I've created is shown when a ship is recovered, it informs the user of the kerbals changing feelings towards each other at the end of every mission (and needs scroll bars, HELP!). Feelings change relatively slowly, so it may take more than a few days on a mission together before the kerbals reach the feeling threshold.

Here's the github link for anyone who is interested in checking it out (includes .zip file for normal installation)

Things on the to do list:

  • Feelings impact the amount of experience gained from a mission (inspired and hateful give more xp; playful and annoyed give less)
  • Murder and/or suicide will happen with negative feelings and/or lack of sanity + RNG
  • Death of a kerbal can permanently (or for a certain amount of time) affect traits and/or sanity of the kerbals who had positive feelings towards them
  • Parts ideas:
    • Recreational/Athletic/general activity parts for ships and space stations will reduce negative feelings and improve (or possibly even reduce) the crew's sanity
    • Brain scan gives science and is either affected by or has effects on kerbal's sanity -- I think it would be neat if you could get more science if your kerbal is less sane, but not sure how feasable that is

    [*]Tweaking to constant variables after testing and/or feedback

    [*]Better GUI so player can see how all the kerbals feel towards each other at any time (maybe in the astronaut complex and/or crew selection interface -- can existing game GUIs be manipulated somehow?)

    [*]Add a list of randomly selected "reasons" why feelings changed for the better or worse and have them display when they change ("They wouldn't stop farting!", "We had a nice conversation about our mothers", ...etc)

    [*]Patching the holes where calculations aren't performed. This is actually another part I could use help on, if someone could refer me to a mod or explain a good way to do a constant recurring check of all active vessels I'd be greatly obliged. I was thinking I'd try a new thread with an endless loop that checks every so often but I wasn't sure how well the mod engine handled threading, and wasn't sure how to account for things like time warping, etc. Right now I'm relying on the various GameEvents to try and keep track of who is in what vessel and for how long, and it's not perfect. It would also be nice to recalculate feelings and sanity in a recurring fashion instead of relying on the various GameEvents as well.

I think once it's fleshed out it could be a pretty neat way to have players put more thought into what kerbals go on missions together, as well as give a second thought to sending a beloved kerbal on a dangerous or one-way mission. Anyway, let me know what you think, or if you have any other ideas you think I should implement. I've gotta say, the modding of this game is pretty spectacular, if a little tedious. Debugging in visual studio would be nice!

Legalese edit:

Copyright © 2015, wpatter6

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Edited by wpatter6
Adding MIT license text & re-adding link to git
Link to comment
Share on other sites

Hi wpatter6, and welcome aboard! That looks like a very interesting mod, something I don't think has been done before.

Unfortunately, I had to remove the download links from your post until you select a license and add it to your post and the download. See our Community Add-on posting rules for more details, and you can check out this thread if you are unsure what license to use.

Once you have chosen and included a license, feel free to edit the links back in.

Link to comment
Share on other sites

If there's one mod I never expected to see, it's this one.

Heh, yeah it's definitely not in line with what most other mods are. The idea just came to me so I figured I'd throw it together and see what kind of response it gets

Link to comment
Share on other sites

Thanks for the positive feedback guys, I will definitely keep up the efforts on this mod.

Also I'm happy to report I just completed the mod's first full round trip to Dundas with 5 kerbals and it worked perfectly! I expect it might have some imperfect behavior if I had done any crew transferring or rescuing, so that's the next thing for me to test.

Link to comment
Share on other sites

Regarding the murder/suicide scenarios: How do you intend to work that? I suggest:

•When a craft is out of fuel and not on a return trajectory to any planet or within range of a potential rescue â€â€a hopeless situationâ€â€, the crew may choose to commit suicide.

•When a member of a crew loses so much sanity that he endangers the crew, a more sane crewman may put down the one behaving erratically. Of course the insane one might kill the other crewmen too. Which one is dropped first could determine the further survival of the mission.

I'm sure there is some way to crunch the numbers to make sense of it all. Just throwing some ideas out there.

Link to comment
Share on other sites

Regarding the murder/suicide scenarios: How do you intend to work that? I suggest:

•When a craft is out of fuel and not on a return trajectory to any planet or within range of a potential rescue â€â€a hopeless situationâ€â€, the crew may choose to commit suicide.

•When a member of a crew loses so much sanity that he endangers the crew, a more sane crewman may put down the one behaving erratically. Of course the insane one might kill the other crewmen too. Which one is dropped first could determine the further survival of the mission.

I'm sure there is some way to crunch the numbers to make sense of it all. Just throwing some ideas out there.

Yeah suicide and/or murder would certainly become more of a concern if you left your kerbals floating for a long time, even if you were planning to rescue them. I think having a part for space stations to help accommodate this fact may be important, but one goal of this is to give players a reason to cycle station crew in a slightly more realistic fashion instead of just leaving the same group up there forever.

Murder would sometimes just be an instant kill inside the vessel, but I was thinking that there might be "attempts" as well, where say someone gets thrown out of an airlock as the engines fire or upon entering the atmosphere, but the victim could still potentially be rescued if the player noticed and reacted quickly enough. Still, I think it'll be pretty rare when playing normally, though it will also be entirely possible to intentionally send kerbals who hate each other on long missions for the more sadistic players...

Retribution on the attacker would be more tricky to figure out, but I'm thinking it might work something like if there's no one else on the ship it goes unpunished, and if there is, the crew all have their opinion of that person drop a certain amount, and if it's no longer positive after that drop, that kerbal would be "arrested" which would effectively be the same thing as death as well... Or maybe something like, if the other kerbal(s) end up with a negative feeling after the murder, they play judge/jury/executioner and off the guy right there, otherwise, he's "arrested" and shows on the missing tab for some amount of time... I dunno, just spitballing, these ideas may or may not be feasable.

Link to comment
Share on other sites

I've always wanted something like this! Also: Make sure that if you make new parts, and are not already a really good 3D modeler, that you instead use modulemanager configs for other mod or stock parts, because low-quality models can really ruin a plugin for many people (including me)

- - - Updated - - -

Now I have a suggestion: Kerbals liking/disliking Gene Kerman at mission control. Or maybe much simpler, having an open antenna will increase sanity due to being conncted to home.

Link to comment
Share on other sites

I've always wanted something like this! Also: Make sure that if you make new parts, and are not already a really good 3D modeler, that you instead use modulemanager configs for other mod or stock parts, because low-quality models can really ruin a plugin for many people (including me)

- - - Updated - - -

Now I have a suggestion: Kerbals liking/disliking Gene Kerman at mission control. Or maybe much simpler, having an open antenna will increase sanity due to being conncted to home.

Yeah I've been thinking I could probably use some of the existing parts like antennas to reduce the loss of sanity, and also doing things like having scientists lose sanity slower based on how many scientific experiments are on the ship, something like that. I would like to create at least one basic part for this mod, the brain scan, that would help the player see what level the crew's sanity is, as well as giving science points. I am not an experienced 3D modeler, so thanks I'll look into the modulemanager thing when I get around to the parts interaction piece.

Link to comment
Share on other sites

Can you modify kerbals to have different relationships in the save file (for me to get this I need to know because I have backgrounds for my kerbals

Yes the game save file is where I'll be storing the kerbal info and I suppose you could change the numbers to give them different relationships if you wanted. It's in its own ConfigNode called "FEELS" so it shouldn't interfere with any other mods or anything.

Link to comment
Share on other sites

Cool:D

- - - Updated - - -

Yeah I've been thinking I could probably use some of the existing parts like antennas to reduce the loss of sanity, and also doing things like having scientists lose sanity slower based on how many scientific experiments are on the ship, something like that. I would like to create at least one basic part for this mod, the brain scan, that would help the player see what level the crew's sanity is, as well as giving science points. I am not an experienced 3D modeler, so thanks I'll look into the modulemanager thing when I get around to the parts interaction piece.

Wait, for scientists work keepsthem sane??!! Its not like that for me

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