Jump to content

Somewhere to put any knowledge learned about using the .mu plugin.


Recommended Posts

Hi @REDACT3D. Sorry, not on as much due to having a job now.

Lot to unpack but I will see what I can do. You obviously have worked out how to make wings that will mirror. Writing is just having one side that has the text one way and the other side having it reversed. That way when it gets flipped, the underside from left becomes the top side of right and so the text reads correctly.

On 11/22/2022 at 4:54 AM, REDACT3D said:

Say, any way to reload the mods (or refresh the parts) without needing to reboot? 

No. Everything gets loaded into memory. You could actually remove parts from folders or entire folders within GameData while the game is loaded and it wouldn't affect anything in that session. But if you went out and then reloaded, those things you removed wouldn't be loaded.

On 11/22/2022 at 4:54 AM, REDACT3D said:

From your example above, it looks like you can just use whatever as a suffix?

Yes. As long as each one is unique. You will notice that I have the parameter  stackSymmetry = 1  at the bottom? If you want 2 or more nodes to both fill at the same time then you can name them the same except for having a different number at the end. The stackSymmetry parameter works like this. A value of 1 will mean that 2 nodes named the same except for a different end number, will both fill when mirror mode or multiple radial attachment are used in the VAB/SPH. A value of 2 will allow 3 to fill at the same time and so forth. I have found that sometimes with 3 or more attaching you may need to change which node has 1, 2, or 3 etc at the end in order to have the node you would most likely attach to first, fill the rest in the VAB. I had to do this for my Thunderbird 3 to get it to fill correctly when attaching the engines in the VAB. The Frame for thunderbird 5 to get to orbit, I could never get to attach correctly. It had 4 attach nodes the same.

So in the Blackbird example I have several different nodes that attach 2 at a time. For the flaps and tails I just remove the right ones from symmetry after attachment 

and rotate them 180 degrees, so they are the correct way around for that side.

You can actually have nodes that are angled other than the 3 main axies by doing a combination of rotational co-ordinates to achieve the desired direction.

On 11/22/2022 at 5:24 AM, REDACT3D said:

the bold gets removed when inserted into the code :( (<>)

The bold was just to make it clear which ones I was talking about. They aren't bold in the config.

// Comments are what I know it does

Below is what the config you guessed did, actually does.
 

Spoiler

PART
{
    name = winglet3 // The unique part identifier. Each one loaded must be unique in the game. Good practice is to add your sig initials to be

sure.
    module = Part   // This should always be in a part config. Other things in the game also use configs, like resources, They have their own

identifiers.
    author = NovaSilisko // This is not used in game, this is like a copyright to say who made the config/part.
    mesh = model.mu  // outdated style of pointing to the 3d object. YEP
    scale = 1   // Do not have this as anything but 1. Some parts require this so that they don't scale wrong due to older methods.
    rescaleFactor = 0.2//1 // This is the one you change if you want to rescale your part equally in all directions and have your nodes auto

scale to match.
    TechRequired = flightControl  // Yes this is for the Tech tree but should be filled unless you have a mod that gives you your own system.

Write "Start" (no quotes) if you want it available from the beginning.
    entryCost = 4600 // The cost to unlock to the technology
    cost = 600 // the cost of the actual part
    category = Aero // This is for which section of the parts list it is in. Always put something unless you have a mod that gives you your own

system. Aero puts it in the wings and elevons section.
    subcategory = 0 // Old system that is not currently used. Left in incase it gets re-enstated.
    title = #autoLOC_500226 //#autoLOC_500226 = Delta-Deluxe Winglet //the title of the part in=game on the tab. YEP
    manufacturer = #autoLOC_501630 //#autoLOC_501630 = Kerlington Model Rockets and Paper Products Inc // Fictional company name. YEP
    description = #autoLOC_500227 //#autoLOC_500227 = The Delta-Deluxe Winglet is a large aerodynamic surface with a small built-in aileron. It

is very lightweight and offers more lift than the AV-R8 but the small control surface area means it is not as quick to turn. // duh. YEP

The #autoLOC_  is used with the "Locations" files to provide different languages for people using the game in non English speaking countries.

Locations files have the unique number and the translation as part of a long list. You need to create specific locations files with unique numbers

to match to what you put here. It is very involved and alot of work. If you don't have them then just put the wording in straight without the

#autoLOC_.

// attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision
    attachRules = 0,1,0,0,1  // Attach to a node, Attach to a surface, Allow other things to attach to its nodes (needed if you want it to be

spawned in before anything else), Same but for surface, Allow interaction with craft it is attached to (always a bit confused as to when this works

or not) The above example says it can only surface attach to something already spawned and it can interact with the craft to which it is attached.

It cannot be the first part.

    node_attach = 0.4780781, 0.1322544, 0.0, 1.0, 0.0, 0.0 //
Following is for when spawned in the SPH. IN VAB right is out the door forwards is up, down is north etc. All in relation to the world origin

location of the mesh.
    node_attach = Positive is right hand side Negative left, Positive is front (going out the open SPH door) Negative is rear, Positive is down

towards the floor (Weird but makes sense in 3D modeling) Negative is towards the ceiling

Should always have a 7th number that represent the node size e.g

node_stack_wing = x, y, z, x, y, z, node size

    // Centre Of ,Mass,Lift,Pressure (pressure is where the Aero drag grabs the craft. Handy for making Mk1 pods fall bottom down etc)
    // The X,Y,Z location in relation to the word centre of the mesh.
    CoMOffset = -0.08, -0.3, 0
    CoLOffset = -0.08, -0.3, 0
    CoPOffset = -0.08, -0.3, 0

    mass = 0.078 // 1.0 is 1 tonne, 0.1 is 100 kg etc
    thermalMassModifier = 8.0 // How quickly heat from atmosphere friction heats the part.
    // heatConductivity = 0.06 // half default  // Requied by parts like radiators.
    emissiveConstant = 0.95 // High emissive constant means fast shedding of heat, like engines, radiators etc.
    dragModelType = none // Only used for special cases.
    maximum_drag = 0.02 // For the side that has most surface to the atmosphere e.g top and bottom of wing.
    minimum_drag = 0.02 //e.g the edge of the wing.  
    angularDrag = 5    // Turning perpendicular to path of travel, affects how fast the atmosphere will catch and slow the part.
    crashTolerance = 12 // how strong the part is. or if it breaks when hitting stuff. YEP . It is in metres per second. So hit faster than 12

metres per second with this part and it goes boom.
    maxTemp = 2400  // the temperature threshhold of the part that will cause heat damage to make it go boom.
    explosionPotential = 0.1 // if it breaks or explodes? im guessing a precent value between 0 and 1. YEP
    bulkheadProfiles = srf // Required for scaling, srf is for surface attach size0 through I think size4 for the size of your nodes.
So you could have = srf, size1, size3  and the like depending on what your nodes are. Not having this can cause parts to not turn up. (also helps

Tweakscale) be sure to write as in example.
    //
    tags = #autoLOC_500228 //#autoLOC_500228 = aero aircraft canard control (elev fin (fore lift plane rocket )rudder stab swept tail
Is used so that when you type in the Parts finder search your parts will turn up when you type words that it contains.

    MODULE // lots of modules that do stuff (evey possiable value not shown, only things that are used)
    {
        name = ModuleControlSurface  // the name of the module you want to use
        useInternalDragModel = True  // relates to the drag cube used by the mesh, drag cube is calculated by the game when loading the mesh

unless you put your own in the config.
        dragCoeff = 0.6              // works with the deflectionLiftCoeff = to affect how much lift or air braking the surfce generates.
        deflectionLiftCoeff = 0.65   // changing this value gives more lift or air braking.
        ctrlSurfaceRange = 25        // The range the control surface is allowed to move. Too high and it will deform.
        ctrlSurfaceArea = 0.2        // Bigger number the more of the mesh is used to calculate its affect on the atmosphere. It is in

percentages. 1 is 100%
        actuatorSpeed = 25           // The rate at which the control surface is moved when you input. Too fast and you would have no fine

control.
    }
    MODULE   
    {
        name = ModuleCargoPart  // Allows it to go into an inventory slot on a craft.
        packedVolume = 800 // the inventory volume taken up by the part. This gets affected by the mass as well.
    }
}

I think you know the rest. I hope so cause I am late for bed.

Catch you later.

Edited by ColdJ
Link to comment
Share on other sites

Ok, here it is.  Took me around 6 months and Scott Manley guest-stars.

 

I actually learned a ton about ksp parts and textures, and I created high-quality versions of them for this trailer. The parts are subdivided and have small modifications, and the textures have been modified and have bump and roughness maps created from the original texture. If enough people ask for it, I'll make a behind the scenes on this, going through my workflow and the things I learned.

Link to comment
Share on other sites

 

looks real crisp Concodroid good work! 

when danger zone kicks in!  Totally worth the copyright strike imo ^.^ 

 I chickened out and used a midi :p

 

Wow, Outstanding ColdJ!

Thank you for taking the time to explain all that! That answers all of the questions I had. holy smokes bud!

9 hours ago, ColdJ said:

You will notice that I have the parameter  stackSymmetry = 1  at the bottom

Oh sweet, yeah I was lookin' at that. Nice.

So, for example: If you make an engine mount with 4 attach points and toggle on symmetry or mirror, this determines both IF you want it filled and the quantity of nodes needed?  I'll have to experiment.  So this is why some engines don't mirror on some engine mounts, even if you have the in-game symmetry tool selected to the appropriate setting eh? 

It's a shame we can't tell ksp to rebuild the mod list with a command line in-game or somthin'. The reason I ask is to save iteration time for testing changes. Bummers it doesn't work that way ^.^  Currently I just drag of the mods in the GameData folder to backup.  that speeds up load times for this. I've been spoiled on unity with the ability to edit code while the game runs haha.

 

9 hours ago, ColdJ said:

I have found that sometimes with 3 or more attaching you may need to change which node has 1, 2, or 3 etc at the end in order to have the node you would most likely attach to first,

I feel like I will need to experiment with this to understand this part. Will have to come back when I do.

Isn't thunderbird 3 the one that looks like the TinTin Rocket? the red rocket shaped one? couldn't get them to work? maybe related to the building editor? like did you try to build it in the hanger or vab? just thinkin' Just random thinking don't mind me >.<

 

This is outstanding! So good it can't be hidden in a nested code window! Paste this thing on the front page! Excellent! 

Lots of good stuff packed in here.

9 hours ago, ColdJ said:

PART
{
    name = winglet3 // The unique part identifier. Each one loaded must be unique in the game. Good practice is to add your sig initials to be

sure.
    module = Part   // This should always be in a part config. Other things in the game also use configs, like resources, They have their own

identifiers.
    author = NovaSilisko // This is not used in game, this is like a copyright to say who made the config/part.
    mesh = model.mu  // outdated style of pointing to the 3d object. YEP
    scale = 1   // Do not have this as anything but 1. Some parts require this so that they don't scale wrong due to older methods.
    rescaleFactor = 0.2//1 // This is the one you change if you want to rescale your part equally in all directions and have your nodes auto

scale to match.
    TechRequired = flightControl  // Yes this is for the Tech tree but should be filled unless you have a mod that gives you your own system.

Write "Start" (no quotes) if you want it available from the beginning.
    entryCost = 4600 // The cost to unlock to the technology
    cost = 600 // the cost of the actual part
    category = Aero // This is for which section of the parts list it is in. Always put something unless you have a mod that gives you your own

system. Aero puts it in the wings and elevons section.
    subcategory = 0 // Old system that is not currently used. Left in incase it gets re-enstated.
    title = #autoLOC_500226 //#autoLOC_500226 = Delta-Deluxe Winglet //the title of the part in=game on the tab. YEP
    manufacturer = #autoLOC_501630 //#autoLOC_501630 = Kerlington Model Rockets and Paper Products Inc // Fictional company name. YEP
    description = #autoLOC_500227 //#autoLOC_500227 = The Delta-Deluxe Winglet is a large aerodynamic surface with a small built-in aileron. It

is very lightweight and offers more lift than the AV-R8 but the small control surface area means it is not as quick to turn. // duh. YEP

The #autoLOC_  is used with the "Locations" files to provide different languages for people using the game in non English speaking countries.

Locations files have the unique number and the translation as part of a long list. You need to create specific locations files with unique numbers

to match to what you put here. It is very involved and alot of work. If you don't have them then just put the wording in straight without the

#autoLOC_.

// attachment rules: stack, srfAttach, allowStack, allowSrfAttach, allowCollision
    attachRules = 0,1,0,0,1  // Attach to a node, Attach to a surface, Allow other things to attach to its nodes (needed if you want it to be

spawned in before anything else), Same but for surface, Allow interaction with craft it is attached to (always a bit confused as to when this works

or not) The above example says it can only surface attach to something already spawned and it can interact with the craft to which it is attached.

It cannot be the first part.

    node_attach = 0.4780781, 0.1322544, 0.0, 1.0, 0.0, 0.0 //
Following is for when spawned in the SPH. IN VAB right is out the door forwards is up, down is north etc. All in relation to the world origin

location of the mesh.
    node_attach = Positive is right hand side Negative left, Positive is front (going out the open SPH door) Negative is rear, Positive is down

towards the floor (Weird but makes sense in 3D modeling) Negative is towards the ceiling

Should always have a 7th number that represent the node size e.g

node_stack_wing = x, y, z, x, y, z, node size

    // Centre Of ,Mass,Lift,Pressure (pressure is where the Aero drag grabs the craft. Handy for making Mk1 pods fall bottom down etc)
    // The X,Y,Z location in relation to the word centre of the mesh.
    CoMOffset = -0.08, -0.3, 0
    CoLOffset = -0.08, -0.3, 0
    CoPOffset = -0.08, -0.3, 0

    mass = 0.078 // 1.0 is 1 tonne, 0.1 is 100 kg etc
    thermalMassModifier = 8.0 // How quickly heat from atmosphere friction heats the part.
    // heatConductivity = 0.06 // half default  // Requied by parts like radiators.
    emissiveConstant = 0.95 // High emissive constant means fast shedding of heat, like engines, radiators etc.
    dragModelType = none // Only used for special cases.
    maximum_drag = 0.02 // For the side that has most surface to the atmosphere e.g top and bottom of wing.
    minimum_drag = 0.02 //e.g the edge of the wing.  
    angularDrag = 5    // Turning perpendicular to path of travel, affects how fast the atmosphere will catch and slow the part.
    crashTolerance = 12 // how strong the part is. or if it breaks when hitting stuff. YEP . It is in metres per second. So hit faster than 12

metres per second with this part and it goes boom.
    maxTemp = 2400  // the temperature threshhold of the part that will cause heat damage to make it go boom.
    explosionPotential = 0.1 // if it breaks or explodes? im guessing a precent value between 0 and 1. YEP
    bulkheadProfiles = srf // Required for scaling, srf is for surface attach size0 through I think size4 for the size of your nodes.
So you could have = srf, size1, size3  and the like depending on what your nodes are. Not having this can cause parts to not turn up. (also helps

Tweakscale) be sure to write as in example.
    //
    tags = #autoLOC_500228 //#autoLOC_500228 = aero aircraft canard control (elev fin (fore lift plane rocket )rudder stab swept tail
Is used so that when you type in the Parts finder search your parts will turn up when you type words that it contains.

    MODULE // lots of modules that do stuff (evey possiable value not shown, only things that are used)
    {
        name = ModuleControlSurface  // the name of the module you want to use
        useInternalDragModel = True  // relates to the drag cube used by the mesh, drag cube is calculated by the game when loading the mesh

unless you put your own in the config.
        dragCoeff = 0.6              // works with the deflectionLiftCoeff = to affect how much lift or air braking the surfce generates.
        deflectionLiftCoeff = 0.65   // changing this value gives more lift or air braking.
        ctrlSurfaceRange = 25        // The range the control surface is allowed to move. Too high and it will deform.
        ctrlSurfaceArea = 0.2        // Bigger number the more of the mesh is used to calculate its affect on the atmosphere. It is in

percentages. 1 is 100%
        actuatorSpeed = 25           // The rate at which the control surface is moved when you input. Too fast and you would have no fine

control.
    }
    MODULE   
    {
        name = ModuleCargoPart  // Allows it to go into an inventory slot on a craft.
        packedVolume = 800 // the inventory volume taken up by the part. This gets affected by the mass as well.
    }
}

 

 

wow

 

Link to comment
Share on other sites

11 hours ago, REDACT3D said:

So this is why some engines don't mirror on some engine mounts, even if you have the in-game symmetry tool selected to the appropriate setting eh? 

Yes.

11 hours ago, REDACT3D said:

It's a shame we can't tell ksp to rebuild the mod list with a command line in-game or somthin'. The reason I ask is to save iteration time for testing changes.

What I do is build several configs for the same part I am experimenting with so that I can try several iterations at once. Simply Click "Save As" in Notepad or whatever you use, give it a slightly different name or add a number, then add a number to whatever you called it in "name =" and also add a number to the title that you see in game. Make basic changes in each iteration and then load the game to test. They all use the same .mu and textures, so you are only adding kilobytes to the load into memory. You could try hundreds of configs for a part if you wanted. Then just keep the one that suits your purpose.

11 hours ago, REDACT3D said:

Isn't thunderbird 3 the one that looks like the TinTin Rocket? the red rocket shaped one? couldn't get them to work? maybe related to the building editor? like did you try to build it in the hanger or vab? just thinkin' Just random thinking don't mind me >.<

This is my Thunderbirds mod if you want to try it.

https://spacedock.info/mod/3088/Thunderbirds InterKerbin Rescue

This is Thunderbird 3

eljRlCM.png

11 hours ago, REDACT3D said:

This is outstanding!

Thank you.

This my Blackbird, haven't built its internal yet.

ReagC7D.png

Main body is a lifting surface but moved the centre of lift between the nacelles in the config. Moved the centre of drag to the back so that it Lawn Darts rather than spin out of control. Apart from the 4 rear flaps it has an insert inside the nose that adds another point of lift to spread it along the body and a centered canard in the nose to provide better pitch control.

Edited by ColdJ
Link to comment
Share on other sites

 

Sorry for the late response.  Got distracted playing with thunderbirds for a while.  had to put a pin in the base going in the mountains so I could get back to work on my K2 project haha.  the detail is awesome haha.  memory lane. 

Not that I am complaining. but for me some of the meshes used in the thunderbird pack do not have auto-smoothed surfaces. If you are aware of this or not.  could be fixable in blender. maybe it sucks re-releasing a mod. 

haha thunderbirds go!

 

The Sr71 is looking great man. If you want my expectation of what the inside view from the cabin should look like > gotta beable to see the curvature of the earth with blackness of space. but small windows and clamped head rotation due to helmets lol 

Been thinking about interiors. Anything you wish you'd have known before doing them?

 

 

https://imgur.com/a/N0nP3zM

Ended up debugging sound like this video above.

Here's the animation and sound script for the instance that shows up in the video linked above.

because I have my animation starting "open" at frame 0 and "closed" at frame 100, I want to make sure that the sounds are playing at the appropriate time.

 

The Volume 0 0  was throwing me off at first. 

How it's like:

Volme number number

Volme number number

had to debug that

PART {
    name = CockpitK2
    module = Part
    author = REDACTED

    rescaleFactor = 1.0
    CrewCapacity = 0
    TechRequired = precisionEngineering
    entryCost = 4900
    cost = 650
    category = Pods
    subcategory = 0
    title = CockpitK2
    manufacturer = REDACTED
    description = Could become self-aware.
    attachRules = 1,1,1,1,1
    mass = 0.2
    dragModelType = default
    maximum_drag = 0.2
    minimum_drag = 0.15
    angularDrag = 1.5
    crashTolerance = 12
    maxTemp = 1200
    explosionPotential = 0
    vesselType = Probe
    bulkheadProfiles = size0
    crossfeed = true
    tags = #autoLOC_500342
    
    MODEL {
    
        model = REDACTED/Parts/Command/CockpitK2/CockpitK2
    }

    MODULE {
        name = ModuleCommand
        minimumCrew = 0
        hasHibernation = True
        defaultControlPointDisplayName = #autoLOC_6011003
        RESOURCE {
            name = ElectricCharge
            rate = 0.025
        }

        CONTROLPOINT {
            name = forward
            displayName = #autoLOC_6011001
            orientation = 90,0,0
        }

        CONTROLPOINT {
            name = reverse
            displayName = #autoLOC_6011004
            orientation = 0,0,180
        }

    }

    RESOURCE {
        name = ElectricCharge
        amount = 1000
        maxAmount = 1000
    }

    MODULE {
        name = ModuleReactionWheel
        PitchTorque = 300
        YawTorque = 300
        RollTorque = 300
        RESOURCE {
            name = ElectricCharge
            rate = 0.05
        }

    }

    MODULE {
        name = ModuleSAS
        SASServiceLevel = 7
    }


    
    MODULE {
    
        name = ModuleAnimateGenericEffects
        animationName = NlaTrack
        startEventGUIName = Close Top Hatch
        endEventGUIName = Open Top Hatch
        actionGUIName = ToggleBayDoors
        //defaultActionGroup = Gear
        layer = 2
        
        deployEffectName = deploy           // is the effect(s) which should be played when deploying
        
        postDeployEffectName = deployed     //is the effect(s) which should be played when deployment is completed
        postDeployEffectLength = 1        //is how long the post-deployment effect should be played
        
        retractEffectName = retract         //which should be played when retracting
        postRetractEffectName = retracted   //is the effect(s) which should be played when retractment is completed
        postRetractEffectLength = 1       //is how long the post-retractment effect should be played
        animSpeed = 1

    
    }

       EFFECTS
    {
        deploy
        {
            AUDIO
            {
                channel = Ship
                clip = REDACTED/Sound/1
                volume = 0 0
                volume = 2 1
                pitch = 1
            }
            AUDIO_LOOP
            {
                channel = Ship
                clip = REDACTED/Sound/2
                volume = 0 0
                volume = 2 1
                pitch = 1
            }
        }
        deployed
        {
            AUDIO
            {
                channel = Ship
                clip = REDACTED/Sound/3
                volume = 0 0
                volume = 2 1
                pitch = 1
            }
        }
        retract
        {
            AUDIO
            {
                channel = Ship
                clip = REDACTED/Sound/4
                volume = 0 0
                volume = 2 1
                pitch = 1
            }
            AUDIO_LOOP
            {
                channel = Ship
                clip = REDACTED/Sound/5
                volume = 0 0
                volume = 2 1
                pitch = 1
            }
        }
        retracted
        {
            AUDIO
            {
                channel = Ship
                clip = REDACTED/Sound/6
                volume = 0 0
                volume = 2 1
                pitch = 1
            }
        }
    }





} // end

Note that this script is missing command modules usually used. this is for testing of the animation sound only.

 

This is how she's lookin' so far.  Only two wings, a cabin and control surfaces.

The Cabin has a top payload door located where the fuel  transfer port normally would be. with an attach node inside to allow mounting. Like the Square piston. or a camera etc.   Plan to make a Clip-in style fuel port for folks who want to try and git good. lol

VVkiOV4.png

 

yyf65HB.png

 

 

Here you can see how i left room for a lower payload area to be attached at the bottom.  this way i can have the lower profile and have that clearance to put lots of stuff in the main payload area. before moving onto the engines and landing gear.

I imagine the gear will be complex due to the spring component. dono yet.

v2GjcRL.png

Link to comment
Share on other sites

Looks good. You definitely are very talented at modeling.

Would make your life easier if you loaded your body and 2 instances of the wing in blender and lined the wings up exactly where you want them when put together in the SPH, by dragging them at the top of the heirachy into place. Then write in to your body config 2 nodes that are where the wings co-ordinates are. A left and a right facing. Add a stack node to the wing config at 0,0,0 and then you can snap to position, quick and easy in the SPH.

Just remember the Y and Z co-ordinates are swapped in blender compared to the config.

Highest level of SAS is 3, so having 7 in your config shouldn't do anything.

You have only got your mass at 200 kg so having 300 pitch etc is massive overkill. If your control surfaces work right then try 10, you will probably still bring it down further so your craft handles as you would expect in atmosphere.

You shouldn't leave your animation name as the default NLAtrack. You can change the name of the animation in the animation work space. Click on the white rectangles to bring up the NLA editor, expand your animation and double click the name. Then type in your own.

Your gear will be animated if they are to retract. Have a look at the stock or a mod that is built for 1.12.# to see how the heirachy goes. Or when I get around to releasing the Blackbird, study them in blender and the config, because they came out really good. :) The front one folds front to back and the rear, side to centre.

 

Be sure not to forget the "Collision Enhancer" as your wheels will bounce like crazy on world spawn without it, also make sure each part is on its correct layer.

Looking really good so far.

 

 

Link to comment
Share on other sites

Thanks bud :)

15 hours ago, ColdJ said:

Highest level of SAS is 3, so having 7 in your config shouldn't do anything.

Good eye as usual man! Here, I was testing what the highest level is. looking to see if it was clamped.  Spoilers, it is.  good to know that the game does not crash if this value is exceeded! (or at least not right away lol)

Since I'm building from a reference in blender the idea is to get all the parts for this ship to the same relative scale in relation to the reference. Knowingly walking into that unit scale conversion issue.  Once the model is completed at the reference scale, I will then rescale the objects to the scale I'm lookin' for with all of the attach points in the right places. Using blender to set the hard-scale to 1.

I don't see scale as an issue. just an extra step to mess around with. Except how it requires an extra Empty gameObject so the local position is not affected by scale changes.

15 hours ago, ColdJ said:

You shouldn't leave your animation name as the default NLAtrack.

This, I was doin' so I could leave the script identical each time it is copy pasted with less chance of typo error.  As I usually only make a single animation track for a payload door.  I assume the animations are played locally in relation to the part root gameObject. or in other words, is contained in that game object.  Or any animation track on any part would also play while this plays. But it seems to be contained in the module?  

Super easy to name them. also describes what the animation is for better when looking at the code, so this helps thanks man!

 

15 hours ago, ColdJ said:

300 pitch etc is massive overkil

Buhahahaha!  just for testing the inputs hehe.  To make certain that the reaction wheels are applying the correct rotational force to the wing in an overpowered manner.  At this point all the control surfaces work correctly and can be mapped to Depoy as breaks and such. Roll on the outer fins ( 1 and 2) was tricky. as the pitch and yaw was correct but roll was inverted. but all good now.

Just want to get all the parts exsisting in the game before I tweak all of the game related values that make it a challange. Right now, it'll fly like it's being programmed to fly perfectly.  Starting at perfect and nerfing down to realistic. This way I can get a visual going in my head about the numbers in relation to the actual forces. if that makes sense.

This is why you will see outrageous numbers in some of my test stuff. The ones that are intentional anyways.  lol

 

 

Here you can see the scripting environment I used built into blender if you're interested. 

engine next as you can see on the top left.

going for surface attach to the wing

when I export the model, the script is also exported (and stuff automatically gets added/changed/assigned/

It's just as easy to edit a single value in script and re-export, as it is to do on say notepad, but this allows me to change things like the textures and other mesh stuff too with the same turn-around time.

 

I believe what I could do is have several Scripting tabs open, each named for the appropriate part, and it'll export them all at once.  based on your exporting multiple idea. beauty!

gBpTPnv.png

This is the link to the github for the blender addon

GitHub - taniwha/io_object_mu: Python .mu reader/writer and blender import/export addon

And this is the video I found that started this all.. explains how to setup the addon and use it lol

 

Oh! also - 

Notice how "6" never plays in this video as it is coded

https://i.imgur.com/HCSS6dH.mp4

 

 

2U4GdvT.png

 

The texture turned out okay too.

next on to the code and stuff

8eIH1rx.png

 

 

Edited by REDACT3D
Link to comment
Share on other sites

Hi @REDACT3D

Looks good.

As you have obviously come from designing in other games before KSP, you take a more complicated approach than I do. You are way more advanced in a number of things.

I started with looking at config files to see how they worked and experimented to see what changes did. So all my early work was reconfiging meshes created by other people. All the info in this thread was unknown to me at that time, as was any solid understanding of the config files. Most things I had to puzzle out slowly over time. The keys and tangents used by Unity for many things from thrust to sound effects, had me confused for a long time.

Answers were hard to come by and most ended up being answered by me through experimenting.

I did get nudges in the right direction from time to time, and it was @Stone Blue mostly. They also suggested I try 3D modeling and pointed me to the BforArtist fork of Blender and to @taniwhas plugin. Taniwha had been away for a while, busy with other projects, when I first started, and blender tutorials didn't mesh well with what I was seeing in BforArtists. I didn't know basic things or that there was a problem that ment you had to detach the vertex colour for your texture to show in material view for most things. So it took me ages and alot of experimenting to get where I am now. I still learn new things all the time that make it easier.

I didn't want others to have as hard a time as I had so I started this thread.

I don't script or code myself, I rely on the plugin to cover things. And the improvements made in the last (maybe 6, not sure) months by Taniwha to the plugin have been excellent. I have tried the template mode from within blender a couple of times, but I much prefer to build config files in Notepad. It allows me to go into previous works and grab the modules I need quickly to build new configs.

The links and video you put above are actually included further back in the thread.

I noticed in your video that you were getting the same shadow stutter of the ground that I suffered for ages. Someone in the last month gave me the answer of what to change in the config file. I will look for it and post the changes you need to correct it.

@REDACT3D

In the main KerbalSpaceProgram folder is settings.cfg   Open and search for "shadows" then scroll slightly down till you see

SHADOWS_FLIGHT_PROJECTION = 0
SHADOWS_KSC_PROJECTION = 0
SHADOWS_TRACKING_PROJECTION = 0

Change these 3 to

SHADOWS_FLIGHT_PROJECTION = 1
SHADOWS_KSC_PROJECTION = 1
SHADOWS_TRACKING_PROJECTION = 1

The shadow flicker glitch should be gone on next load.

Link to comment
Share on other sites

@REDACT3D

Sorry, forgot to mention from previous. The sound like alot of things is a unity key thing so.

AUDIO_LOOP

{

channel = Ship

clip = REDACTED/Sound/5

volume = 0 0 (key for minimum, is set for 0 so nothing is heard)

volume = 2 1 (Key for maximum. 2 is wrong because maximum volume is 1. So if it was 1 1 then it is maximum volume is set to play the sound file at its full volume)

pitch = 1 ( This one can go past 1 or below. 1 is the pitch of the original.  0.5 is half the pitch of the original, 1.5 would half again higher in pitch.)

}

So it is a minimum then maximum

With the Thunderbirds there were some surfaces that I would have had to rebuild in order to have smoothing look right. I didn't feel like rebuilding and so didn't smooth them.

Link to comment
Share on other sites

Nice! A fix for the glitchy rendering! woot! It's like I'm suddenly playing ksp2! I wonder why this is not just a patch?

Fantastic!   And when I record video, it won't look like potato power too.  It actually improves the contact shadows also!

What the heck man, why didn't I do this before LOL

 

Hearing about how you started off, ALMOST makes me think I'm missing out on that part of the quest. But then I think back to all those darn phone-book size code books, and I'm like nah' this is way better. Not only because we each learn "faster" but more that we can share what we've learned with others.  To advance the overall knowledge base.

I like to say: "teamwork makes the dream-work". puts a smile on folk's face and, it's true.  

I would gladly share any information about blender or unity if you ever need, just let me know. Maybe if you need any models made I could help with that. you know, no obligations or anything. Just let me know.

 

I HATED blender until they updated the UI to non-alien interface hahahow you can bake textures and normals is crazy.  if only blender and unity was built into the same app lol what the heck Z up!

I reccomend Unity's "new" Visual Scripting for guys who want to get into doing logic and stuff. you can do anything you can do with regular code, but with graphical nodes. it's actually quite the rabbit hole. It's not for everyone. but it's an interesting way to do things at the least.  But it kind of works how the shader graph works. so it's like a language worth learning.

I was always tryin' to program stuff but needed graphics for it. So I forced myself to learn blender. Took roughly a year before I could sit down and build anything and know what every button did.  Now I can cruze around it like a video game and just do what I think to do.   It's all about the selection tools, mirroring and otherwise controlling the lines and dots to move how you want. 

Once you do it enough, it just becomes automatic, and you reach for the right tool at the right time.  Not everyone has a year or two  to fart around however lol.

you've definitely made a positive impact on my progression and understanding.  Thank you for putting the effort in to communicate in detail. A rare thing to find. 

keep payin' it forward 

Link to comment
Share on other sites

Ihah5cw.png

 

Smallest engine in the game. ^.^

decided to bake normals for the foil and put it on a gimbal lol

Say, do you have any insight on building particles like smoke or engine effects?

 

I assume it's a prefab made in unity?

Does it use the standard particle system and runs on awake? (object pooling? )

Link to comment
Share on other sites

45 minutes ago, REDACT3D said:

Say, do you have any insight on building particles like smoke or engine effects?

I was hoping you did. :)

From the little I have read it has to be done with Part Tools. Something about creating an empty and assigning material properties to it. These are then linked to a texture you create. As far as I know it can't be done with the .mu plugin.

I know that @Angel-125 has created his own effects like bubbles for underwater engines. If you read this Angel-125 then any insight into how to do it would be very appreciated.

Link to comment
Share on other sites

Okay let me get back to you on that one. 

but

I suspect that KSP uses unity's built-in particle system that is extremely well documented, and I use it all the time for a wide variety of effects. From smoke and trails to particles that trigger events and collide with the word.  It's a possibility that it uses the FX system that is more shader based. but since KSP appears to be built using the Universal Render Pipeline this points to the older particle system.

Each style of render pipeline has it's own custom shaders basically. because the scene is being renderd using a different style of rendering.  Forward rendering seen in HDRP and deferred rending in the Universal Render Pipeline.  There's also the Standard Definition Pipeline that is more or less devoted to mobile and you can create your own render pipeline.

See lots of people always complaining about the STYLE of render pipeline. Because things are not the same for every render pipeline as you can imagine. It's like a setup file config.  You'll have a guy showing how to "make a thing" but it only works in that one pipeline. 

I bet KSP at first probably had the URP as standard and added stuff on. But all speculation.

The only difference between HDRP and URP in relation to particles from a user standpoint is how you need to select a new shader type from the drop-down that is compatible with your change.   And the alternate code you need to type to reference that version of the thing. Doing this "unlocks" or makes new or alternative options available in the inspector.   For example, you don't have the option to disable 'cast shadows' with an HDRP material (even debug doesn't  work) you need to use Layers to define what shadows interact instead. A different thing. (because hdrp shadows cost more performance so gotta use a new way ) 

(I think?) all versions in Unity have a basic diffuse shader. That is, will display gradient color and handle the surface smoothing and all that but no fancy stuff like emission, transparency, metallic and what not.  Normals are mostly standard. Bump maps are old-school.  

 

The reason all this matters for particles is not only because they need to actually render and need a shader, but because of how they are rendered.  like say if you check the ☑ Enable GPU Instancing. This not only does stuff in the background to help you spam those particles with no lag, but also reveals new options in the inspector as well.   I think doing this inside unity would help?

 

Blender has this issue how Black and White are swapped values and the scale of the values when you try to directly import over. The black and while ( 1 - 0 ) values are used to determine float values. like smoothness and so forth. So if those are flipped.. it's going to look funky at minimum lol.  I imagine the ksp adon does this conversion.  (and maybe why vertex color is black at first?)

Particles are just a component you add to a gameobject, with slide bars and numbers to change while you observe the changes until you get what you want. it's really cool.  Gets more complicated to add sound to particles. this requires adding an AudioSource component to reference. 

You can set the particles to begin playing (or looping or bursting whatever you make) immediately when the game object that had it applied to it is spawned or otherwise "wakes up" or you can just directly tell it to play.   The issue then becomes do you want the particles to be interrupted?   And what interrupts it? Does it get destroyed?  You don't want the smoke to stay while the fire go. lol

For stuff like candle flames, you can use a shader on a mesh to displace it like grass blowing in the wind, so there's a point at when you switch from particle to static mesh. depending on the speed of the effect. dont' need to spam particles for a slow moving flame.

 

I hope that it works with the particle system in unity. lol

 

Take this standard weapon layout. the formatting of the hierarchy. how it's contained within the character controller.  I need a point to play smoke from the pew pew.  But it has  to match the players animated weapon  right? So you add an empty game object to locate the origin point and rotation relative to the gun in local space. 

And when the animation plays for the shot, the playhead will travel across Event Triggers that are embedded in the animation.  Or you can animate the game object disable and active. and set the particles to play on awake like the sounds. 

3X9B4BU.png

the standard particle component 

oVUQnmP.png

 

Link to comment
Share on other sites

6 hours ago, zer0Kerbal said:

Query: what version of Blender does @taniwha's Blender I/O tool work on?

The latest 3.x? Moving machines, hoping I no longer need more than one version installed.

Anything starting with 3 onwards should work with the latest plugin.

Link to comment
Share on other sites

7 hours ago, REDACT3D said:

I suspect that KSP uses unity's built-in particle system that is extremely well documented

Everything after that sentence is outside of my experience I am afraid. I have never used the Unity with Part tools set up myself. Hopefully someone who has worked in that area may respond. You may need to start your own thread with that info and a question to try to find someone who knows.

Link to comment
Share on other sites

  • 2 months later...
On 2/23/2022 at 10:15 PM, ColdJ said:

Found this extremely useful tutorial on how texture in blender for KSP. Also has other useful info like being able to create nodes and a config file from within the 3d editor.

 

@KerboNerd @Stone Blue@linuxgurugamer@Concodroid@Randazzo@AtomicTech

Kinda skips exporting sadly...  Also had to hit playback 0.25 in a few places - sadly symptomatic of most Blender Tutes...

Link to comment
Share on other sites

On 2/7/2023 at 8:55 PM, tg626 said:

Making lights requires you have the renderer set to Eevee. It affects what parameters are present on light objects and on Cycles the exported MU won't cast light.

It is usually set for Eevee by default. So you have to actively change out for it not to work. Somewhere in here should be a link to some small tutorials that are hosted on Taniwhas github page. That explain what to do if you want to animate in cycles and then save as Eevee.

Haven't done any work in blender in over 3 months so will have to use my thread to re-teach myself when I get back in to it.

Link to comment
Share on other sites

On 11/26/2022 at 10:55 PM, zer0Kerbal said:

Query: what version of Blender does @taniwha's Blender I/O tool work on?

The latest 3.x? Moving machines, hoping I no longer need more than one version installed.

I've been using it along, since 2.79..
It works in v3.4.1 of BFA (based on Blender 3.5 Alpha)... current version of Blender, too ;)

Link to comment
Share on other sites

So if I'm on Blender 2.83 it should work still?  I installed all this morning and started messing around again after 4 years.

When I import an engine mu and export it straight back (no changes to anything), it seems like it rotates the thrust transforms 90 degrees.  Did I understand incorrectly that it would do the Y-up/Z-up translation automagically?

Basically I'm trying to revise a mu so that the thrust transformed is aligned properly for the intended use.  I think my workflow will be:

  1. Import .mu
  2. adjust errant thrustTransform object rotation so that it points where I want*
  3. select the root empty
  4. Export .mu file 

Which axis should be pointing in the direction of thrust? Y or Z?

I think I can make the adjustments to the transform in eulers and then switch it back to quaternions?

Is there anything else I need to do?



 

Link to comment
Share on other sites

On 2/14/2023 at 12:58 AM, Kurld said:

When I import an engine mu and export it straight back (no changes to anything), it seems like it rotates the thrust transforms 90 degrees. 

When using the thrust transforms from the original Squad parts, they seem to rotate 90 degrees on export for some reason. The ones I use these days are self created empties, named so I remember what to put in the config file. They don't rotate themselves on export. Not sure why the old ones do.

So if trying to adjust ones that already exist you need to work out which way they rotated and then import the mu file, rotate 90 degrees in the opposite direction for the original import or 180 degrees for the one you exported and then export. When the export rotates it, it will now be pointing in the right direction.

If you highlight the empty that is the thrust transform then go and click on "Object Properties". You can then change the "Display As" selection from Plain Axis to Arrows. The Positive Y axis is the direction the thrust will push. As in, the positive Y is the direction you want pointing out the back of the engine.

Also just do all rotations in quarternions. The rotation tools work in degrees, so it is easy to see how you have adjusted, but all changes will be recorded in the quarternions that the game uses.

Edited by ColdJ
Link to comment
Share on other sites

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