Beale

Beginners Part Modding Tutorial

Recommended Posts

This maybe a stupid question, but all the google searches do not seem to have an answer for this. Is it normal for the collider to disappear from the model when you tick the Convex box?

Share this post


Link to post
Share on other sites
4 minutes ago, ComatoseJedi said:

This maybe a stupid question, but all the google searches do not seem to have an answer for this. Is it normal for the collider to disappear from the model when you tick the Convex box?

This can happen if your collider is too complex for a convex collider, typically if you're using a mesh collider on a very complicated model.

Unity will throw an error in it's log if this happens, saying something to the effect of the collider has too many sides and is invalid.

 

Share this post


Link to post
Share on other sites

Yep, that's what it says. Has more than 255 polygons. I don't see why that would be an issue, though? When I first started dabbling in modding, I could use a mesh collider on more complicated parts than I have now and it showed up. What's changed? Also what's so "difficult" in combining a cone and cylinder to make it "complex"? Is this where I need to make my 15 sided colliders in blender and import them into unity?

So, now I have to learn how to make things transparent in both programs. Which I've tried -for hours- last week to do so and I thought I set up the layers to do so. Apparently, I need to find more information on this aspect if I want to continue to make "complex parts". :confused: 

Share this post


Link to post
Share on other sites
9 minutes ago, ComatoseJedi said:

Yep, that's what it says. Has more than 255 polygons. I don't see why that would be an issue, though? When I first started dabbling in modding, I could use a mesh collider on more complicated parts than I have now and it showed up. What's changed? Also what's so "difficult" in combining a cone and cylinder to make it "complex"? Is this where I need to make my 15 sided colliders in blender and import them into unity?

So, now I have to learn how to make things transparent in both programs. Which I've tried -for hours- last week to do so and I thought I set up the layers to do so. Apparently, I need to find more information on this aspect if I want to continue to make "complex parts". :confused: 

You just need to use a simple object that's roughly the shape of your part as the collider, or even better, one of Unity's simple collider objects. Most of my engines have 6 sided colliders.

You can create this simple object in blender (or whatever program you use), and once in unity apply mesh collider physics object to it, then delete the mesh renderer object. The visible portion is now gone, but the physics collider remains. You can also have more than one of these simple colliders on your part; I have parented a nozzle-shaped collider to the gimbal part in several engines so it moves with the nozzle, and then a static collider for the engine base.

Edited by Randazzo

Share this post


Link to post
Share on other sites

 

Yep, the colliders really need to be less than 255 faces, and hopefully a lot less. KSP's stock fuel tanks for instance use 12-sided cylinders for the collision meshes. I usually stick to that when making things, except when I went up to 7.5m diameter and then I did a few 24-sided cylinders. The colliders should only approximate the shape, such that the corners and edges collide when they need to.

 

The good news is that you can have multiple colliders, so if they're individually simple, you can just add a few more to get the shape mostly right.

 

Share this post


Link to post
Share on other sites
On 3/7/2016 at 2:08 PM, NecroBones said:

 

Yep, the colliders really need to be less than 255 faces, and hopefully a lot less. KSP's stock fuel tanks for instance use 12-sided cylinders for the collision meshes. I usually stick to that when making things, except when I went up to 7.5m diameter and then I did a few 24-sided cylinders. The colliders should only approximate the shape, such that the corners and edges collide when they need to.

 

The good news is that you can have multiple colliders, so if they're individually simple, you can just add a few more to get the shape mostly right.

 

16-sided collider I would argue is better - because then you get diagonal flat surface attach places, as well as NESW cardinal places.

8a1f56bbdf.jpg

Edited by Beale

Share this post


Link to post
Share on other sites
53 minutes ago, Beale said:

16-sided collider I would argue is better - because then you get diagonal flat surface attach places, as well as NESW cardinal places.

8a1f56bbdf.jpg

 

Actually 24 would be ideal, since there are 24 snap angles. But 12 is what the stock parts (currently) use. It's really up to you when you make your parts, though.

 

Share this post


Link to post
Share on other sites
On 3/28/2016 at 0:21 PM, Beale said:

16-sided collider I would argue is better - because then you get diagonal flat surface attach places, as well as NESW cardinal places.

I disagree, 12 sided colliders allow for even placement of both 3x and 6x symmetry.  8x results in some attachments on corners, but still remains symmetrical.  16 sides removes the possibility of attaching 3 or 6 parts symmetrically, since some will be placed at sub-normal angles to the faces.

I had never really thought about multiple colliders though, so that brings up some questions; is it possible to have different attach rules for different colliders? Could I say, model an engine with a collider for the base and another collider for the nozzle that moves with the gimbal, and allow surface attach for the base but not the nozzle?

Also, are multiple colliders what people use for cargo bays? I never figured out how a convex collider could also be hollow.  

Share this post


Link to post
Share on other sites
51 minutes ago, Starbuckminsterfullerton said:

I had never really thought about multiple colliders though, so that brings up some questions; is it possible to have different attach rules for different colliders? Could I say, model an engine with a collider for the base and another collider for the nozzle that moves with the gimbal, and allow surface attach for the base but not the nozzle?

Also, are multiple colliders what people use for cargo bays? I never figured out how a convex collider could also be hollow.  

 

The answers are "yes" and "yes" :)

If you want colliders to disallow attachment, you can set a label on them as "NoAttach" and nothing can surface attach on that collider.

For hollow spaces, you need several smaller convex colliders around the perimeter. Usually 8 or 12 boxes, or something along those lines. 12 is a nice number to work with since it matches the exterior number of faces that stock parts use for cylinders anyway. The good news is that while more colliders will reduce performance, the performance loss is minor compared to having multiple parts. Specifically, multiple colliders on the same rigid-body is cheaper in CPU usage than having the same colliders spread out over more than one part.

 

Share this post


Link to post
Share on other sites
15 hours ago, NecroBones said:

If you want colliders to disallow attachment, you can set a label on them as "NoAttach" and nothing can surface attach on that collider.

... BRB adding colliders to the bells of all the BDB engines that allow surface attach...

Share this post


Link to post
Share on other sites
21 hours ago, NecroBones said:

If you want colliders to disallow attachment, you can set a label on them as "NoAttach" and nothing can surface attach on that collider.

Oh, cool! Pardon my ignorance, but how do I add that label, is it a Unity thing? The only attach setting I know of is the cfg file attachRules setting. 

6 hours ago, CobaltWolf said:

... BRB adding colliders to the bells of all the BDB engines that allow surface attach...

My thoughts exactly, I'm glad you're on board because I love your engines and it's always bugged me how you can land on an engine bell in ksp, wiggle the gimbal around, and not fall over.:D

Share this post


Link to post
Share on other sites
Just now, Starbuckminsterfullerton said:

Oh, cool! Pardon my ignorance, but how do I add that label, is it a Unity thing? The only attach setting I know of is the cfg file attachRules setting. 

Yep, add it as a "tag" in Unity.

Share this post


Link to post
Share on other sites

How could I make the nozzle itself move with thurstTransform when the engine gimbals? I know I have to make the nozzle as a separate mesh, but should that mesh get a collider? What is the setup for these kinds of parts?

Share this post


Link to post
Share on other sites
5 hours ago, jandcando said:

How could I make the nozzle itself move with thurstTransform when the engine gimbals? I know I have to make the nozzle as a separate mesh, but should that mesh get a collider? What is the setup for these kinds of parts?

So, in your part's config, you're going to define thrustVectorTransformName = thrustTransform. This tells KSP that the empty thrustTransform in your part's Unity setup is the object that's going to gimbal around. 

Because thrustTransform gimbals now, anything that is a child of it will also gimbal. As you can probably assume then, you're going to make your mesh, and your mesh's collider a child of thrustTransform.

So your hierarchy will be thrustTransform > your_engine_mesh > collider. You can make the collider and the mesh a child of the thrustTransform, or make the collider a child of the mesh like I do. Matters not. 

Share this post


Link to post
Share on other sites

 

You can have a separate collider for the engine bell that moves with it as a child if you want, or not. Stock parts and mod all vary on this. Many engines just have one collder, without a separate one moving with the bell, and others break it down into two colliders with one that moves. There's no "right" way to do it, at this point. :)

 

Share this post


Link to post
Share on other sites
3 hours ago, curtquarquesso said:

So, in your part's config, you're going to define thrustVectorTransformName = thrustTransform. This tells KSP that the empty thrustTransform in your part's Unity setup is the object that's going to gimbal around. 

Because thrustTransform gimbals now, anything that is a child of it will also gimbal. As you can probably assume then, you're going to make your mesh, and your mesh's collider a child of thrustTransform.

So your hierarchy will be thrustTransform > your_engine_mesh > collider. You can make the collider and the mesh a child of the thrustTransform, or make the collider a child of the mesh like I do. Matters not. 

 

1 hour ago, NecroBones said:

 

You can have a separate collider for the engine bell that moves with it as a child if you want, or not. Stock parts and mod all vary on this. Many engines just have one collder, without a separate one moving with the bell, and others break it down into two colliders with one that moves. There's no "right" way to do it, at this point. :)

 

Thanks for the help, guys!

Share this post


Link to post
Share on other sites
9 hours ago, Stone Blue said:

May I ask why this thread isnt "stickied" yet? ;)

I wouldn't complain! :wink: 

That being said, it will need to be updated for Unity V sooner or later.

Share this post


Link to post
Share on other sites

I'm having some strange problems with the Wings3D program. When I get to the part 20 of your first tutorial, the program freezes my whole PC, when I try to change the numbers in the to-be nozzle. Trying to change the top x-radius to 0.1 freezes the program and Windows as well, I guess it enters some perpetual loop it can't get out of. I'm just deleting the former number, and typing 0 point 1, I guess there's nothing strange in that? Has anyone else had these kind of issues?

Share this post


Link to post
Share on other sites
17 hours ago, Tarthur said:

I'm having some strange problems with the Wings3D program. When I get to the part 20 of your first tutorial, the program freezes my whole PC, when I try to change the numbers in the to-be nozzle. Trying to change the top x-radius to 0.1 freezes the program and Windows as well, I guess it enters some perpetual loop it can't get out of. I'm just deleting the former number, and typing 0 point 1, I guess there's nothing strange in that? Has anyone else had these kind of issues?

Do you have a picture of what you are doing?

Sorry I am having some difficulty following you.

Share this post


Link to post
Share on other sites
57 minutes ago, Beale said:

Do you have a picture of what you are doing?

Sorry I am having some difficulty following you.

I'm getting to exactly this part of your tutorial.

 xObYGUV.png

I have changed "section" to 24, "height" to 0.8, and when I backslash the numbers from "top x radius" so I can input 0.1, the PC becomes unresponsive. Every other section is in the default state. No screenshots, because the PC becomes unresponsive, and I have to switch power off from my laptop to get it running again.

Share this post


Link to post
Share on other sites
33 minutes ago, Tarthur said:

I'm getting to exactly this part of your tutorial.

 xObYGUV.png

I have changed "section" to 24, "height" to 0.8, and when I backslash the numbers from "top x radius" so I can input 0.1, the PC becomes unresponsive. Every other section is in the default state. No screenshots, because the PC becomes unresponsive, and I have to switch power off from my laptop to get it running again.

Ah ok!

This is an unfortunate bug in some versions of Wings3D it seems, I suggest changing from "auto" to "Delayed" or "Manual".

I have had crashes in the past a few times on auto mode, but never anything that severe! Sorry you have had these issues.

Edited by Beale

Share this post


Link to post
Share on other sites
1 hour ago, Beale said:

Ah ok!

This is an unfortunate bug in some versions of Wings3D it seems, I suggest changing from "auto" to "Delayed" or "Manual".

I have had crashes in the past a few times on auto mode, but never anything that severe! Sorry you have had these issues.

I'll try changing the display mode, maybe that'll help.

Share this post


Link to post
Share on other sites

any chance this excellent tutorial could be updated to unity 5 and 1.1.2?

 

 

Share this post


Link to post
Share on other sites
On 5/4/2016 at 11:26 AM, Phers said:

any chance this excellent tutorial could be updated to unity 5 and 1.1.2?

Nothing has really changed.

Share this post


Link to post
Share on other sites
This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.