Jump to content

Quick Question regarding...well just about everything it seems now :-)


Recommended Posts

Hello Everyone,

I am just getting started diving into the modelling and texturing of parts for KSP. I have dl\'d and installed blender 2.6 and started goofing around with it.

I made a part and was able to build the collision mesh, add materials, and sort of shape my part, but when it came to the config I noticed that the stack/attach nodes are added via coordinates. I have read in other threads that these coordinates need to be exact as possible to help reduce wobble and such, is there a way that blender can help you find the coordinates you would need to put into your cfg file?

Thanks for the help in advance :-)

Link to comment
Share on other sites

Alas, no. The script included in the KSP SDK is for 3DS Max. No one has created a python script for Blender to do the same, so you have to do it by hand and trial and error.

The biggest help is knowing exactly how tall your collider mesh is, by default blender works in meters (which means you set the scale to 1.0 in the config file) and you can use the properties options to turn on the edge lengths to see how tall or wide each 'face' of your part is.

RTzbE.png

I added the yellow arrow to the option (to bring up the properties menu, hit N while in Edit mode (it toggles it back off too)

As you can see, the side edges of the tank are '2 meters' long, and the radius of the top circle is 1 meter. Since I know the origin of the part is in the dead center of the mesh, I now know the top and bottom nodes will be 1m from the origin, and the artificial attachment surface will also be set as 1 meter from the center of the part.

Which is done like so:

node_stack_top = 0,1,0,0,1,0

node_stack_bottom = 0,-1,0,0,1,0

node_attach =1,0,0,1,0,0

Do remember that KSP uses Y as the vertical axis, but Blender uses Z, so remember to transpose those in your mind (the DAE exporter does it automatically for the game, no need to worry about changing things in blender)

Also, depending on what you\'re attaching to, you might still need to adjust the nodes in or out some for a perfect attachment with no gaps - there are a lot of sloppy collides out there (including some of mine, I am sure) so you sort of have to compensate for them. So you\'d just add some small adjustments so the positions:

node_stack_top = 0, 1.05, 0, 0, 1, 0

Now, if your collider isn\'t a cylinder or cube, you\'re going to have to resort to even more manual methods, where you\'ll start the node as a 'best guess' and then tweak it until it attaches as snugly as you can before it fails to attach at all.

Hope that helps.

(side note: there are some other useful tools in that properties menu, including the angle measurements of the faces/polys and the options to turn on the visible 'normal' lines that dictate which face of your poly is 'visible' - If you ever have part of your mesh thats invisible in game, you\'ll need to turn on normals to find which faces have theirs pointing in the wrong direction, highlight them and 'flip normals' from the edit mode menu.)

Link to comment
Share on other sites

Awesome, thank you for the info, I have it setup as a trial and error sort of thing now, I wish the KSP partlab showed mount points so you could trial and error without going in and out of the game.

My problem now is my fail texture isn\'t loading...so I am messing with that :-)

Link to comment
Share on other sites

The method that works for me, is that I move my part to the center of the scene, then just select a vertex that\'s closest (or selection, etc) to the point I want a part to have a connection node, do mesh>snap>cursor to selection and then look at the coordinates of the 3d cursor. Oftentimes the values there can be put into .cfg straight away and work perfectly. Sometimes a bit of fiddling is required, and on some parts I can\'t make it work perfectly even after weeks of trying :)

Link to comment
Share on other sites

Awesome tip Sarkun, I will remember that. My biggest problem right now is my model is clipping in partlab, like I left some faces untextured or something or it is using the UV map from the collider node, its quite frustrating, I will keep at it till I get it though :-)

I do have a question about the models in blender though, when I do the collision mesh, is it better to fit it to the part or can you use a generic shape like a cylinder or box? Just curious.

Link to comment
Share on other sites

You can do both, depending on attachment requirements - engines usually don\'t have anything surface attached to them, so their colliders work fine as a simple cylinder to describe the space that inhabit - things like winglets and such typically have a collider that mirrors their shape pretty closely, and stuff like payload fairings only have colliders in the base or centerline where they attach.

The main thing to worry about is ensuring your don\'t create shapes with concave faces - the engine won\'t handle that properly

As an example.. you could create a 5 sided pentagon, but shaping it like a 'star' with peaks and valleys would not work.

Link to comment
Share on other sites

Ah, makes sense to me, the model I have right now actually started working, it seems a played with the top and bottom mount points and magically my temp texture loaded and everything was right with the world. As far as handling, I am not sure how it will handle, it seems to be stable in the test flights, I just need to texture it better.

Have you guys had an issue where faces seem to be missing? I have put a material on every surface but it still seems to be missing.

I am going to load up the part that I currently have if anyone wants to take a look at it and give some pointers to a noob :-)

I present Kerbanigans Incorporated first liquid fuel engine (WIP), the KILFE.

Link to comment
Share on other sites

You can do both, depending on attachment requirements - engines usually don\'t have anything surface attached to them, so their colliders work fine as a simple cylinder to describe the space that inhabit - things like winglets and such typically have a collider that mirrors their shape pretty closely, and stuff like payload fairings only have colliders in the base or centerline where they attach.

The main thing to worry about is ensuring your don\'t create shapes with concave faces - the engine won\'t handle that properly

As an example.. you could create a 5 sided pentagon, but shaping it like a 'star' with peaks and valleys would not work.

LOL, after a gratuitous amount of coffee it finally clicked what you were saying there...my engine has concave faces on it :-P Good to know, I am going to start working on cooking up another model, need the practice anyway :-)

Link to comment
Share on other sites

Okay loaded up your blend file - you don\'t need that complex collider at all - I put an example of what it should be in the screenshot, lower left. Just needs to be moved down to cover the model (keep in mind colliders are invisible in game, and just need a simple material due to exporter limitations, but don\'t need textures or mapping.

u0oip.png

Also, I checked out the main engine object to see why you might have transparent faces - I bet there were on the bottom in the area shown in the screenshot?

There are some flipped normals. I hit N to get properties, and turned on Normals, Face. It turns on those blue lines showing which side of each face will reflect lighting, the side that doesnt reflect will be transparent (and is usually on the inside of a model, of course)

To easily find which need flipped, hit A to highlight all faces (in edit mode) and then on the Edit menu (left column) hit Flip normals - that swaps which side has the line, all the 'correct ones' will then be inside and those that were in error will have their line showing now. Then you can highlight the troubled ones, hit Flip again and then once again highlight All and flip them all back to the outside.

Should solve your transparency.

(note, not all of those visible in the screenshot are 'wrong' - some are just poking through even though they\'re reversed 'inside' for the test, due to the angle of the face. Only those that are 'full length' and obviously emerging from the exposed face are broken.)

The other possibility is that you UVMapped the faces but left them untextured in the PNG file, so they\'re sitting in the Alpha transparency area.

Link to comment
Share on other sites

Thank you, my part was pretty close, the one I just modeled and then deleted because it wouldn\'t work properly :-P It would have been a nice model too :-( had 118k polygons or so. For some reason it kept applying the texture to the collision mesh so it looked like a big cylinder with some whacked out texture LOL.

Link to comment
Share on other sites

That\'s the soft limit, what is considered acceptable and non-laggy for the majority. He\'s talking the hard limit, the 'Try to load this and the engine is going to crash' limit.

LOL, that\'s a good tidbit to know, that part would have taken, close to literally, forever :-) Luckily I accidently messed up the model and deleted it all so I could start over....I really need to stop doing that.

Link to comment
Share on other sites

LOL, that\'s a good tidbit to know, that part would have taken, close to literally, forever :-) Luckily I accidently messed up the model and deleted it all so I could start over....I really need to stop doing that.

Drawing from my vast experience of two models under my belt, I can say that removing any faces that will be unseen (i.e. inside the model) can cut around fifty-ish polygons on average*.

*I dunno, it sounds right.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

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

×   Your previous content has been restored.   Clear editor

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

×
×
  • Create New...