Jump to content

Procedural Greebles


Toontoonizer

Recommended Posts

Hi all,

I've been wanted to have greebles in Kerbal for a long time now. For those who don't know what im talking about, greebles are non-functional (or functional if you so wish) parts of spaceships/vessels/objects that provide detail and a sense of mechanics. A google search of "greeble" will give you an idea, but we're talking about tubes, pipes, heat exchanges, and any other manner of bit bobs.

Now i understand that not all types of greebling would be suited to procedural generation - but im thinking along the lines of procedural tubing or piping that you can place on a craft by clicking its path, adjusting bend types and angle, textures, shape etc.

I am happy to have a go at this myself - my only hindrance is coding. As in, i have very minimal experience of this. And modding - not done that either. I can model in 3d software - so what i want to ask of the community is outside of the resources available in the stickies, where can i start to learn about creating this kind of mod? And even better would anyone be willing/have the time to help out or just help me understand what needs to be done?

 

Link to comment
Share on other sites

Well, nobody else has said this so I'll chime in.

Unity is an incredibly powerful engine. I've seen it do some amazing things.  I have no doubt that what you want to accomplish could be done given the time and the knowledge.  However, as powerful as Unity is, you're looking at, for example, taking a cube and adding hundreds of polygons to its texture.  And for nothing more tan aesthetic reasons.  While there is much to be said about visual appeal you have to ask yourself, is the taxing this will put on the engine, and the end user's system, worth the load it will create?

The first hurdle you'll have to overcome, if you persist in this pursuit, is how to completely... and procedurally... rework hard coded parts and models that are stored in files.  And honestly, Unity allows access to a LOT of the model's settings in-game.  Accessing the actual meshes and their polygons and trying to deform or add to them... I know of nothing in Unity that allows that.

You'd be better off trying to create your greeble part and add it to the game rather than trying to deform someone else's parts (which might just torque me off if my steampunk parts gets turned into greeblepunk).

Here's the tutorial that got me started years ago and it's still a very, very good one (Yes, I invoke the @Beale tutorial again).  It will start you off using Wings 3D to model a part and then, show you how to get it into the game.

GL

 

Link to comment
Share on other sites

@fengist Thanks for taking the time to respond! really appreciate it.

I will definitely check out the beginners part modding tutorial - i have no doubt this will not be an easy ride especially as i have minimal to no modding experience but hey you gotta challenge yourself right. 

6 hours ago, Fengist said:

The first hurdle you'll have to overcome, if you persist in this pursuit, is how to completely... and procedurally... rework hard coded parts and models that are stored in files.  And honestly, Unity allows access to a LOT of the model's settings in-game.  Accessing the actual meshes and their polygons and trying to deform or add to them... I know of nothing in Unity that allows that.

Yes - i did think that truly procedurally generated things will be very difficult (if not impossible) but at the least having greebles that are highly customisable would be as acceptable to me. I am thinking of something along the lines of the procedural parts mod with configurable tanks, wings, nose cones etc. For example, you could have a wiring that could be customisable in length, width, whether it is a bundled wire, what kind of bundle (flat/honeycomb/cylindrical), is it a bend, if so what is the bend angle, is it a junction, etc.

Or for just innocuous looking bits and bobs with customisable sizes etc. 

6 hours ago, Fengist said:

You'd be better off trying to create your greeble part and add it to the game rather than trying to deform someone else's parts (which might just torque me off if my steampunk parts gets turned into greeblepunk).

Yes - i thought as much also. I am comfortable with modelling so no issues there. Its more trying to understand how the modelling and customisable parts come together. So, lets say I have a vent and one of the parameters is the number of blades on the fan - would i need to have a model of the fan that corresponds to every option available on the number of blades and simply changing the numbers swaps out the mesh? Just things like that I would like to understand.

 

6 hours ago, Fengist said:

Unity is an incredibly powerful engine. I've seen it do some amazing things.  I have no doubt that what you want to accomplish could be done given the time and the knowledge.  However, as powerful as Unity is, you're looking at, for example, taking a cube and adding hundreds of polygons to its texture.  And for nothing more tan aesthetic reasons.  While there is much to be said about visual appeal you have to ask yourself, is the taxing this will put on the engine, and the end user's system, worth the load it will create?

I understand the argument - but our modern systems are more than capable of handling some greebles even if they add a few thousand polygons - for users whose systems can't handle it, they don't have to use it. Plus, for me, aesthetics and detail is important. I actually find that alot of the engine models available are too sparsely detailed for my liking. Where is the mass of tubing and piping? the various mechanical components that make the machinery itself beautiful Sure you could argue Kerbal was not intended for that - but thats what modding is for. For me the aesthetics is worth it, it adds to the immersion.

I dont envisage the greebles having any aerodynamic impact so it would just be a rendering impact rather than a physics one.

Thanks for replying again! I'm going to have to set out some time this weekend to start reading and experimenting. I'm hoping i can get some input into the procedural/configurable elements from somebody because totally clueless about that haha.

Link to comment
Share on other sites

54 minutes ago, Toontoonizer said:

I am thinking of something along the lines of the procedural parts mod with configurable tanks, wings, nose cones etc. For example, you could have a wiring that could be customisable in length, width, whether it is a bundled wire, what kind of bundle (flat/honeycomb/cylindrical), is it a bend, if so what is the bend angle, is it a junction, etc.

would i need to have a model of the fan that corresponds to every option available on the number of blades and simply changing the numbers swaps out the mesh? Just things like that I would like to understand.

I'm hoping i can get some input into the procedural/configurable elements from somebody because totally clueless about that haha.

Procedural Parts is indeed probably the right mod from which to learn, at least at first. It generates its meshes dynamically here, based on some input objects generated by the specific shapes:

https://github.com/Starwaster/ProceduralParts/blob/master/Source/ProceduralAbstractSoRShape.cs#L607-L802

In principle your mod could adopt and adapt that approach, but with different input objects to reflect the greebly shapes you want.

It appears there's one mesh for rendering and another for the collider, which presents an interesting question for your mod idea: Does greeble need a collider?

Link to comment
Share on other sites

4 hours ago, Toontoonizer said:

@fengist Thanks for taking the time to respond! really appreciate it.

Yes - i thought as much also. I am comfortable with modelling so no issues there. Its more trying to understand how the modelling and customisable parts come together. So, lets say I have a vent and one of the parameters is the number of blades on the fan - would i need to have a model of the fan that corresponds to every option available on the number of blades and simply changing the numbers swaps out the mesh? Just things like that I would like to understand.

 

No problem.  This brings another idea to mind.  I believe that Firespitter does something similar to what you want here.  I believe @Snjo has helicopter blades that essentially duplicate themselves.  The user selects the number of blades and he prodecurally takes a single blade from the model and places duplicates around a hub.  I haven't looked at his parts in a few years but I think it was he who came up with that. I may be wrong.  And yes, he definitely uses mesh swapping for some of his parts, which procedurally speaking, is relatively easy to accomplish.  The problem you'll face there is the mesh is typically created beforehand and stored in the model's file.

You may also want to take a look at some of Lack's parts in the LLL mod.  He uses texture swapping to place 'pipes' and different faces onto some of his parts.  Which these choices would give you the potential effect you're looking for, those textures and meshes were again, created beforehand and stored in the part's file.

Link to comment
Share on other sites

As HebaruSan mentioned you may not want colliders with your greeble - if greeble isn't physically significant (I think you can still do that with the PhysicsSignificance field in the cfg) it would reduce the processing load on the computer as it would be ignored when checking for collisions.

If you haven't run across it yet there's a page with lots of info - some outdated (like wheel info) - but still lots of good stuff:

 

 

Link to comment
Share on other sites

On 9/14/2017 at 10:44 AM, HebaruSan said:

Procedural Parts is indeed probably the right mod from which to learn, at least at first. It generates its meshes dynamically here, based on some input objects generated by the specific shapes:

https://github.com/Starwaster/ProceduralParts/blob/master/Source/ProceduralAbstractSoRShape.cs#L607-L802

In principle your mod could adopt and adapt that approach, but with different input objects to reflect the greebly shapes you want.

It appears there's one mesh for rendering and another for the collider, which presents an interesting question for your mod idea: Does greeble need a collider?

Thank you @HebaruSan - I had a look at the link you sent. Sadly, it was 60% gibberish - i might need to read up on some unity coding (or just general unity tutorials tbh). In terms of a collider - i don't think the greebles would need a collider - they are primarily aesthetic. Although for larger greeble pieces it may be useful? Or if greebles are given functionality (i.e. cooling units?)

On 9/14/2017 at 1:39 PM, Fengist said:

No problem.  This brings another idea to mind.  I believe that Firespitter does something similar to what you want here.  I believe @Snjo has helicopter blades that essentially duplicate themselves.  The user selects the number of blades and he prodecurally takes a single blade from the model and places duplicates around a hub.  I haven't looked at his parts in a few years but I think it was he who came up with that. I may be wrong.  And yes, he definitely uses mesh swapping for some of his parts, which procedurally speaking, is relatively easy to accomplish.  The problem you'll face there is the mesh is typically created beforehand and stored in the model's file.

You may also want to take a look at some of Lack's parts in the LLL mod.  He uses texture swapping to place 'pipes' and different faces onto some of his parts.  Which these choices would give you the potential effect you're looking for, those textures and meshes were again, created beforehand and stored in the part's file.

Ah yes, thats very interesting. I imagine that for most greeble parts (aside from wires, pipes, tubes and other things that are derived from primary shapes) mesh swapping would be needed. I will have a look there also!

On 9/16/2017 at 4:04 AM, wasml said:

As HebaruSan mentioned you may not want colliders with your greeble - if greeble isn't physically significant (I think you can still do that with the PhysicsSignificance field in the cfg) it would reduce the processing load on the computer as it would be ignored when checking for collisions.

If you haven't run across it yet there's a page with lots of info - some outdated (like wheel info) - but still lots of good stuff:

 

 

@wasml thank you! will have a gander.

5 hours ago, White Owl said:

I've thought I would like to have a visual representation of pipes and wiring harnesses, showing how various components are run. Sounds like your proposed mod would work for that, if desired. So that's cool.

@White Owl Yup - hopefully it actually becomes something :D

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