Jump to content

[0.90] Kerbal Mechanics: Part failures


IRnifty

Recommended Posts

Nice,

a few modders are also working on random failures mods:

Also I was trying to help HoneyFox by assembling a list of whatever came to my mind:

It could help you too https://docs.google.com/spreadsheets/d/1-8iIiyy6Qnurrg2TEO_gfK-IWWjUaCO9U0hyjoFj40U/edit?usp=sharing

Link to comment
Share on other sites

Oh wow... You've really done up that list! I think I will be using this, thanks!

And I had no idea anyone else was working on similar mods! I wish them all luck, and may the best mod win :)

EDIT: Cpt. Kipard, you can tweak the "quality" of the part by right-clicking it in the editor (default 75%), or modifying the cfg's...

Basically, the quality affects how fast the reliability drains. The lower the reliability, the higher chance something will happen.

Edited by IRnifty
Link to comment
Share on other sites

This is a very interesting concept! An idea to consider, would it be more effective to use a ModuleManager setup to add function based on part type so that stock parts don't require replacement and function would be added to mod parts as well?

Link to comment
Share on other sites

:D Well I've been busy with other plugins these days so... my RandomFailures has no progress recently.

One thing I think that we can consider adding is: MissionController integration, that is, we pay for some extra fees to increase the robustness/reliability of the rocket so that it will be less likely to fail.

EDIT: And i'd like to see your source code to see if the overall structure is compatible so that I can merge my project with yours...

EDIT2: No, I cannot find the source code link either in OP or your package.

Edited by HoneyFox
Link to comment
Share on other sites

IRNifty, if you would like I would be happy to help you write a config set utilizing module manager so as to remove the need for stock over-write. From what I saw looking through the mod, you are just adding a reliability module to the configs. Using Module Manager enhances compatibility with other mods, and also protects base game files from breaking your mod immediately in the case of a sudden version update etc.

edit: and when I say "just" adding, I mean it is amazing work, your work, and very impressive. Sorry I realized the way I wrote that downplayed your efforts a bit.

edit 2: Also using module manager, it will be possible to have it automatically add your module to any part containing a specific module. For example, you can have it do something like

@PART[*]:HAS[@MODULE[ModuleEngines],!MODULE[ModuleEngineReliability]]
{
(Whatever you want added to all parts with engine modules that do not contain a ModuleEngineReliability)
}

Now to make it REALLY work well, I think you would have to change some things with how your plugin is operating internally, but it will be much easier and save a ton of headaches for everyone later. Plus, mod compatibility.

Edited by PringleMan
Link to comment
Share on other sites

JefferyCor, I do plan to do something like this, but I know it as the KAS method, where it injects the ModuleGrab into everything.

PringleMan, I wouldn't at all mind if you helped in this regard!

HoneyFox, you can "tweak" the "quality" of a part in the editor. This will affect the price once money is added. Also, I know I'm supposed to supply source, an I will soon, but I did upload this mod at 2 in the morning where I live expect to see it within the next 24 hrs.

Link to comment
Share on other sites

JefferyCor, I do plan to do something like this, but I know it as the KAS method, where it injects the ModuleGrab into everything.

PringleMan, I wouldn't at all mind if you helped in this regard!

HoneyFox, you can "tweak" the "quality" of a part in the editor. This will affect the price once money is added. Also, I know I'm supposed to supply source, an I will soon, but I did upload this mod at 2 in the morning where I live expect to see it within the next 24 hrs.

That's great! though i guess tweaking all parts quality one by one will be quite tedious...

Link to comment
Share on other sites

That's great! though i guess tweaking all parts quality one by one will be quite tedious...

Yea... Although I don't know if there's too much that can be done about that.

Also, I have added my project to GitHub. Check the OP for the source.

Link to comment
Share on other sites

Yea... Although I don't know if there's too much that can be done about that.

Also, I have added my project to GitHub. Check the OP for the source.

I have had no access to GitHub for nearly one week. :(

One thing I'd like to talk about is: in my RandomFailures, all types of failures are sub-classes of a parent "Failure" class, but these classes are not derived from PartModule, instead, I wrote a generic "ModuleFailureInfo" PartModule to store all the information of these sub-classes via manual serialization/de-serialization.

I haven't viewed your code but judging from that MM cfg mentioned by PringleMan, it seems like you've created individual PartModules for each type of failure.

IMHO it might be better to create only one PartModule and do all the stuff inside, otherwise one part might contain too many modules inside if: one part has multiple modules and each module has multiple types of failures.

You can check my GitHub to see what I mean. :)

Edited by HoneyFox
Link to comment
Share on other sites

Actually, each part has and only will ever have one module, unless others are required for the parts other functions. Failures are handled in each module, such that only one module is needed for a large multitude of possible failures. My engine module, ModuleEngineReliability, as an example, simply overlays standard engine behavior with failure checks. If a failure occurs, the overlaid class performs the appropriate failure code. My engine module currently handles 3 different types of failure, all in one module. I'm at work now, otherwise I'd link my engine module class.

Just curious: why can't you access GitHub? Just can't sign in?

Link to comment
Share on other sites

Actually, each part has and only will ever have one module, unless others are required for the parts other functions. Failures are handled in each module, such that only one module is needed for a large multitude of possible failures. My engine module, ModuleEngineReliability, as an example, simply overlays standard engine behavior with failure checks. If a failure occurs, the overlaid class performs the appropriate failure code. My engine module currently handles 3 different types of failure, all in one module. I'm at work now, otherwise I'd link my engine module class.

Just curious: why can't you access GitHub? Just can't sign in?

Wait, do you mean that the "ModuleEngineReliability" class is derived from the ModuleEngines class, or it's just one class that will interfere the ModuleEngines? if it's the former one, I would feel ... bad about that. :P

I don't know why. I've kept getting issue about SSL certificate when trying to access github.com since last week...

Link to comment
Share on other sites

ModuleEngineReliability inherits ModuleEngines. If you look at the cfg's, you'll notice ModuleEngines has been replaced by ModuleEngineReliability.

Have you tried clearing your cache, cookies, etc? A different browser, maybe? What do you use?

Link to comment
Share on other sites

ModuleEngineReliability inherits ModuleEngines. If you look at the cfg's, you'll notice ModuleEngines has been replaced by ModuleEngineReliability.

Have you tried clearing your cache, cookies, etc? A different browser, maybe? What do you use?

Oh... so it does use inheritance... well... I'm a little bit worried about future compatibility for this.

I'm using Google Chrome.

ah damn it... I can access it via Firefox, i need to clean cache/cookies to see if Chrome can be revived. anyway, thanks for the tip. I was thinking that it's my network issue before.

Link to comment
Share on other sites

Any time. And I wouldn't be too worried about compatibility. Both of our mods are early alpha. Anything can change. Maybe with discussion, a new, better method can be discovered. I'm going to try and PM you my email.

Link to comment
Share on other sites

ModuleEngineReliability inherits ModuleEngines. If you look at the cfg's, you'll notice ModuleEngines has been replaced by ModuleEngineReliability.

Have you tried clearing your cache, cookies, etc? A different browser, maybe? What do you use?

There are a lot of mods that use ModuleManager to change values in ModuleEngines. If those changes load after you replace ModuleEngines with a subclass, ModuleManager doesn't know it's a subclass and doesn't apply the change, and somebody else's mod ends up broken.

If there's a way to handle failures in a ModuleReliability that runs beside ModuleEngines instead of subclassing it, that approach would be better for compatibility.

Link to comment
Share on other sites

Yes what yankee said.

Basically if the config for your mod loads in before another mod that changes the engine config, then their mod is not going to function. Off the top of my head the ones that will be immediately broken are thrust managers.

What will be the easiest to change in the code would be as HoneyFox says. Unless you have a really specific reason (I have not looked at the source code yet) to have put it as an inheritance of the ModuleEngines, you should really try to put it as a different module which can be added with few changes to new parts.

A good place to start would be looking at any conditions that can be checked easily. If temperature is a failure condition, it is really easy to check the part temp. Another slightly more complicated condition could be if the part is radial or in-line. The point is I am not sure why you specifically need to tie in to the engine module.

Link to comment
Share on other sites

I'm happy the EVA part status now has some meaning :D This could be great for shuttle missions. I'm thinking particularly of how mission control calls out the decreasing number of engines required to make orbit throughout its accent. Although I can't help but be concerned that these failures will be too frequent. Using the shuttle as an example (being notoriously problematic) it performed around 70 missions with just 2 serious failures (although there were other more minor ones), so that's a failure rate of around 1 in 35.

Link to comment
Share on other sites

I'm happy the EVA part status now has some meaning :D This could be great for shuttle missions. I'm thinking particularly of how mission control calls out the decreasing number of engines required to make orbit throughout its accent. Although I can't help but be concerned that these failures will be too frequent. Using the shuttle as an example (being notoriously problematic) it performed around 70 missions with just 2 serious failures (although there were other more minor ones), so that's a failure rate of around 1 in 35.

I might be wrong but by looking at the files this mod is only good if you use all Stock part.;.;

Edit be nice if we could make cfg to add to mods we use or maybe we can hope some one can shed some light on this.

Edited by Mecripp2
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...