Character Generation Experiments
Over the past few months I've been working on developing procedural characters. This started as a result of the game I worked on at Global Game Jam 2017, L-Wave. In the time between the jam and the follow up IGDA meeting I developed a system for generating background characters from a pack of sprite pieces and simple HSV shifting.
(character art by Kai Lynk)
Later, I ended up adapting this same process to a more detailed character. I have a game concept I'm working with right now which would utilise comic book style characters so I searched the Unity asset store for the closest approximation I could find in the free assets. Thankfully, I found an anime-style character with about the right level of detail and it came with a really well structured PSD file for me to work with. I cut the character up into more specific layers where necessary (mainly the sections of clothing details) and then re-imported the sprites and applied the modified L-wave system.
(character art by 'piablood' sourced from the Unity Asset Store)
This ended up being pretty problematic though, as Unity doesn't seem to have the ability to save the compiled final sprites post-manipulation as assets and the generation process is really slow. As a result, I ended up shifting to a shader based approach. Due to the necessary complexity of the shader I decided that writing the shader from scratch would have been far too difficult, and I'd been meaning to try out some of the nodal shader assets available on the asset store, so I decided to make the shader with the aid of one of them. I ended up deciding on Amplify Shader over Shader Forge as it seems to be about on par, cheaper, and more frequently updated, so I suspect that it will become the dominant option soon.
However, at the moment it only supports surface shaders (I didn't realise that would be an issue at the time) and there's an issue with surface shaders being used for UI in Unity (see above...). I manged to work around this by setting the canvas to screen space - camera, turning off all its shader channels, and removing all lighting, opting for maxing out the ambient light instead (and setting it to baked, not real-time). This somewhat emulates an unlit effect.
This does mean that I'll be unable to use any normal mapping (which I was considering testing out) but the finished product looks just as good as the generated approach but is easier to manipulate and considerably faster.
I also ended up needing to rely on Multiply blending colours rather than HSV shifting (as I didn't know how to emulate that in shader), which didn't work too well with this asset as it already had some colours but would be fine with assets designed with it in mind.
This gif also gives a bit of an idea of the animation system I've put together which I'll cover in a separate post.