Jump to content

[1.12.x] [WIP] CPWE - Configurable Planetary Wind Effects (v0.8.6-alpha)


Recommended Posts

CPWE - Configurable Planetary Wind Effects (v0.8.6-alpha)

This mod is under active development and is a WIP. Everything in here is subject to change.
Please report any bugs and issues to me so I can fix them.

CPWE is a plugin designed to provide a framework for defining wind patterns for any celestial body, including custom/modded ones. These wind patterns will then affect any craft that fly through them.

In the time I spent on flight simulators, wind was always a persistent challenge element, and I've wanted something similar in KSP. However, none of the (admittedly very few) existing wind mods for KSP had what I wanted. Namely, I wanted to be able to configure the wind based on location to allow for interesting wind patterns. At the same time, while I loved the sheer depth that Kerbal Weather Project brought to the game, I felt that running a climate simulation for other celestial bodies might be a bridge too far (especially if we include custom bodies which may not necessarily be grounded in reality). 

CPWE is my attempt at filling the need I created for myself. It is designed to be relatively easy to configure and provides many options for configuring wind patterns and prevailing winds. The structure of the config entries is included on the GitHub wiki page, which will be updated as I update this mod. 

NOTE: CPWE does not add any visual effects to the game. However, integration with a mod that does is something I am considering.

API (Coming Soon™)
At some point in the future, I intend to include an API to allow other mods to not only retrieve the wind vector that CPWE is using, but supply CPWE with their own wind data. Exact details are not yet finalized.

Planned Features (in order of priority):

  • Support for dynamic wind patterns (i.e. ones that can change with time)
  • The aforementioned API
  • Possible integration with other mods

I am open to ideas and feature suggestions. If you have any, please leave them below.

Installation:
Download: 
GitHub: https://github.com/CashnipLeaf/CPWE/releases
Download includes some (kinda terrible) configs for Kerbin, Laythe, and Duna.

Dependencies:

Source: https://github.com/CashnipLeaf/CPWE

Mod Compatibility:
Recommended Mods:

  • Kopernicus
  • KSPCommunityFixes

Compatible With:

  • FerramAerospaceResearch
  • Most, if not all parts mods

Conflicts With:

  • Other mods that modify the stock aerodynamics system

Documentation (WIP):
https://github.com/CashnipLeaf/CPWE/wiki

Known Issues (as of 03/09/2024):

Spoiler
  • While airborne at very low ground speeds, craft may experience a physics-stalling of sorts that is very difficult to escape from. This is particularly noticeable with strong updrafts.  (highest priority issue as of now)
  • The UI may not display properly after reverting a flight.

Changelog:

Spoiler

v0.8.6-alpha (03/09/2024)
- Wind speed and direction now affects air intake performance.
- Added a new shock temperature override that will adjust aerodynamic heating based on wind speed and direction.
- Core functionality has been restructured to allow for more complex features later down the line. 
- Added a TimeSettings node to both flowmaps and wind objects for easier control over wind fade-in and fade-out behavior.
- Stock configs have been made a separate download on the GitHub repository.
- Minor bugfixes and (slightly unhinged) runtime improvements.

v0.8.5-alpha (02/21/2024)
- Added options for dynamic wind elements (i.e. wind that can change with time)
- Removed the ":NEEDS[CPWE]" from the stock configs to allow them to work without ModuleManager. (I don't know why I added that in the first place tbh)
- Updated the stock configs with some dynamic elements (feel free to add more if you want)
- Minor runtime improvements and bug fixes. 

Hotfix v0.8.4.1-alpha (02/02/2024)
- Fixed an issue that led to NullRef spam.

v0.8.4-alpha (02/02/2024)
- Wind objects and Flowmaps can now take in a new AltitudeRange node. This is meant to give greater control over fading in/out with altitude without needing to create an AltitudeSpeedMultiplierCurve. Stock configs have been updated with this new node.
- Partially addressed the physics-stalling issue. It can still occur, but it should now be much easier to escape from this situation if it does happen.
- Added a cap to the width of the GUI for better scaling with higher resolutions.
- Slight restructuring of the source code to make it more compact and readable.  

v0.8.3-alpha (01/30/2024)
- Rolled out a new set of FloatCurves for all Wind objects
- Flowmap AltitudeSpeedMultiplierCurve given a minimum multiplier of 0
- Flowmaps can now have an additional wind speed multiplier vs altitude curve for each axis
- Minor update to aerodynamics override to improve low-ground speed handling
- FAR Compatibility marked as stable

v0.8.2-alpha (01/28/2024)
- Flowmaps now have the option to set different base speeds for all three axes
- The "verticalWindMultiplier" key has been deprecated in favor of the above change
- Fixed: wind objects and flowmaps would not fade out properly at the top of their altitude range when using the maxAlt key
- Fixed: kerbals on EVA would get YEETED by the winds

Hotfix v0.8.1.1-alpha (01/27/2024)
- Fixed: Wind speeds in the UI not being multiplied by the GlobalWindSpeedMultiplier setting
- Fixed: GlobalWindSpeedMultiplier setting not being applied when FAR was installed

v0.8.1-alpha (01/27/2024)
- All wind objects and the flowmap can now take in an AltitudeSpeedMultiplierCurve that can be used in place of the minAlt and maxAlt keys
- Jetstream and Polarstream wind objects can now take in a floatcurve to define their latitude as a function of longitude and longitude as a function of latitude, respectively.
- Flowmap can now take in a VerticalWindMultiplier
- Wiki and Stock Configs updated to reflect the above changes
- Experimental FAR compatibility (please report any issues to me)

v0.8.0-alpha (01/26/2024)
- Initial alpha release

Credits and Acknowledgements (not necessarily in order of contribution):

License Information:

  • The plugin, source code, settings & localization config files, and toolbar icons are licensed under the MIT License
  • All other config files and textures are licensed under the WTFPL license ( http://www.wtfpl.net/ )

ue6thPW.png

Edited by CashnipLeaf
Added modulemanager as a dependency
Link to comment
Share on other sites

Would be interesting if you could add a movement vector to some of the weather components, so you could possibly get hit by a rogue tornado or something. Or the ability to make the flowmap scroll across the planet so you could get gusts of wind. 

Link to comment
Share on other sites

Update v0.8.1-alpha:

  • All wind objects and the flowmap can now take in an AltitudeSpeedMultiplierCurve that can be used in place of the minAlt and maxAlt keys
  • Jetstream and Polarstream wind objects can now take in a floatcurve to define their latitude as a function of longitude and longitude as a function of latitude, respectively.
  • Flowmap can now take in a VerticalWindMultiplier key
  • Wiki and Stock Configs updated to reflect the above changes
  • Experimental FAR compatibility (please report any issues to me)

https://github.com/CashnipLeaf/CPWE/releases/tag/v0.8.1.0-alpha

On 1/27/2024 at 8:59 AM, .Fusion said:

Would be interesting if you could add a movement vector to some of the weather components, so you could possibly get hit by a rogue tornado or something. Or the ability to make the flowmap scroll across the planet so you could get gusts of wind. 

Wind patterns that can move over time are something I already plan to implement, but I did not think about having flowmaps that can move across the body. Thanks for the suggestion :3

Edited by CashnipLeaf
Link to comment
Share on other sites

... Here's a clip of my testing with an extreme windspeed value (80 m/s) and a custom low altitude flowmap https://imgur.com/RYsr6wI

And parachute testing. Unfortunately there happens to be a strong downforce near the KSC so planes can't lift (until the map is edited). That pod would've survived if it had +40m/s crash tolerance but it only had 14m/s.

SK5aQE4.png tetFw5F.png

Link to comment
Share on other sites

Hotfix v0.8.1.1-alpha:

  • Fixed: Wind speeds in the UI not being multiplied by the GlobalWindSpeedMultiplier setting
  • Fixed: GlobalWindSpeedMultiplier setting not being applied when FAR was installed

https://github.com/CashnipLeaf/CPWE/releases/tag/v0.8.1.1-hotfix

P.S. There appears to be an issue where after reverting a flight, the UI is not usable. Changing scenes (i.e. flight to editor) appears to resolve the issue, but I am looking into a more permanent solution.

Edited by CashnipLeaf
Link to comment
Share on other sites

Update v0.8.2-alpha

  • Flowmaps now have the option to set different base speeds for all three axes
  • The "verticalWindMultiplier" key has been deprecated in favor of the above change
  • Fixed: wind objects and flowmaps would not fade out properly at the top of their altitude range when using the maxAlt key
  • Fixed: kerbals on EVA would get YEETED by the winds

https://github.com/CashnipLeaf/CPWE/releases/tag/v0.8.2.0-alpha

GitHub wiki updated to reflect the relevant changes.

Also, a "flowmap stack" data structure will be added in a future update, allowing for easier interpolation between multiple flowmaps at different altitude ranges.

Edited by CashnipLeaf
Link to comment
Share on other sites

Update v0.8.3-alpha

  • Rolled out a new set of FloatCurves for Wind objects:
    • LatitudeCurve: used by JetStream to set the latitude as a function of longitude.
    • LongitudeCurve: used by PolarStream to set the longitude as a function of latitude.
    • RadiusCurve: used by JetStream and PolarStream to define their radius as a function of longitude/latitude.
    • LonLatSpeedMultiplierCurve: used by JetStream and Polarstream to apply a wind speed multiplier as a function of longitude/Latitude.
    • RadiusSpeedMultiplierCurve: used by all Wind objects to apply a wind speed multiplier as a function of the fraction of the distance to the center (where 0 = dead center, 1 = edge of the pattern).
  • Added default fade behavior if no RadiusSpeedMultiplierCurve is inputted.
  • Updates to Flowmap objects:
    • AltitudeSpeedMultiplierCurve now has a minimum multiplier of 0 (i.e. if the multiplier goes below 0, it is instead set to 0). This may make it easier to define fade in/out behavior.
    • Additional wind speed multiplier vs altitude curves can now be applied to each axis. These curves are not clamped to any range.
  • Minor adjustment to the aerodynamics override to improve handling at low ground speeds.
  • FAR Compatibility marked as stable.

https://github.com/CashnipLeaf/CPWE/releases/tag/v0.8.3.0-alpha

Developer note: if the product of the wind speed multipliers comes out to a negative number, the wind direction will be reversed. This may make it easier to create convection currents, especially via a Flowmap.

Documentation has been updated to reflect all the listed changes.

Edited by CashnipLeaf
Link to comment
Share on other sites

Update v0.8.4-alpha:

  • Wind objects and Flowmaps can now take in an AltitudeRange node. This is meant to give greater control over fading in/out with altitude without needing to create an AltitudeSpeedMultiplierCurve. Stock configs have been updated with this new node.
  • Partially addressed the physics-stalling issue. It can still occur, but it should now be much easier to escape from this situation if it does happen.
  • Added a cap to the width of the GUI for better scaling with higher resolutions
  • Slight restructuring of the source code to make it more compact and readable.  

https://github.com/CashnipLeaf/CPWE/releases/tag/v0.8.4.0-alpha

Documentation has been updated to reflect the aforementioned changes.

Edited by CashnipLeaf
Link to comment
Share on other sites

Heads-up No. 2: development on this thing will be a lot slower now that school has kicked into full gear and I don't have nearly as much free time as I would like to (for context: I am a full-time student majoring in computer science). I am hoping to get another update out this weekend when things calm down a bit though. 

Edited by CashnipLeaf
Link to comment
Share on other sites

I somehow just noticed this thing made TOTM Feb 2024 :valwow:. Thank you all so much!

I finally got some time to work on this thing. I should have an update out either today or tomorrow. Then I have midterms the following week and will need to pause development at least until those are done and dusted.

Edited by CashnipLeaf
Link to comment
Share on other sites

Update v0.8.5-alpha:

  • Added options for dynamic wind elements (i.e. wind that can change with time), notably:
    • The Updraft, Vortex, and Converging wind elements can shift position over time.
    • Wind speeds can vary with time.
  • Removed the ":NEEDS[CPWE]" from the stock configs to allow them to work without ModuleManager. (I don't know why I added that in the first place tbh)
  • Updated the stock configs with some dynamic elements (feel free to add more if you want)
  • Minor runtime improvements and bug fixes.  

Documentation has been updated with the aforementioned changes.

https://github.com/CashnipLeaf/CPWE/releases/tag/v0.8.5.0-alpha

Edited by CashnipLeaf
Link to comment
Share on other sites

@CashnipLeafI'm subscribed to @blackrack's patreon Volumetric Clouds. Absolute game changer as far as visual mods go. I stumbled across this forum page and I'd be super stoked if these two mods ever integrated. I asked about possible integration or implementation of something similar. Blackrack had a thoughtful response. Do you have any ideas on these challenges?

Edited by not-a-cylon
formatting
Link to comment
Share on other sites

10 hours ago, not-a-cylon said:

@CashnipLeafI'm subscribed to @blackrack's patreon Volumetric Clouds. Absolute game changer as far as visual mods go. I stumbled across this forum page and I'd be super stoked if these two mods ever integrated. I asked about possible integration or implementation of something similar. Blackrack had a thoughtful response. Do you have any ideas on these challenges?

The implementation you suggested probably isn't feasible within the scope of what this plugin is meant to do. However, some form of integration is definitely possible. See, one of the features I'm planning to include in the API is allowing other mods to input their own wind data for the plugin to use, and I think that may be a more practical way to integrate the two mods: let the visual FX lead the wind FX.

Either way, I will open up more serious discussions with blackrack when I get the API up and running. 

Link to comment
Share on other sites

I am looking to rename this mod at some point. "CPWE" was always meant to be a working title and it also just doesn't roll off the tongue well. If you have any name suggestions for this thing, I'd like to hear them. 

Link to comment
Share on other sites

29 minutes ago, CashnipLeaf said:

I am looking to rename this mod at some point. "CPWE" was always meant to be a working title and it also just doesn't roll off the tongue well. If you have any name suggestions for this thing, I'd like to hear them. 

So I've searched for famous wind names and name of wind gods, here are a few proposals to get started, it's kinda rough, but heh :
HELM High-altitude Environmental Lateral Modifications    (meh, the high altitude part isn't right but anyway)
AURA (Titan goddess of the breeze) : Atmospheric Unique and Reliable Airflows  ("Unique" might need a better alternative, idk "unleashed", other, Reliable could be "Rational", since your mod brings a new clear and consistent framework to the wind modding,...), my favorite solution so far. :) 
ZEPHIR sounds cool as well but I didn't find anything that made sense (yet) haha

Cheers :) 

Edited by kurgut
Link to comment
Share on other sites

  • 2 weeks later...
Posted (edited)

Update v0.8.6-alpha: 

  • Wind speed and direction now affects air intake performance.
  • Added a new shock temperature override that will adjust aerodynamic heating based on wind speed and direction.
  • Core functionality has been restructured to allow for more complex features later down the line. 
  • Added a TimeSettings node to both flowmaps and wind objects for easier control over wind fade-in and fade-out behavior.
  • Stock configs have been made a separate download on the GitHub repository.
  • Minor bugfixes and (slightly unhinged) runtime improvements.

https://github.com/CashnipLeaf/CPWE/releases/tag/v0.8.6.0-alpha

Edited by CashnipLeaf
Link to comment
Share on other sites

I am currently doing a properly unhinged rewrite of my aerodynamics override. But if it works the way I think it will, it should substantially reduce the number of extra calculations that need to be done.

Someone please send help.

Link to comment
Share on other sites

Posted (edited)

I've had some ideas that I've been debating with myself over the past couple of days and I wanted to see what you guys thought: 

Should I add the ability to influence more climate/weather parameters (e.g. temperature and pressure) in this mod? The mod itself would not be a climate/weather simulation, but this would potentially allow it to take in more data from one. 

This would also influence what I decide to rename this thing. If the new scope is broad enough, I might even split it off as a new project (though likely one that would inherit a lot of things from this one).

Edited by CashnipLeaf
Link to comment
Share on other sites

Looking for someone who has experience with climate and/or weather simulations because good god those things have gotta be the least intuitive things I've ever seen. (this may or may not be relevant to what I mentioned in the last post) 

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