Giter Site home page Giter Site logo

waterfall's Introduction

Waterfall

A mod for Kerbal Space Program, intended to provide an alternate way to simulate engine visual effects.

Features

Waterfall is a mod for Kerbal Space Program that provides a cool new way to create and drive engine effects for smooth rocket plumes. It provides

  • Support for atmospheric expansion and all kinds of dynamic effects
  • Cross-compatible with SmokeScreen for adding smoke effects
  • Ingame editor to create and drive effects.
  • A set of template effects to use on your engines

This is a framework mod and does nothing by itself. Pick up a mod that supplies configs in order to have some effect on your game

Dependencies

Required

These components are required for the mod to function and are bundled as part of any download:

Installation

To install, place the GameData folder inside your Kerbal Space Program folder. If asked to overwrite files, please do so.

NOTE: Do NOT rename or move folders within the GameData folder - this mod uses absolute paths to assets and will break if this happens.

Contributing

I certainly accept pull requests. Please target all such things to the dev branch though!

Licensing

Any bundled mods are distributed under their own licenses:

  • ModuleManager by ialdabaoth and sarbian is distributed under a Creative Commons Sharealike license. More details, including source code, can be found here

The rest of the content is distributed under the Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)

You are free to:

  • Share — copy and redistribute the material in any medium or format
  • Adapt — remix, transform, and build upon the material

The licensor cannot revoke these freedoms as long as you follow the license terms.

Under the following terms:

  • Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • NonCommercial — You may not use the material for commercial purposes.
  • ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.
  • No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.

waterfall's People

Contributors

al2me6 avatar arxen42 avatar chrisadderley avatar drveyl avatar jonnyothan avatar knightofstjohn avatar nessux avatar zorg2044 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

waterfall's Issues

Optimization: remove effect modifiers that use missing controllers

A lot of effects in Stock Waterfall Effects are missing controllers (e.g. mach controller for vernierRcsFx); we could remove these modifiers from the lists so they don't cost anything. This isn't super straightforward though because they still need to show up in the right place in the editor in case the controller gets created.

Feature: A controller that tracks other existing controllers, with a configurable time-delay.

Basically, a new controller type, that can be set to track the value of any of the already existing controllers, but with a time delay which is configurable.

This would allow for effects in the plume to "follow" events, and propagate through the plume. for instance, you could make pressure variations in the plume to propagate through the length of the plume, by letting the shock cones expand each after the other, so that it looks like a pressure wave going along the length of the plume.

Feature: Allow Controllers to read ModuleAnimate...

Many engines contain ModuleAnimate... (The "..." refers to different types of animation, there is for example ModuleAnimateHeat or ModuleAnimateGeneric etc). It would be very useful to be able to read these Modules so one could for example make heat blur appear based on the actual heat of the engine, not it's throttle. Or it could be used to show certain effects only when reverse thrust is enabled.

Ability to hide the toolbar button

Dear Devs,

Firstly, mad props to your efforts. These new effects look lovely! However, not everybody is a VFX wizard like you lot and won't use the editor, instead opting for the prebuilt stuff. Could we get an option to hide the button (at least from inflight and inmap?) to clean up our toolbar?

If not directly, perhaps through the lovely Toolbar Controller mod?

Strange Yellow Plume

I am using waterfall and on every single engine there is this yellow line of plume. I cant find it in the editor thought, so I
WaterfallPlumeError
think its bug or im doing something wrong. Please help.

Potential memory leaks identified by KSPCommunityFixes

Latest version of KSPCommunityFixes reports on some potential memory leaks on scene changes. A quick look in the log after scene change to Flight Scene shows 1 potential location in Waterfall where a leak might exist:
[LOG 21:17:03.643] [KSPCF:MemoryLeaks] A destroyed Waterfall:WaterfallUI instance is owning a onGUIApplicationLauncherDestroyed GameEvents callback. No action has been taken, but unless this mod is relying on this pattern, this is likely a memory leak.

Feature: Controller for integration with other mods

Problem

My use case: integration with Advanced Jet Engines (part of RO) that adds variable nozzle animation to some jet engines, making it necessary to scale effect to match visual model changes.
For demonstration, video of my recent attempt at making it play nice with Waterfall: https://youtu.be/5JuvO11Lg_A

In this particular example, effect is rescaled based on value from method GetNozzleArea() on subclassed ModuleEngines. This value is derived from complex jet engine simulation, so it cannot be easily substituted by mach or throttle controllers.

Proposal

Add a new controller type that will have following parameters:

  1. methodOrPropertyName - method or property to search on ModuleEngines using reflection. Should return numeric value, of course. For AJE integration that would be "GetNozzleArea()" method, for other mods something else.
  2. Maybe moduleName for additional flexibility in case desired value is not in the ModuleEngines, but not sure about that.
  3. minValue/maxValue: expected value range. Values outside of that range will be clamped, values inside will be normalized to 0..1 range.
  4. responseRateUp/responseRateDown - same as on throttle controller.

Example configuration:

CONTROLLER
{
  name                 = jetNozzleArea
  linkedTo             = custom_value
  methodOrPropertyName = GetNozzleArea
  engineID             = none
  minValue             = 0.4
  maxValue             = 1.25
  responseRateUp       = 1
  responseRateDown     = 1
}

Motivation

To add easy config-only way of binding Waterfall effects to arbitrary values, leaving custom controller only for most complex cases.

I already made basic implementation for testing, so if you're ok with that idea, I will finish it and make PR when ready.
If it is "hard no", then no problem, I will go with custom controller and drive it from AJE.
I just felt that Waterfall could use some starting ground that would not require mod code changes from plume configs writer.

perlin noise random controller doesn't work

I've noticed that perlin noise doesn't do anything anymore. I noticed it since 0.5.0. I think it worked before but not sure.

the issue is that if i create a new controller, set it to perlin, and let it control some mesh variable, like for instance the linear expansion of a cylinder, it still just outputs a standard random variable, not perlin. Even when I check the "override" button and manually slide the controller, it doesn't actually do anything, and the mesh keeps acting as if it's getting input from a standard random variable.

The same happens if I manually add a controller in the .cfg file. it also still gives a standard random variable output.

Technically I don't know if it gives a standard random variable, it just looks really fast, so it could still be a high frequency perlin, but what I am sure is that I cant override it.

Also: when I open up the "edit" gui to change the controller settings, it has "random" selected, and not "perlin" even though it's set up as a perlin.

Feature Request: Ability to dynamically load templates

When we add a new effect, right now we manually set up all the parameters. But Waterfall comes with several template effects, and it would be outstanding to be able to select them from a list and then tweak the values.

Possible issue in Settings.cs

I am seeing errors in the ksp log from waterfall.

[LOG 15:41:53.174] [Waterfall][Settings]: Started loading
[ERR 15:41:53.174] Cannot find config in file : WATERFALL_SETTINGS

[LOG 15:41:53.174] [Waterfall][Settings]: Using specified settings

I am not 100% certain but I think the issue is being caused by the way the settings files is calling the config.

settingsNode = GameDatabase.Instance.GetConfigNode("Waterfall/WATERFALL_SETTINGS");

this appears to be different than how the assets are getting called

foreach (ConfigNode node in GameDatabase.Instance.GetConfigNodes("WATERFALL_MODEL"))

I am wondering if the error is being caused by the "Waterfall/" when looking for the config.

I should clarify that I am running ksp 1.9.1 and can provide a full log if needed.

Bug: Weird flickering interaction between Volumetric, Additive Echo and Additive Dynamic

While creating some engine FX Ive run into this annoying visual glitch.
Anytime I put either a Volumetric, Volumetric Cones or Additive Echo inside of a basic Additive Dynamic object (I want to create mach diamonds in a plume and dont add 10 different objects), the Volumetric or Echo objects flicker and change brightness while panning the camera around. It looks like the game cant decide if the cones are infront or inside the plume or something.

Ive attached a short video to demonstrate what I mean:

2023-03-01.17-52-56.m4.mp4

(MachDiamonds is a Volumetic Cones object,
MachDiamonds2 is aAdditive Echo one and
MachDiamonds3 is a single mach diamond as a basic Additive Dynamic object)

Edit: Plume and EdgePlume are both Additive Dynamic objects, with some fresnel and invert fresnel, respectively

Editing Throttle Controller on MultiModeEngine causes loss of engine ID

When editing a throttle controller on e.g. a Panther engine, to change e.g. the spool up time, pressing "apply" makes the internal WaterfallFX module loose the engine ID of "Wet", and it instead becomes nothing. This loss of engine Module also applies when the Module is exported to clipboard, one has to manually re-enter the engine ID.
This issue makes tuning the throttle response speed properly quite a pain as I have to restart my game with changed configs every time I want to make a change.

Create Model Edit Panel

Create the Model Edit panel, which will allow reparenting and viewing of effect model parameters

Feature: Thrust instead of throttle for jet engines

jet engine's thrust is not decided by throttle only. the secondary factor here is mainly speed and height mult (and intake air if this craft use really tight design)
So can it read the thrust and then adjust brightness according to thrust instead of throttle?
(for example, for stock RAPIER for a typical stock clippiboi SSTO, its thrust curve practically is 92kN liftoff, maximum 300kN at 5-10km, and then fade to 30kN at 20km. Using waterfall config make it ridiculously luminous at 20km (thrust is little, but I'm running with full throttle so full brightness) and dark at 5-9km (thrust is almost constant at 388kN)
image
The acceleration in the image is roughly a reference of total thrust given the vessel is very aerodynamically smooth.
And this problem is mainly for jet engines.

How to use

how to use i see no symbole at the side or anithing (in the game) pls help.

using ADD, MULTIPLY or SUBTRACT on a variable that isn't defined by a modifier makes the variable change continuously

This is a bug that is very similar to a previously fixed bug.
If you do not first set a variable, like scale, position, material float,... using a modifier on REPLACE (controlled by a controller), then using an ADD, MULTIPLY or SUBTRACT modifier on the variable makes it change continuously according to the modifier type.

Example:
have a cylinder with ExpandOffset = 1 by just setting the value on 1 using the material editor UI.
then add a ADD modifier that adds a value between 1 and 2 to the ExpandOffset based on, for instance, throttle.
the modifier will keep adding that value every tick, and the cylinder will start expanding indefinitely.

I think the intended behavior is that it should add once, even if the original variable isn't set by a REPLACE modifier first.

Toolbar button does not gracefully handle the scenario where no engines are using Waterfall

This was with Waterfall 0.5.0. Windows install, if that matters.

I understand that Waterfall isn't going to have any effect if none of the other mods that make use of it are installed yet, but not only does it 'do nothing' in that case but it also throws errors and garbles the IMGUI window display when I try to click Waterfall's toolbar button.

From the Player.log record, it looks like it starts an IMGUI layout with BeginHorizontal, but never reaches the associated EndHorizontal possibly because it aborted partway through from some error condition check.

This is what it looks like:
screenshot48

And this is the error in the log that goes with that picture:

(Filename: <fa6f9762ac624af092525d37c9d516c4> Line: 0)

ArgumentException: GUILayout: Mismatched LayoutGroup.repaint
  at UnityEngine.GUILayoutUtility.BeginLayoutGroup (UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options, System.Type layoutType) [0x00089] in <fa6f9762ac624af092525d37c9d516c4>:0 
  at UnityEngine.GUILayout.BeginHorizontal (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) [0x00001] in <fa6f9762ac624af092525d37c9d516c4>:0 
  at UnityEngine.GUILayout.BeginHorizontal (UnityEngine.GUILayoutOption[] options) [0x0000b] in <fa6f9762ac624af092525d37c9d516c4>:0 
  at Waterfall.UI.WaterfallUI.DrawWindow (System.Int32 windowId) [0x00006] in <607e9d06e3f64f61be4263c957580703>:0 
  at UnityEngine.GUILayout+LayoutedWindow.DoWindow (System.Int32 windowID) [0x00077] in <fa6f9762ac624af092525d37c9d516c4>:0 
  at UnityEngine.GUI.CallWindowDelegate (UnityEngine.GUI+WindowFunction func, System.Int32 id, System.Int32 instanceID, UnityEngine.GUISkin _skin, System.Int32 forceRect, System.Single width, System.Single height, UnityEngine.GUIStyle style) [0x00077] in <fa6f9762ac624af092525d37c9d516c4>:0 
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)

After I install any of the mods that make use of Waterfall, the settings window stops throwing this error and you can see it.

Expected behavior: Waterfall has no effect if none of the mods that use it exist, but at least you should be able to click open its settings window without throwing errors. (Even if all the settings window says in that case is something like "no mods using Waterfall have been detected", that would still probably be better.)

Feature: Soft edges

Investigate depth-based soft edges to fade effects when they intersect with other solid objects.

Create Material Edit Panel

Create the Material Edit panel, which will allow editing and viewing of effect material parameters. This should generally allow the user to

  • Change shaders
  • Change shader property field values (textures, colors, floats)

Effect templating

Add the ability to specify templates defined elsewhere in a config.

Engine plumes still visible through parts

the forum thread says that the bug has been fixed but it still occurs. I have done some testing and found 2 shaders that make effects show through parts, those being additive directional and additive volumetric. I have not found other shaders or effects that do so.

there's something that seems related at line 318 and later in the shader code, maybe something wrong there?

Issue with copying to clipboard

I've recently made some new plumes for RSS/RO using the in-game editor, copied the modules to my clipboard, made patches, etc. and have noticed errors popping up when using the parts after restarting. I didn't save the log(s) as I believe I've tracked down the issue. It's solved on my end at least... the copied output supplies:

MODULE {
name = ModuleWaterfallFX
.....
EFFECT {
......
MODEL {
.....
MATERIAL {
.....
FLOATMODIFIER {
name = aTintFallof <----
.....
floatName = _TintFallof <----
.....
}
FLOATMODIFIER {
name = aFallof <----
.....
floatName = _Fallof <----
.....
} } } } }

I don't remember the exact verbiage of the error, but it was referencing the fact that there is no floatName "x." For whatever reason it seems to be outputting incorrect names. I hope you can still make sense of this chopped down version of the issue, but if not let me know and I'll recreate it to get a log for you. As usual, thanks for all you do. Cheers.

WaterfallFX Editor is unusable

When attempting to open the editor, with the button on the right hand panel, a mostly blank window appears. This window only has cropped text at the top of the window saying "WaterfallFX Editor". I am using the latest version of waterfall and I have tried it on a stock KSP install, on both Linux and Windows KSP players, but this bug still happens. See link: https://imgur.com/a/oV76DAp

Glitched in-game config gui.

After installing the mod I tried using the in-game config tab, but when it opened it was blank.

Edit: I had the Scatterer and EVE visual mods also installed, and I installed Waterfall through CKAN.

See plumes through the engine

The vector you can see the plume though the engine.
It happens both on the RS-25(HydroLox), and Rapter(MethoxLox) setting
Screenshot_20220415_112346

Inconsistency between "name" and "linkedTo" properties

Greetings! I wanted to propose a little code cleanup pull request before working on #72, but encountered a little inconsistency. I don't have much experience with KSP modding so I don't completely understand myself what can and what cannot be changed, so asking here.

So, there are controllers like AtmosphereDepthsController and others, each have two properties. Currently in constructor they are assigned like this:

Controller name linkedTo
AtmosphereDensityController atmosphereDensity atmosphere_density
CustomController throttle custom
EngineEventController engineEvent engineEvent
GimbalController gimbal engine_gimbal
LightController light light
MachController mach mach
RCSController rcs rcs
RandomnessController random random
ThrottleController throttle throttle
ThrustController thrust thrust

I suppose the name property is just default that is usually overridden by user anyway, but not sure (judging by UIControllerPopupWindow it is linked_to that is used as a reference to controller type, not name).

If this is right, I will do a little cleanup and put linked_to values into respective constants, eliminating plain strings from other code.

P.S. I've noticed this in LightController constructor:

node.TryGetValue("light", ref name);

I guess that's a typo and it was supposed to be

node.TryGetValue(nameof(name), ref name);

Also note that in this line in UIControllerPopupWindow:

string[] controllerTypes = new string[] { "atmosphere_density", "custom", "engineEvent", "gimbal", "light", "mach", "random", "rcs", "throttle", "thrust" };

linked_to value is used everywhere aside from gimbal. Same in everywhere else, string gimbal is used instead of engine_gimbal. Not sure why is that, but I suppose that's a bug.

ADD modifier doesn't reset value

Hi.
I've noticed that when I try to use the ADD modifier in the editor, for instance to add a random oscillation on the width of a plume, the result is that the plume starts widening indefinitely. I think this is not(?) intended. What should happen is the random value gets added to the standard width (for instance the x and y scale of the tail) and the next tick, the standard width is reset, and a new random value is added. Instead what I think happens is: In the new tick, the width doesn't get reset, and another random value gets added, making the width expand over time.

Feature: allow controller slider to adapt to the min/max of the effect it is controlling

• The slider that displays the modifier value goes out of visual range of the slider bar (on the left) if you have negative values for a random controller.

• The slider that displays the modifier value goes out of visual range of the slider bar (on the right) for the atmospheric controller. It starts out at a value of 1.07 at the runway, but the slider bar only goes to 1. (this has been happening since you added the exponential height compensation curve)

Multiple template support

MVP
Support instantiation of multiple templates from config

Stretch goal
Support instantiation of multiple templates from config with full support in the ingame editor.

Add button does not work

Pressing the Add button in the effects panel does not seem to add any effects.
I tried it with version 7.1 and 7.0.

Feature: Detail shader

Add a variant of the Additive (Dynamic) shader with support for scrolling/tiling a second detail texture

GUI Error: You are pushing more GUIClips than you are pooping.

Getting a weird error in a testing RSS RO save "GUI Error: You are pushing more GUIClips than you are pooping. Make sure they are balanced" No crash but it is causing quite a bit of log spam. The log spam only starts after trying to edit the plume of an engine. Il try updating my version of waterfall (pre engine sounds)

image
[ERR 21:44:31.712] GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced.

[EXC 21:44:31.714] ArgumentException: GUILayout: Mismatched LayoutGroup.repaint
UnityEngine.GUILayoutUtility.BeginLayoutGroup (UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options, System.Type layoutType) (at :0)
UnityEngine.GUILayout.BeginHorizontal (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at :0)
UnityEngine.GUILayout.BeginHorizontal (UnityEngine.GUILayoutOption[] options) (at :0)
Waterfall.UI.WaterfallUI.DrawHeader () (at <0999e3071be647559608c59c265f4138>:0)
Waterfall.UI.WaterfallUI.DrawWindow (System.Int32 windowId) (at <0999e3071be647559608c59c265f4138>:0)
UnityEngine.GUI.CallWindowDelegate (UnityEngine.GUI+WindowFunction func, System.Int32 id, System.Int32 instanceID, UnityEngine.GUISkin _skin, System.Int32 forceRect, System.Single width, System.Single height, UnityEngine.GUIStyle style) (at :0)
[EXC 21:44:31.728] NullReferenceException: Object reference not set to an instance of an object
Waterfall.EffectModifier.Apply (System.Collections.Generic.List`1[T] strength) (at <0999e3071be647559608c59c265f4138>:0)
Waterfall.WaterfallEffect.Update () (at <0999e3071be647559608c59c265f4138>:0)
Waterfall.ModuleWaterfallFX.LateUpdate () (at <0999e3071be647559608c59c265f4138>:0)
[EXC 21:44:31.796] NullReferenceException: Object reference not set to an instance of an object
Waterfall.WaterfallEffect.SetEnabled (System.Boolean state) (at <0999e3071be647559608c59c265f4138>:0)
Waterfall.UI.UIEffectWidget.Draw () (at <0999e3071be647559608c59c265f4138>:0)
Waterfall.UI.WaterfallUI.DrawEffectsList () (at <0999e3071be647559608c59c265f4138>:0)
Waterfall.UI.WaterfallUI.DrawWindow (System.Int32 windowId) (at <0999e3071be647559608c59c265f4138>:0)
UnityEngine.GUI.CallWindowDelegate (UnityEngine.GUI+WindowFunction func, System.Int32 id, System.Int32 instanceID, UnityEngine.GUISkin _skin, System.Int32 forceRect, System.Single width, System.Single height, UnityEngine.GUIStyle style) (at :0)
image

Feature: Desynchronize Randomness Controllers

Currently, all Effect Models on an effect share the same randomness value extracted from a controller. This causes plume synchronization and is overall bad. Implement something to deal with this.

Frame ghosting inside plumes

For some reason, the frame ghosting happens only inside the plumes and not outside.
Visual mods installed:
-AVP 3:v4.12
-Scatterer 3:v0.0834
-EVE Redux 3:1.11.6.1
-DistantObjectEnhancement /L v2.1.1.6
-Waterfall Core 0.8.1
-Stock Waterfall Effects 0.6.3
-Minimum Ambient Lighting Updated 1.2.6.2
-Planetshine 0.2.6.6
-4kSP expanded 0.2.1.6
Game version:
-KSP 1.12.3.3173
-Making History 1.12.1
-Breaking Ground 1.7.1
Computer specs:
-CPU: Ryzen 7 3700U w/ Graphics
-GPU: Radeon Vega 10 Mobile
-Memory: 20 gigs (4 gigs soldered, 16 SODIMM)
screenshot15
screenshot12
screenshot13
screenshot10
screenshot16

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.