Weapon Generator - Model by Drawing!
Thanks to SideFX Labs TracePSD nodes without which this would not be possible!

Weapon Generator - Model by Drawing!

Hi!?

My very first article, so please bear with me!

Introducing the Weapon Generator!

It's a Houdini tool you can use to generate weapon base meshes just by drawing in photoshop ( and naming the layers nicely )

You can check out some slides that explain this tool in detail over here!

And please check out the tool and the source here!


Big thanks to SideFX Labs for their TracePSD node without which this would be entirely impossible to do!

Development Journey + Post-Mortem

Here's a development journey + post-mortem on this little tool! (It will be very long, and ramble-y)

About 8 months ago, the WPN-Generator was born!

But it was quite an inflexible tool, and had 3 distinct issues!

Problem No.1: Super-specific-layer-names-problem

No alt text provided for this image

Even though it could model for you, you had to use very specific layer names with very specific suffixes for the tool to know what it should do with each layer!



They had abbreviated names and suffixes that needed to be used with a specific naming convention!

Such as RCVR ( for Receivers), STCK (for Stock), CHMBR (for Chamber), and characteristic suffixes like "F" for flat, "C" for cylindrical, and so on!

The naming convention also had to be:

[Abbrieviated Gun Part Name]#_[Characteristic]

so if you wanted to create a Flat Receiver, you would need to name it "RCVR1_F"...

This made iterating on the PSD super difficult because it's hard to know what "BRRL23_C" means! :(

Solution?

Somewhat-specific-but-still-generic-enough

This needed to be addressed, so in this version, you can name the part however you want in the group name!

No alt text provided for this image

Just that you need to specify the keywords for each layer within the group, but this time; much more generic!




Instead of each layer being a specific gun part with their characteristics in their name, now the gun part is the group, and the layers beneath them are their characteristics.

This gives us much more choices as shown below! (Even defining top and front profiles! Similar to how it works in Zbrush Shadowbox!)

No alt text provided for this image


An added bonus is that you can parent gun parts under other gun parts, and use that relationship!

Such as parenting Trigger under TriggerGuard, under LowerReceiver; allowing us to procedurally scale any children or grandchildren of LowerReceiver to be thinner! (In this case, the parameter is "zThickness Factor")

No alt text provided for this image

This brings us to the next point!

Problem No.2: Really overwhelming interface!

No alt text provided for this image

In the last version of the Weapon Generator, every single gun part had its own set of parameters, embedded into the main interface!

Which made the tool super overwhelming!

So many controls everywhere!

And you couldn't tell what GRIP2 or BRRL1 refers to!



Solution?

FEWER CONTROLS! BUT PROCEDURAL!

No alt text provided for this image

Pretty much!

With the new parent-child layer setup, we can add procedural rules to take away the majority of the work!

Now we just need to care about the thickness of the parent gun parts, and the factor of how much thinner their descendants will be!


No alt text provided for this image

The advanced controls will still be available for specific slider-fiddling if needed!


Problem No.3: Hard to extend or make this into anything else!

The tool was working fine, but it was an absolute chore to maintain.

  1. An enum always had to be defined for a new gun part, or a new characteristic.
  2. The parameter template function for each HDA type used in this tool had to be manually generated and then ran for every asset type in use (eg. RCVR in use, so RCVR assets multiparm is generated on the interface.)
  3. Impossible to introduce any kind of procedural ruleset as each layer is independent and their names are generic.

This means that to extend this tool, a bunch of manual work would need to be done to the pipe, and any form of updates to any of the HDAs will require a re-generation of the parameter template.

Solution?

Redesign the tool and decouple as many aspects of this tool from each other.

Fundamentally the tool was flawed, and it needed some specific requirements for the redesign:

  • Firstly, the tool needs to be able to handle new HDA types (and have a generic way to do it).
  • Secondly, the tool needs to be able to dynamically replicate and link parameters from whatever HDA it has instanced, and it needs to be easy to add in HDA-specific functions.
  • Thirdly, the tool needs to replicate the Parent-child hierarchy that we see in photoshop groups and layers to introduce any kind of meaningful proceduralism.

The tool was then reworked with a lot of old code becoming obsolete and then split into 3 distinct parts!

  1. WPN_Generator_GRP, Fixes up the PSDs to be acceptable to the tool!
  2. PSD Asset Classes, the skeleton of this tool; takes in PSDs and replicates their hierarchy into Houdini, as well as dynamically generating parameters onto the main interface!
  3. WPN Asset Classes subclasses PSD Asset Class, and links to the actual HDA used, with HDA specific logic performed here.

With the redesign, the generator can be extended/modified into other kinds of generators (as long as drawing in PSD layers is the way to create geometry profiles)

Eg. Character Generator, Vehicle Generator, Spaceship Generators

Learning Points:

  1. Figure out what the tool is fundamentally supposed to achieve, and design from that foundation instead of going in with a specific use-case and designing around that, doing otherwise could result in a bloated and monolithic tool that is a struggle to maintain!
  2. Leverage proceduralism as much as possible to reduce work! In the early days of the tool, with the number of controls present on the interface, it was impossible to know which geometry you are affecting plus repeating the same action on multiple gun parts is the norm! Using the thickness procedural ruleset with the parent-child hierarchy reduced much of this work!
  3. Refactor frequently! Currently, the codebase is a mess, and that makes it really daunting to actually continue working on this, refactoring frequently could make the tool much easier to maintain in the long run!

What's next:

  1. The tool will continue to be cleaned up with some plans to be genericized into a "PSD Asset Generator" with the Weapon Generator becoming a sort of subclass of that!
  2. Add in a way to voxelmesh/retopologize the output and make it viable as a base-mesh!
  3. Convert the tool into a web app so that any artists/solo-dev can use this tool regardless of Houdini access!

Thanks for getting this far!

I hope that my development journey/post-mortem has been enlightening!

Do let me know what you think of the tool and don't hesitate to contribute to it! :)

Thank you!

Hmmm...looks strangely familiar. ??

Gabrielle Tan

Associate Software Developer at NetVirta, Inc.

2 年

Mate, that's amazing! Congrats! I'm gonna take a guess that this technically works with any drawing tools that can spit out a .psd?

要查看或添加评论,请登录

Jason Yong的更多文章

  • WPN_GENERATOR 1.1 UPDATE

    WPN_GENERATOR 1.1 UPDATE

    Hello! I would like to share an update on the WPN_GENERATOR I uploaded 6 months ago: This tool is now much faster, more…

社区洞察

其他会员也浏览了