Jump to content

[WIP] [1.4.x] Dumb Luck 0.2


cyberKerb

Recommended Posts

1ugjxgf.png

 

I've been tinkering with the API for ages and I'm always keeping looking for ways to take pieces of game play that don't have much consideration on their own and somehow incorporate those mechanics into the game in a meaningful way. This is my first mod attempt that I've decided is complete enough to share publicly and I've been enjoying playing with this in a new career.
 

This mod takes the Kerbal "dumb/stupidity" stat and ties your Kerbals intelligence to their success / failure for repairing parts (Engineer) and resetting experiments (Scientist). It also takes into account the Kerbals :rep:Level so that the more stars they have, the less likely they are to fail. I've added an increased chance of failure if the wrong skilled Kerbal makes the attempt. (eg Pilot/Engineer trying to reset a Science Experiment = not a good idea in general)

Gameplay-wise, I find this mod makes me actually think about which Kerbal I'm using for each mission. For my early game, Bob only dropped a single thermometer during his analysis of KSC science. But I got very nervous each time he reset the Science Jr part around KSC before I shot him into orbit to gain a level. This was because I'd used it as a central structural part of the science gathering craft. If it had blown up, then the craft would of been useless.  I was so glad that after getting back from a Minmus mission to have hired a smarter Engineer for the Mun mission. I was not looking forward to having "Bob the dropped-my-wrench-klutz" be my only Engineer available for that rover mission.

I'm also looking at the Kerbal stats in the hiring screen with a more discerning eye now. Mainly to make sure they are not a doorknob and ensure I'm OK with their planned training to get their skill level up before being assigned to an important mission. I'd never bothered with the stats before, so I consider that a positive.

 

Checks that are performed when reset / repair attempted: 
First Check:

  • Static 5% chance of a possible issue occurring. (I hope to have this value on a slider in the difficulty settings)
    • If Kerbal performing action is too low a level - additional 5% added to check (odds stack)
    • If Kerbal wrong skill -  additional 5% added to check for each level difference (odds stack)

Example: A wheel repair needs level 3 engineer. If a Level 1 pilot make the attempt, first check will be: 5% (base)  +  5% (wrong skill)  +  2x5% (2 level difference to required) = 20% chance of first check failure

Second Check:      (Only occurs if first fails)

  • If Dumb Stat / (Star Level + 1) * Random number >= 0.9 Then Wheel/Experiment explodes.

This means that if a Kerbals :rep: level is >= 10 x Dumb/Stupid Stat, then they are safe to perform the repair / reset action.
Examples:
Bill (Scientist) has a Dumb stat of 0.1. At :rep: level 0, there is a chance of experiment reset failure. After getting to level 1, there would be no chance as Bill is THAT smart.
Poor Bob (Engineer) is Dumb stat 0.8, so that means there will always be a chance of him catastrophically failing a wheel repair.

Dumb Luck is licensed under CC BY-NC-SA 4.0



Download LinkDropbox (Source included in Zip)

Feedback or suggestions are welcome.
(Thread is in Development so I can get initial feedback and while I get the rest of the coding for other parts completed)

 

Parts this mod is applied to:

  • Wheels & Landing Legs  (It's very hard to break a Landing leg these days, but there is code in the game that allows it)
  • Stock Science experiment parts (All Sensors, Mystery Goo Container & Science Module Jr only)
  • Parachutes & Drogue Chutes  (Not personal parachutes)

Parts I'm planning to add to these failure checks:
@DMagic science experiments (uses different module to stock ModuleScienceExperiment)

 

ChangeLog

Spoiler

0.2
Added Parachute check and fixed an NRE issue from check running outside flightscene.

0.1
- First Release

Many thanks to the following people who've helped / assisted in my understanding of the API and generally given guidance on the finer details on the background machinery within KSP.
@sarbian, @Shadowmage, @Li0n, @SpannerMonkey(smce)

Edited by wile1411
Added Parachute checks
Link to comment
Share on other sites

Version 0.2

- Removed a NRE I found today as I didn't think to check for issues outside the flight scene.
- Added Parachute Dumb Luck checks. Can cause the parachute part to explode while attempting to repack. (Non - engineer and Engineer <0 level have an increased chance of stuffing it up)

Hopefully that's the worst of the issues.

Link to comment
Share on other sites

That moment when you finally realize why all your code testing was causing a part to explode a *lot* more regularly that I was expecting...

tZEhZX2.png
 

*sigh* I'd spent at least an hour of troubleshooting this after chasing down an NRE issue I found while trying to add Dmagic science to my mod. I couldn't work out why I wasn't getting a successful Dmagic RoverScience Goo reset....

Now I know why, the persistence file tells me Ludvey is quite 'special' with a Dumb stat of 0.948. And here I was thinking *I* was the dummy that couldn't find out the cause of experiments not succeeding when I thought they should be. I seem to have grossly underestimated Ludveys ability to not know how to use equipment.

(Note to self - add debug log to indicate Dumb stat for each test....) :confused:

Link to comment
Share on other sites

Congrats on the release :) Really like the idea, anything that make Kerbal more unique is a must have in my save.

39 minutes ago, wile1411 said:

That moment when you finally realize why all your code testing was causing a part to explode a *lot* more regularly that I was expecting...

Welcome to modding I guess :D (I got the same kind of thing while developing CrewLight, forgot to put an RTG and don't understand why the lights refuse to turn on ;) )

Link to comment
Share on other sites

This is a cool idea! I think having the parts explode is a bit extreme though. In your example with the Material Bay, just because the scientist botched the experiment doesn't mean that the structure of the part itself would be effected. Your going to end up destroying entire vessels.

Not sure if it's possible, but I'd love to see a failure either just cause the process to fail permanently- no experiment collect, no chute packed - or the failure botched it but another attempt could be made with a higher chance of failure - this could lead to some fun missions where you send another more experienced kerbal out to try again after a failure.

Edited by Tyko
Link to comment
Share on other sites

8 hours ago, Tyko said:

This is a cool idea! I think having the parts explode is a bit extreme though. In your example with the Material Bay, just because the scientist botched the experiment doesn't mean that the structure of the part itself would be effected. Your going to end up destroying entire vessels.

I understand the concern here as I've broken many a vessel while testing this idea. At the moment, I'm leaning toward just redesigning the craft around the problem and have the Science Jr. in a place such that it's not critical to the craft. Early in my current 1.4.3 career play-through, I had a KSC Science rover have a failure due to Bob inexperience, but I redesigned that rover with the Science Jr. sitting on top to allow for that failure not to be critical in subsequent missions. I've not had too much trouble with rockets and planes though seeing as Bob is already quite smart and after getting to :rep:Level 1, the risk of blowing up a Science Jr. doesn't exist for him now. As this is a WIP mod, I'm still trying to shake out what is a concern for me as I play with it. I'm still playing through with other Kerbals who aren't quite as smart as Bob to see how their training shakes out and how much I pay attention to the risks with high stupidity crew. Thanks for the feedback though. :) 

 

8 hours ago, Tyko said:

Not sure if it's possible, but I'd love to see a failure either just cause the process to fail permanently- no experiment collect, no chute packed - or the failure botched it but another attempt could be made with a higher chance of failure - this could lead to some fun missions where you send another more experienced kerbal out to try again after a failure.

That's not a bad idea - I need to let it roll around in my head for a while to see how it settles on me. All Science Experiments that use the ModuleScienceExperiment have a boolean "inoperable" field, but I'm not sure things like the sensor experiments take it into account when presenting their buttons in the PAW. It should be doable though... probably in the same way I hid the stock reset/restore buttons, but I need to check what the stock code actually does first before committing to anything.

*Typing as I'm thinking here*
I think I want to at least keep the thrill/risk of an explosion in as a rare event, specifically when the random number generator gives a snake eyes equivalent number (<0.001) - hence the name of the mod. I don't want to completely eliminate opportunity for really bad luck to play it's part. Most of the time this can be worked around to mitigate the risk. Would you really risk sending a 0.9 stupid engineer on a rover mission that has no backup plan if a wheel fails? (don't answer that - I know I would... Despite looking at the stupidity stat more often, I'm finding I don't check as often as I should when important decisions that I'm not used to making arise).

Having said that, I might partially cave on that opinion and make this avoidable specifically for parts that get used structurally like the science Jr. I might also add a "disable explosions" option in the difficulty settings for those that would prefer not to opt in. Once I work out how to 'do' config nodes (loading, reading, setting, etc...) and custom game settings that is. Learning as I go here.

I like the idea of recording the name and stupidity of the last Kerbal that failed the reset / repair. This I probably WILL add as it allows for more factors to take into account for the odds for success/fail. The whole "must be smarter to try again" mechanic has a certain appeal. That idea would also allow me to try my hand at adding some random flavour text for the failures / fixes. :)   

 Example Failure / Part Inoperable messages:
"<Kerbal name> accidentally hits the reset to factory default button for <part name>. It's waiting for input." 
"<Kerbal name> attempts to stuff all the chute material into a random opening on <chute part name>. The chute doesn't fit in that compartment.
"<Kerbal name> tries to short circuit the experiment terminals in an attempt to reset <part name>. Black soot forms around the power input lines."
"<Kerbal name> removes a nut and bolt they figured was superfluous to <wheel part name> continued operation. It wasn't."

Smarter Kerbal fixes after dumb failures:
"<Kerbal name> turns the <part name> off & on again and it is operating nominally."
"<Kerbal name> pulls out the scrunched ball of material that <Failed Kerbal Name> attempted to repack and successfully reset <chute part name>.
"<Kerbal name> repairs <part name> by reconnecting the cut wires that <Failed Kerbal Name> thought was a good idea to separate.

 

One adjustment I think I need to make is change the button to reset / reset so it actually shows the %chance of failure before you click the button.  eg "Reset Experiment (failure chance 25%)"   I've realised that I've gotten so used to looking at the Alt-F12 messages I log there, that I've taken that info for granted. I need to bring some of that info to the GUI and onscreen messages for user feedback on what's occurring

Edited by wile1411
Link to comment
Share on other sites

@wile1411 thanks for the explanation. I'll definitely keep an eye on this.

One other consideration...This seems like it would thematically mesh well with Kerbalism, probably worth making sure it plays nice with that mod. I can imagine Kerbalism users might want your mod too.

Link to comment
Share on other sites

On ‎6‎/‎6‎/‎2018 at 3:05 AM, Tyko said:

@wile1411 thanks for the explanation. I'll definitely keep an eye on this.

One other consideration...This seems like it would thematically mesh well with Kerbalism, probably worth making sure it plays nice with that mod. I can imagine Kerbalism users might want your mod too.

I've never touched Kerbalism - do you know if it uses it's own experiment/wheel/parachute modules or would it use the stock implementations?

If it's stock, I shouldn't have to change anything. My way of achieving this is to try and hide the stock button that does the REPAIR/RESTORE/REPACK/RESET action in the PAW. I then provide my own button with the same name that runs the code that does the random check before letting it continue with the usual method that stock uses.

Link to comment
Share on other sites

10 hours ago, wile1411 said:

I've never touched Kerbalism - do you know if it uses it's own experiment/wheel/parachute modules or would it use the stock implementations?

If it's stock, I shouldn't have to change anything. My way of achieving this is to try and hide the stock button that does the REPAIR/RESTORE/REPACK/RESET action in the PAW. I then provide my own button with the same name that runs the code that does the random check before letting it continue with the usual method that stock uses.

I'm not sure. May want to check with @ShotgunNinja who runs Kerbalism  :) 

Link to comment
Share on other sites

Definitely going to be e keeping an eye on this.

But, you should definitely make explosions optional.  I would do it so that an engineer has a decreasing chance of repairing something.  But another engineer's attempt wouldnt/should not be affected by any previous attempts.

 

Link to comment
Share on other sites

Thanks for the input and ideas here. There's a little bit of work I need to finish off on another mod idea and then I'll be back on this again.

Addressing the ideas - I'm still going through testing regarding keeping explosions or not. I might change my game so it falls in line with stock - mainly so the only thing that is expected to cause explosions is the player colliding with things / re-entry too fast. For those saying have both - I hear you, but I still have to learn how to use the config nodes and game setting to allow myself to utilise those options.

 

For anyone interested: I have a request for feedback around Science Experiments for this mod below:

(Background) I'm currently working through the DMagic experiment support. After some discussions with @DMagic, he highlighted the fact that all stock experiments can be reset by an EVA Kerbal (or in the cockpit) of any skill , but only if they don't use the EVA reset button that is implemented for stock experiments and requires a Scientist to operate it.

SideNote: By "reset" I mean when the experiment data is still in the experiment. If the data is taken, then it becomes a "Restore" event and that also specifically requires a scientist.

The way this any EVA Kerbal reset happens is that a player just has to click the "review data" button and then hit the "recycle" button on the experiment results window. This review/recycle method can be done with an EVA Kerbal of any skill. Scientists do have the dedicated reset button that does the same thing in less clicks. Different again is that Dmagic experiments use a custom MODULE that allows any skilled Kerbal to use the reset button.

(Feedback Questions - specifically around Science Experiments)
If resetting an experiment can by bypassed via the above mentioned review/recycle method, should I even have the DumbLuck test occur when specifically resetting an experiment like a Thermometer?
I'm half leaning towards the idea that maybe the DumbLuck check only applies to a RESTORE action for experiments. (ie Goo and Sci Jr.) The downside is it would no longer apply to the sensor experiments. It seems that if I add DumbLuck to something that can be bypassed by choice, I'm not really adding anything to the gameplay with this mod idea.

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