Jump to content

[1.3.0] Kerbalism v1.2.9


ShotgunNinja

Recommended Posts

Neither of the testing mini_particle.compiled worked for me. Just to make sure i'm doing it right, I go replace the mini particle file in the shaders, open KSP, open my save, wait a few minutes and go into the tracking station, where I tick all those boxes. At this point, i'm still in the tracking station and nothing is happening.

I did some testing: It seems that clicking on a planet that doesn't have a radiation profile, it shows the radiation from it's parent body. Normal?

Edited by BashGordon33
Link to comment
Share on other sites

@BashGordon33 You did it right. Too bad they aren't working.

35 minutes ago, BashGordon33 said:

It seems that clicking on a planet that doesn't have a radiation profile, it shows the radiation from it's parent body. Normal?

Yes that is intended behaviour. If you focus on a moon without fields (or a vessel orbiting that moon), then the fields that interest you are the one of the parent body.

Link to comment
Share on other sites

10 hours ago, ShotgunNinja said:

@BashGordon33 You did it right. Too bad they aren't working.

Yes that is intended behaviour. If you focus on a moon without fields (or a vessel orbiting that moon), then the fields that interest you are the one of the parent body.

It's alright, I'll just use 1.0.8 instead. Unless the radiation particles are only an indicator, if so I'll just have to deal without being able to actually see the radiation. Also, tell me if any of my old science definitions won't make sense with the new radiation module and I'll change them. And I'm sorry, but because I can't get 1.0.9 to work, I can't make any patches for NH or any other planet packs.

Link to comment
Share on other sites

10 minutes ago, Death Engineering said:

Is the nVidia issue that the radiation belts are not visible?

Saddly yes, but -force-opengl on the shortcut makes them visible, dunno why no one likes opengl it's less ram hog than dx.
 

6 minutes ago, cy4n said:

How would I go about adding a custom greenhouse?

I made a model and imported it into the game, but I'm not sure how to add an emissive texture.

http://imgur.com/gallery/Fmvie

You can only animate emissives and lights in unity, trying to mix animations from blender or 3dmax with unity always ends up with something not working, so you should animate all in unity unless you only need parts moving.

In unity just add a mesh renderer to whatever you want (in your case the entire model), select the material (or add one if you didn't yet) and set the shaders KSP>Emitter>diffuse or spec, pick your textures, then press ctrl+6, you should see the animation windows poping up, in there create a new animation and name it however you're gonna call it on the .cfg (usually something like myhorse_lights).

Add a property and look for the part you wannit shinny, then > Mesh renderer > Material.emissive.color or some crap like that, you should see the RGB channels and one more homeless color, don't pay attention to that.

In that animation thing you'll see a time line (or frames, whatevah), make sure you're at the zero frame, go to the time you want your animation to stop and add a key and set the values for the RGB channels to something higher than the one you started with and that's it, at the bottom of that animation windows there's also 2 options for you to play with, curves and dopesheet, curves is more awesome but some light turning on/off doesn't need awesomeness.

Link to comment
Share on other sites

Hi ShotgunNinja,

thanks for this essential mod. I even paused at the last game-update till you updatet to actuall version.
Now with this new anti-radiation-part you made my day.
Today I outfitted my minmus space station with this part.
Radiation went from 0,002 rad to 0,001 (with two parts).
Then I went to KSP and had the window of that space station open.
In background radiation went up to 0,002 again.
When I went back to the station it went again to 0,001.

This means: there seems to be a problem with that part if calculated in background.
Could you please look on your anti-radiation-part in background use again, thanks!

 

Edited by PieBue
Link to comment
Share on other sites

Here is another one for you SN,

Win7 64bit, Dx9, NVidia Gefoce GT 610, Driver version 10.18.13.5850... Doesn't work with directX. Works fine with OpenGL. Good call Kerbos, I forgot about that cache thing. I think you can delete said files from the HD too. So off I go to test all the newer shaders. I'm not really expecting much here though.

Link to comment
Share on other sites

I'm gonna take a guess and say it didn't change anything @DarkonZ? :(

First off turns out shaders are amazing.

Spoiler

screenshot50.png

Now with the real reason, @ShotgunNinja, I was trying to figure out what was so different from my system that makes possible for me to see the belts with Dx9, and the only thing I could imagine was that I had installed Visual Studio and silverlight along with Unity 5, so probably something changed there, uninstalling it wouldn't be a final test because windows has this thing about leaving a bunch of stuffs behind, and it took too much time for me to track those leftovers and nothing changed.

But there was one more thing, and I don't know how to test that, my directx is heavily modified because I did had a lot of troubles with other games, so there's way too many fixes I used for it especially playing ARK, and that game wouldn't run with dx9, so I had to force my dx9 to read instructions from dx11 (horrible experience and performance), so I've look for some data concerning dx9 Cg coding, and I don't understand sheit but the line that says SV_POSITION doesn't appear anywhere to be used, instead it seems like that function thingy is only for dx10 and above, the closest thing for dx9 was POSITION, could that be the error since KSP use dx9?

PS: Heading of my log just for how my pc is seen by KSP and the link to where I saw that.

Spoiler

 

Kerbal Space Program - 1.1.3.1289 (WindowsPlayer)


OS: Windows 7 Service Pack 1 (6.1.7601) 64bit
CPU: AMD Phenom(tm) II X3 720 Processor (3)
RAM: 4096
GPU: NVIDIA GeForce GT 240 (978MB)
SM: 30 (Direct3D 9.0c [nvd3dum.dll 9.18.13.4192])
RT Formats: ARGB32, Depth, ARGBHalf, Shadowmap, RGB565, Default, ARGB2101010, DefaultHDR, ARGBFloat, RGFloat, RGHalf, RFloat, RHalf, R8

 

 

Link to comment
Share on other sites

@cy4n In the model assign an emissive texture to some object. Test how it look with intensities from 0 to 1. In the greenhouse module definition, indicate the name of the object with the emissive texture in 'emissive_object' property. Then in-code I set the emissive intensity.

If you want to use some other techniques like animations or lights I could extend the greenhouse code to do that.

 

@PieBue Thanks I'll check that.

 

NEW TEST: mini_particle.compiled Move-replace it in Kerbalism/Shaders and try to see the fields.

Link to comment
Share on other sites

Version 1.1.0 released:

  - scrolling inside a window will not zoom the camera anymore
  - optimization: compute vessel position only once
  - balance: radiation levels fade off between zones
  - balance: increased NERV radiation
  - fix: fields rendering on some Nvidia GPUs
  - fix: planner exception with unmanned vessels
  - fix: Vall use 'surface' radiation model
  - fix: workaround for SCANsat issue #234 (versions before 16.6)
  - fix: resource cache will not break BackgroundProcessing
  - fix: cross belts contract can be completed with unmanned vessels
  - fix: active shield not working in background

Link to comment
Share on other sites

Hi there,

 

I've started my first career with Kerbalism a few days ago, mostly use unmanned until now, but there's something weird (I think) : in the planner, I've got no info on food, oxygen, etc... It only shows EC and Environnement, like that :

4392688b-8446-42cd-b296-f8854cf9f3fc.jpg

 

But I think I should have more info like on the screen on the wiki : 

new_planner.png

 

Maybe I'm doing something wrong or I missed something ?

Thanks :wink:

Edited by Cassin
Link to comment
Share on other sites

Awesome, got a new release, also "increased NERV radiation", now I just need to unlock that on my career mode to keep poisoning my kerbals, they already hate me for setting a space station on the inner belt, blame KerboDyne, they want it there :D.

9 hours ago, ShotgunNinja said:

@cy4n In the model assign an emissive texture to some object. Test how it look with intensities from 0 to 1. In the greenhouse module definition, indicate the name of the object with the emissive texture in 'emissive_object' property. Then in-code I set the emissive intensity.

If you want to use some other techniques like animations or lights I could extend the greenhouse code to do that.

This caught my attention, you mean you can simply add the lights by coding? without doing the animation itself b4 exporting to .mu?

Because right now I'm seriously getting tired of using Unity 4.2 for animate and Unity 5 to re export the materials from blender without losing mixes and diffuse values on the nodes. Besides exporting animations from Unity 5 to .mu is downright broken thx to Unity devs.

I've tried to find workarounds and found this little gem:

Spoiler

public static class LegacyAnimationFixer

{

    [MenuItem("Assets/Convert to Legacy Animation", validate = true)]

    static bool CanConvert()

    {

        bool canConvert = false;

 

        foreach (var obj in Selection.objects)

        {

            if (obj is AnimationClip)

                canConvert = true;

        }

 

        return canConvert;

    }

 

    [MenuItem("Assets/Convert to Legacy Animation", validate = false)]

    static void ConvertToLegacyAnim()

    {

        foreach (var obj in Selection.objects)

        {

            AnimationClip clip = obj as AnimationClip;

            if (clip != null)

                DoConvert(clip);

        }

    }

#if UNITY_4_0 || UNITY_4_0_1 || UNITY_4_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5 || UNITY_4_6

 

    private static MethodInfo getAnimationType = null;

 

    static void DoConvert(AnimationClip clip)

    {

        bool dirty = false;

 

        if (GetAnimationType(clip) != ModelImporterAnimationType.Legacy)

        {

            AnimationUtility.SetAnimationType(clip, ModelImporterAnimationType.Legacy);

            dirty = true;

        }

 

        EditorCurveBinding[] bindings = AnimationUtility.GetCurveBindings(clip);

        List<AnimationCurve> curves = new List<AnimationCurve>();

 

        bool rebuildClip = false;

 

        for (int i = 0; i < bindings.Length; i++)

        {

            curves.Add(AnimationUtility.GetEditorCurve(clip, bindings));

 

            var binding = bindings;

 

            if (binding.propertyName.StartsWith("Material.") && binding.type == typeof(MeshRenderer))

            {

                rebuildClip = true;

                binding.propertyName = binding.propertyName.Substring("Material.".Length);

                binding.type = typeof(Material);

                bindings = binding;

            }

        }

 

        if (rebuildClip)

        {

            dirty = true;

 

            clip.ClearCurves();

 

            for (int i = 0; i < bindings.Length; i++)

            {

                AnimationUtility.SetEditorCurve(clip, bindings, curves);

            }

        }

 

        if (dirty)

        {

            EditorUtility.SetDirty(clip);

        }

    }

 

    static ModelImporterAnimationType GetAnimationType(AnimationClip clip)

    {

        if (getAnimationType == null)

        {

            getAnimationType = typeof(AnimationUtility).GetMethod("GetAnimationType", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static);

        }

 

        return (ModelImporterAnimationType)getAnimationType.Invoke(null, new object[] { clip });

    }

#else

 

    static void DoConvert(AnimationClip clip)

    {

        bool dirty = false;

 

        if (!clip.legacy)

        {

            clip.legacy = true;

            dirty = true;

        }

 

        EditorCurveBinding[] bindings = AnimationUtility.GetCurveBindings(clip);

        List<AnimationCurve> curves = new List<AnimationCurve>();

 

        bool rebuildClip = false;

 

        for (int i = 0; i < bindings.Length; i++)

        {

            curves.Add(AnimationUtility.GetEditorCurve(clip, bindings));

 

            var binding = bindings;

 

            if (binding.propertyName.StartsWith("material.") && binding.type == typeof(MeshRenderer))

            {

                rebuildClip = true;

                binding.propertyName = binding.propertyName.Substring("material.".Length);

                binding.type = typeof(Material);

                bindings = binding;

            }

        }

 

        if (rebuildClip)

        {

            dirty = true;

 

            clip.ClearCurves();

 

            for (int i = 0; i < bindings.Length; i++)

            {

                AnimationUtility.SetEditorCurve(clip, bindings, curves);

            }

        }

 

        if (dirty)

        {

            EditorUtility.SetDirty(clip);

        }

    }

 

#endif

}

But since I suck I don't even know how to use it or where it should go, it's random gibberish to me, so to sum this up, you could code a light source?

Let's say a point lamp, just by adding an empty GameObject with a mesh size 0,0,0 but with an emissive texture (texture 1x1 pixel black, emissive 1x1 pixel white) and setting intensity and/or radius into the config after the model is exported? Like that?

Edited by Kerbos
Link to comment
Share on other sites

@Viruzzz Nice idea, I'll add that.

 

@Kerbos Let me explain: to obtain the effect of the greenhouse artificial lighting, that can be controlled in a 0..1 range, I can use a variety of techniques.

For example, I could set the intensity of a point light source. Or I could set the 'emissivity' of an emissive texture in an object (as I'm doing for the greenhouse).

If I wanted to do more complex things (like eg: regulate a set of light sources, or maybe doing a light source and an emissive texture at the same time) I could 'still-play' an animation to a specific point in time such that it map to 0..1 range. In a sense, you can see the animation as modifing some properties of some objects over time: be it position, rotation, the intensity of a point light source, or maybe the UV offset/scale of a texture, etc. 

For example, both the geiger counter indicator and the active shield lights are driven by an animation that I 'still-play'. For the greenhouse I used the emissive texture technique because the zzz model had an emissive texture already.

 

56 minutes ago, Kerbos said:

you can simply add the lights by coding?
[...]
Let's say a point lamp, just by adding an empty GameObject with a mesh size 0,0,0 but with an emissive texture (texture 1x1 pixel black, emissive 1x1 pixel white) and setting intensity and/or radius into the config after the model is exported? Like that?

Yes, and is even simpler than that: you can just add a Light component to a GameObject, at run-time. Or you could generate a simple mesh (eg: a sphere) and set it with an 1x1 emissive texture and make a bulb at run-time (that, to clarify, doesn't really emit light on its surrounding). Or both.

 

56 minutes ago, Kerbos said:

I'm seriously getting tired of using Unity 4.2 for animate and Unity 5 to re export the materials from blender without losing mixes and diffuse values on the nodes. Besides exporting animations from Unity 5 to .mu is downright broken thx to Unity devs

Didn't know how bad it was... I haven't messed up with Unity editor at all, except for compiling the shaders.

 

56 minutes ago, Kerbos said:

I've tried to find workarounds and found this little gem: [...]

From a very summary read it seem that code is meant to run in the Unity editor, and probably convert legacy clips (unity 4?) into non-legacy clips (unity 5?).

Edited by ShotgunNinja
Link to comment
Share on other sites

@ShotgunNinja Thx for the explanation, this could actually be the key to work an entire model on Unity 5 and getting color curves animations outside it without much hassle, Im' still trying to pull out the MedBay, but I got hit by the export steel wall and had to put it on hold, the object triggering the error was a beacon, sort of like this:

Spoiler

light_0_gray1_jpg37e83850_59aa_491d_9fc6tumblr_mvfp8gWB381s0abggo1_400.gif

But my original idea was making a rotatory 4 sided larger cage, so in the final result it would look like 4 beams of red light rotating with actual light, discarded coz would be memory expensive, so changed to an alpha channel testing emissive extraction/difference/add at first, so every texture "illuminated" by the rotatory beacon light would look redish, but that's when I got to fight against another issue that I've never mentioned, I'm color blind, baking colors for me it's hard as hell and it really helps if I can read the values and see the mixer, so my final idea was just making a transparent red emitter, but KSP doesn't like transparency plus looks very bizarre.

So it is entirely possible to code my second attempt? A triggered diffuse emissive red texture (with a static degraded intensity from the origin 100%--->1%), let's say 4 mts radius mesh on KSP, that use the red channel to add red to whatever other texture comes inside his mesh but excluding (or blocked) by the rotatory cage?

2 hours ago, ShotgunNinja said:

From a very summary read it seem that code is meant to run in the Unity editor, and probably convert legacy clips (unity 4?) into non-legacy clips (unity 5?).

Sry, I forgot to quote the rest of where I got the code, it has the explanation for what it is and everything, but it just goes over my head -link-. I know this has nothing to do with kerbalism, but maybe you could find some info in there to add or improve stuffs on the mod itself.

Cheers and thx for the cancelled zoom on window scroll, that was driving me crazy, dunno why never said anything about it.

Link to comment
Share on other sites

@Kerbos I see, so it seem you can't animate properties in Unity 5 unless you go through some elaborate gimnastic, that the script you posted try to automate.

I'm thinking, if the light rotate fast enough it could be approximated by one spotlight, that is acceptable in term of performance. Even two lights may be okay. At that point I could rotate it in code, directly or by animation (that I think should be possible in Unity 5 as you are only animating the transform).

About emissive textures: they can't influence other objects, at least not usually in real-time renderers and certainly not in something as simple as Unity. The surface of the object is not really emitting light, just the rendering gives it some 'intrinsic lighting' in addition to the usual ambient+diffuse+specular lighting.

The D.E.R.P. mod I recall had some emergency light part, maybe look at how it was implemented for ideas.

Edited by ShotgunNinja
Link to comment
Share on other sites

First of all, thank you author for great idea & implementation! 

And, a question: Is it possible to disable science part of Kerbalism? I want to use some science mods, and probably this mod can broken balance in this case. But I want to save relay network feature (or may be I can have it using RemoteTech)

Edited by Polnoch
Link to comment
Share on other sites

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