Jump to content

[Plugin][0.90] (Semi-)Saturatable Reaction Wheels v1.8 (Apr 9)


Crzyrndm

Recommended Posts

All my minor mods are going into a single thread post-1.0 release. Please check my signature for the new thread

Introducing a (not particularly realistic) saturation mechanic to reaction wheels. As reaction wheels exert torque, stored momentum increases saturating the wheel and decreasing torque output. Over time the stored momentum decays and torque slowly increases back to it's original level.

Why use this mod? From a gameplay perspective it adds another factor to be aware of when maneuvering your vessel. It makes including maneuvering thrusters on your vessels a lot more attractive (especially if you know offset thrust could be an issue eg. spaceplanes, cargo tugs, and asteroid haulers), and means you really do have to find a flat spot to land if you want to be on the ground for more than a few seconds (no more sitting with only two legs on the ground indefinitely). There are also interesting balancing possibilities because of the dynamic nature of the additional parameters.

Download - Source

Requires Module Manager

Javascript is disabled. View full album

NOTE: Atmospheric flight often requires a constant torque input, causing wheels to rapidly saturate. It is recommended that you disable reaction wheels prior to launch and re-enable them in the upper atmosphere.

License is GPLv3

This is the default module manager patch that switches out all reaction wheel modules for saturatable wheels with extra comments about the effect of each parameter


[*]:HAS[@MODULE[ModuleReactionWheel],!MODULE[RWSaturatable]]:FOR[RWSaturatable]{
@MODULE[ModuleReactionWheel]
{
@name = RWSaturatable

[COLOR=#ff0000] // saturationScale controls the maximum momentum that can be stored by a part. If torque remains constant until 100% saturation, this is the time in seconds that reaching 100% saturation will take
// The maximum storeable momentum equals: saturationScale * AverageTorque[/COLOR]
saturationScale = 10

[COLOR=#ff0000]// Bleed rate is the fraction of maximum axis torque that will be exerted to reduce momentum each second, and is based on the current saturation percentage.
// The default 2.5% and 10s scale will take slightly less than 400 seconds to completely clear an axis (assuming axis torque == average torque).
// Other values can be calculated by dividing the saturation scale by the bleedRate (assuming a constant bleed rate), ie. 10 / 0.025 = 400[/COLOR]
bleedRate
{
key = 0 0.025 0 0
key = 1 0.025 0 0
}

[COLOR=#ff0000]// Torque percentage for a given level of saturation. The default config gives a linear decrease from 100% to 0% as stored momentum increases[/COLOR]
torqueCurve
{
key = 0 1 -1 -1
key = 1 0 -1 -1
}
}
}
@PART

Edited by Crzyrndm
Link to comment
Share on other sites

I like it! Any development which brings KSP closer to real life should be applauded. Unfortunately most people seem te be less interested in micromanagement, the reason I abandoned my hydraulics mod. A thing that helps, if you get insufficient response on this forum (which is often), is to share your ideas on the unofficial facebook group(s) and other media.

Link to comment
Share on other sites

I like it! Any development which brings KSP closer to real life should be applauded.

More of a side effect in this case. Primarily, it has the potential to add interesting gameplay considerations. KSP's issues with voiding angular momentum make a "real" system (which doesn't bleed off momentum) a waste of time IMO. You can of course set the bleed rate to zero if you really want to, but I'll never recommend doing so.

There's also nothing here to promote (I'd need to set up some alternate configurations before this is sees any gameplay addition of note) and I'm not comfortable with self promotion anyway. If it interests other people, it will get noticed.

Edited by Crzyrndm
Link to comment
Share on other sites

It definitely looks like an awesome project... but my brain already hurts from my other worldly rigors... and this isn't helping that at all. You can take that as high praise, however, considering it takes a lot to mess up my brain.

That assumes my brain is working right in the first place... they could never fully agree on that topic...

Link to comment
Share on other sites

Saw some strange behavior during initial use. Launched a rocket to test for a Mun landing. The rocket kept wanting to drift into a spin ccw and sas didn't seem to want to stabilize it. After getting around 25km I staged and the spinning become uncontrollable. It it just a moderate speed spin that i cant counter sas on or off. I did have some luck after turning the RWs off on the command pod it seemed to not increase in speed. Though it still would not stop spinning. I tried RCS even.

Another thing was while in game the available torque always read 0 for all axis. It could be a mod interaction as I run 65 mods including DRE and FAR. So maybe some other mods no playing nice. WIll investigate further tomorrow and get logs if anything funny happens. One last thing. I noticed that my log was filled with entries for this mod about available torque and bleed rate. Does that need to be in the log so often? Other than that it seemed to work pretty nicely.

Link to comment
Share on other sites

Alright after some more testing today I discovered my previous rotation issue was some parts clipping and causing phantom forces. So that wasn't this mod. However I think i narrowed down the issue with numbers not being displayed all the time. It seems the stored torque values read 0 until all stages have been staged/activated. I tested as follows. I put a pod with an engine in launch clamps and while locked in I wasn't able to see stored torque values. Once I staged the clamps I still had not staged the engine, so numbers still read 0. Once I stage the engine and have no more stages left the number read out normally. Other than that it works well hope that can be fixed.

Edited by Svm420
grammar and spelling before coffee
Link to comment
Share on other sites

Alright after some more testing today I discovered my previous rotation issue was some parts clipping and causing phantom forces. SO that wasn't this mod. However I think i narrowed down the issue with numbers not being displayed all the time. It seems the stored torque values read 0 all the time till all stages have been staged. I tested as follows. I made put a pod in launch clamps and while locked in I wasn't able to see stord torque. Once I staged the clamps I still had not staged the engine. SO numbers still read 0. Once I stage the engine and have no more stages left the number read out normally. Other than that i works well hope that can be fixed.

Thanks for the detailed report, makes things much easier to resolve :)

Link to comment
Share on other sites

I actualy wanted to create something like this as I saw that it was relatively easy to modify the strength of a reactor when. Great to see someone does it for me.:kiss:

Note there are several mods the maintain momentum when accelerating. I suggest you integrate them with this mod.

for example Persistent Momentum 1.0 (14 July) which still works in 0.90

also Timewarp Rotation Fix should work

Edited by FreeThinker
Link to comment
Share on other sites

One last thing. I noticed that my log was filled with entries for this mod about available torque and bleed rate. Does that need to be in the log so often?

Had a bunch of crashes today that i never had before. While most likely no 1 mod is to blame as I have a heavy modded game. I think the log spam from this pushed the system over the edge as my logs frequently were 40mb before finally getting a NaN crash. With tons of entries for available torque and bleed rate. Please update at least to tone that down. Had to uninstall for now. Really enjoy the mod though.

Link to comment
Share on other sites

Update is waiting on getting torque decay as a configurable curve rather than the current fixed linear decay. Once I get that sorted I'll push a release ASAP which will include a fix for wheels not being active until staged and remove the log spam.

E: Scratch that. If I can't get the torque configuration working in the next half hour or so I'll just hardcode it back to what it is now.

Edited by Crzyrndm
Link to comment
Share on other sites

Hmm today is actually a bit worse. Now i cant see available torque at all even after all stages have fired. Also just want to make sure I was clear. It isnt that the RWs dont activate till staging just that all the number read 0. Everything works normally just that all the available torque readout are 0. I also had 1 other issue where the RW seemed to stopped functioning. I had just got my rocket up to about 40-50km with FAR. I was trying to set the rocket at 0 pitch but it was like i had run out of torque and it wasn't being regenerated. No matter what i did I could not control the rocket it was like having no RWs at all. Once I fall back into the atmosphere I am then able to control the rocket. Did anthoer test with my ssto plane and again once outside the atmosphere RWs are useless even if they were enough in atmosphere.

Yep the change today made it so RWs do not function in space

Link to comment
Share on other sites

So if available 'push' decreases as the wheels spin faster, does the decay rate increase the faster the wheels are spinning also?

Looks like a good mod. If SQUAD don't implement this then I'll add this to my list of mandatory mods (once the bug reports slow down a little)

Link to comment
Share on other sites

Yep the change today made it so RWs do not function in space

*Scratches head*

Checks code

*looks puzzled*

Checks again

*shug*

tl;dr

Why they stopped working out of the atmosphere I do not understand. It doesn't seem to be happening on my current dev version either so I'll just write it off as something I forgot yesterday.

So if available 'push' decreases as the wheels spin faster, does the decay rate increase the faster the wheels are spinning also?

Once I work out how to load float curves (same system as engine ISP/atmo pressure), I'm going to push a lot of stuff onto that so how torque and bleed rates change with saturation will be completely configurable on a per part (and possibly per axis) basis.

The mod does seem to work with me, all variables remain 0. could there be any mods preventing the correct behavior of this mod?

Probably not. I'm having more issues getting everything to initialise correctly than making the functionality work :mad:.

Link to comment
Share on other sites

*Scratches head*

Checks code

*looks puzzled*

Checks again

*shug*

tl;dr

Why they stopped working out of the atmosphere I do not understand. It doesn't seem to be happening on my current dev version either so I'll just write it off as something I forgot yesterday..

Are you saying they are working fine for you in space? If so I'll start removing mods on my setup to find the conflict. Or if you upload a version with the most recent changes with logging enabled ill look through my log.

Link to comment
Share on other sites

Alright, v1.2

  • Available Torque is now using a float curve for configurable torque/momentum relationship
  • Bleed rate is now using a float curve for configurable decay/momentum relationship
  • Part forcibly activated (*attempt 2*)
  • Logging dump once per second to aid debugging with minimal impact on game performance/stability

note: don't use torque curve for reducing the torque a wheel is capable of. Other mods won't be able to see this in the VAB

Edited by Crzyrndm
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...