Tuesday, April 26, 2016

Reallusion Character Creator

Taking a break from Project Merfolk, I decided to do more preproduction level work.  One thing about Project Merfolk I didn't really establish was a good character pipeline.  I was using Mixamo Fuse, which I liked for character creation, but I was having a few issues:
  • After its acquisition by Adobe, the Steam version of Fuse seemed abandoned; I'm not a fan of Adobe Cloud and didn't want Adobe Fuse -- the next iteration of Mixamo Fuse.
  • The amount of customization, though strong, left a lot to be desired at times.
  • Exporting a character to the website to download your auto-rigged Fuse model, though great, was also a bit slow at times and a paranoid part of me is always nervous when they'll shutdown that server.
Anyway, for those reasons, I wanted to try and find a different character creator.  I stumbled upon Reallusion's Character Creator (CC), an extension of their iClone product:

From their website.  I get what they are going for, but still, a bit creepy, right?

There were a couple of things I liked based on the preview and a quick trail period:
  • A lot more selection and variety for morphs
  • The ability to easily make new morphs
  • Exported characters are auto-rigged with facial blendshapes AND twist bones
So after downloading the trail -- and eventually purchasing it -- here are my notes of pros and cons

Pro:  Lots of Different Morphs (but could be more flexible)


Like I said earlier, there are a lot of different morphs and there are even more that you can purchase -- which I did.  The only thing that annoys me is that every morph is limited to 0 and 100.  I've used similar programs where these limits don't exist; however, I think this is done so that other parts of the program, such as clothing and auto-rigging, are more stable.

You don't have to go to ZBrush, but it's probably easier to edit in there than some programs.

Con:  The controls are TERRIBLE!


Admittedly, I am a bit spoiled (or used to rather) by 3DS Max's controls, so the controls for the Character Creator were a bit foreign to me at start, or at least I haven't gotten used to them.  For example, the camera controls are:

Z:  Pan Camera
X:  Enter Camera
C:  Rotate Camera

To my knowledge, there isn't a way to edit these either, which is rather irritating.  Also, there's only one viewport, so you have to switch to the camera view to see your character from all angles.


Pro:  Nice character models


Now, every character creator I've ever used always has a certain "look" to their characters something that makes them seem cheap and easily recognized, similar to when people are like "Oh, this is obviously a Unity game".  In my opinion, similar to when buying an asset of any kind, you shouldn't just USE the character you get directly from the creator if you want to avoid this; however, I feel like this CC can definitely get you a look closer so you don't have to do this.
For example, if you want characters to have more expressive or larger eyes, there's probably a morph that exist for this, OR you can make your own that achieves this.
Also, since they use Allegorthmic Substance materials, you can customize a variety of textures for your characters by just tweaking a few sliders and substituting a few maps.


Pro:  Good rigs -- though a bit advance


The rigs you get when you export a character are pretty good and they import nicely into Unity3D -- though the thumb and index fingers get mixed up when setting up a humanoid avatar.  They have arm and leg twist bones -- something Mixamo Fuse does not have -- though animations on these bones won't export automatically if you are Humanoid avatar rig in Unity, but I'm sure a script could be made to treat them similarly to 3DS Max's biped twisting bones.
Unfortunately, they do not have facial bone rigs -- unless there is a setting for this I missed -- but they do have blendshapes for various expressions.  The reason I say setting is that the rigs export with a bunch of dummy objects that would indicate that facial rigging does exist.
In addition, I only have to export to a propriety program instead of a proprietary site like Mixamo to get and use my rigs.

Con:  Meshes are a bit heavy


In addition to having a lot of bones in the rigs, upon export, the average character -- depending on how much clothing you dress it in, is about 50K triangles.  If you are making a console or high-end PC game or a game with few characters on screen at any given time, this is probably fine and can be fixed with LOD meshes or retopologizing.
In addition, there are a LOT of texture maps generate with each character, for example, there is a separate texture created for a character's nails and teeth as opposed to combining them.  This may be parameter that can be adjusted similar to Fuse, but I haven't found it yet.

Con:  Little clothing and hair to choose from

This was a problem in Fuse too, but there are few pieces of clothing to choose from and even less hair, and, unlike Fuse, there doesn't seem to be a pipeline for creating your own clothing.  I can understand why as there is probably lot more setup to clothing besides just modeling it.  I do, however, think there are plans to add this feature eventually.
Here is some clothing available from start (with the essential bundle):
  • Shirt
  • Tanktop
  • Jeans
  • Joggers
  • Skirts
  • Blazer
  • Sneakers
  • Boots
  • Sandals
  • Heels
And with the use of procedural materials, you can create a huge variety of outfits with little modeling effort.

Undecided:  Requires / Comes with iClone


So CC is really an extension of another tool known as iClone, which is for 3D animation.  From what I gather, it's does everything that 3DS Max's biped or Unity's human avatar does.  Every character has a standard rig and then you import animations into the engine.  
It has control issues similar to CC and it doesn't really seem to be intended for animating IN rather than using mocap or premade animations and adjusting them for your characters a bit -- blending, putting on multiple rigs, etc.  The package I obtained does include a tool for capturing mocap from a Kinect; however, I haven't tested this out yet; as I have yet to purchase the connector needed to hook a Kinect to my PC.

Con:  Relatively Expensive


No one likes talking money, and CC is free as part of a trial to iClone, but to export a character created in CC, you have to purchase an iClone license.  Though perpetual, it's rather expensive, about $700 -- and this is a sales price that I think ends soon.  In addition, the special morphs were another $150.  I was cautious, but I ultimately feel this was a worthwhile purchase as 3D character work like this is something I want to utilize in my future work.  This is what I got:
  • iClone
  • 3D Exchange (tool used to go between iClone and other programs)
  • Character Creator
    • Essential Clothing and Morph Bundles
    • 100 Reference Heads
  • Kinect Mocap Plugin
So in summary, despite the price, I think CC was (or will be) a worthwhile investment.  It seems the product will continue to improve and advance and, since I like making character-focused games such as fighters that focus on characters models, it fits my needs.  I am a bit disappointed that iClone seems to do things that 3DS Max already does.  In addition, I still need a way to either edit or make unique clothing, which brings my to my next point:

Marvelous Designer

I posted about CC awhile ago, and someone brought up this program, which I had forgotten about actually.  It's essentially a much better version of 3DS Max's Garment Maker -- more stable, easier to use, etc.  The issue is, despite it being easier, it requires precision and a rather good knowledge of actual clothing design and pattern making.  It's neat, but I'm unsure if it's actually useful for what I do, and with the clothing CC already provides, could I just apply a morph or a simple fix to the clothing I already have instead of making my own garment pieces?  If a perpetual license wasn't $550 (or $60 a month -- I just dislike subscription models), I'd probably be more inclined to get it, but I'm on the fence and need an actual character idea that would need it before investing the time / money to learn it.



Anyway, my next plan is to try and make a character from beginning to end that uses CC.  Tempted to do it for a Project Merfight character, but I may want to try and do something more human first.  I'll post progress when I get that started.

Monday, April 4, 2016

Project Merfight DevLog 01

So as I've hinted in previous posts, I've started a new game!  I still don't have a title, but for now, I'm calling it Project Merfight.  This name is appropriate as it involves merfolk and fighting!  I haven't done a great job logging my games as they progress, so I want to improve upon that.
This first post is about the game itself, but also some of the developments I've made on the 3D front of the game.  To summarize Project Merfight is a tactics RPG with a battle system influenced by fighting games.  I've been working on the game for a while on and off while working on Battle High 2 A+ stuff; however from February till now, I've been trying to get a build ready for Indiecade.
What I have so far:



Essentially, during the month of February, I focused on the tactics aspect, mostly just getting the characters walking around the screen.  Then, I wanted to get the battle system down.  As I work on this, I do wonder, "Why don't I just make a fighting game?"  Well, this game's goal is to fill the void I feel fighting games have been leaving for me lately.
One is story.  I've said numerous times that fighting games are not good at telling stories.  The story ends up getting in the way or is often neglected or ignored.  Though I don't have a super deep story written at the moment, the goal is to attempt to deliver one.  Another void is single player content.  At the launch of Street Fighter 5, I felt myself wanting more.  Playing online crosses this border between fun and frustrating for me rather quickly, and I'd rather just spend my energy in other places, so instead of trying to improve my skill in a fighting game, I decided to try and use my knowledge and see if I could create an RPG experience that takes some of my favorite parts of fighting games and puts them in this space.
I'm using Unity3D, and though I like using the game engine a lot, there are always a few things I encounter when working in it; these items I wanted to document.

 

Using Mecanim with Equippable Attacks

 So right now, the flow of the game is you do the tactics part, moving in range of an enemy, and enter the attack phase, which looks similar to a 2.5D fighting game.  You perform a combo within the time limit to inflict damage.  What I want to do is that every time you use (or land) an attack, you gain experience points for that attack.  Once an attack levels up, that attack either gives you HP, Attack Strength, etc., but also, new attacks OR, similar to Namco X Capcom, the attacks change so you're forced to learn how you attacks connect more.
One technical issue with this, however, is that Unity's new animation system, Mecanim, really feels that it was built to assume that your animation state machine will never change.  There is the Animator Controller Override system -- which I do utilize -- but that feels more for like "Oh, I'm replacing this character's walk cycle with a different one but all the other states are the same."

 

Solution

So, what I'm doing is essentially I'm taking EVERY state in the game -- a lot I'm still missing sadly -- and putting them into one AnimatorController
 
This is only a small section of it too...
 I then have an AnimatorOverrideController that references this:

So happy Unity fills these in automatically...


Finally, before the fight segment of my game begins, I assign various state to animation pairs, instantiate a new AnimatorOverrideController, and replace the animations I need.  The main reason for this is that I'm not sure yet how many animations a single character will have and instead of having possibly 100s, I only reference the ones I need for that battle segment.  I've also created a custom data class that handles transitions -- as well as other info such as when attack spheres should be tracked.  Anyway, I'm happy with this solution for now -- until I test it on Xbox One and it breaks for some reason (which I'm hoping doesn't happen).

 

Swapping Equipment

So once I solved my animation issues, I had another issue related to equipment.  How was I going to equip different items to my characters?  I could do something where the items don't get shown, but I felt this was rather boring.  I want what the player equips to the characters to show up; I think it's important.  This is what I have so far:



Essentially there are several types of equipment I am dealing with:
  • Color swaps
  • Normal Meshes (or GameObjects)
  • Skinned Meshes
Color swapping was easy.  I just make a new material for one of the default items the character is wearing and swap them as needed.  Unskinned meshes and other game objects were simple too.  I have each bone of the character referenced, so I just reparent the item to a designated bone.  In the video, this is how I'm making the sash -- which his also using Dynamic Bone, an asset I recommend -- as well as the "Kelp Juice" attached to her hip.
The hardest part was skinned meshes.  Now, I could put every skinned mesh the character will use into one file, but I don't want to have to keep doing that and having to deal with a giant 3ds max and fbx file with a bunch of different parts.  When working though, I figured, "Oh, I'll just import the other skinned mesh, change the root bone, and it'll just work, right?"  Nope!  The problem is that upon import, the skinned bones and root are assigned to the Transforms included upon import.  Also, you need to make sure that upon import, the bones in the skinning data -- at least from 3DS Max -- go from the root bone and include parents of any bones.  It's almost safer to include the entire skeleton in the skinning data; Unity will remove all those with no influence upon import.  So after fighting with this for almost an hour, I figured that I need had to write something to transfer the bone data from my imported meshes to the current character's rig.  The following script does so:

[ExecuteInEditMode(), RequireComponent(typeof(SkinnedMeshRenderer))]
public class SkinRendererWeightTransfer : MonoBehaviour
{
        [SerializeField()]
        bool initialized = false;

        [SerializeField()]
        SkinnedMeshRenderer smr;

        public Transform newSkeletonRoot;

        [SerializeField()]
        string originalRoot = "";

        [SerializeField()]
        string[] originalBoneNames = null;

        void Awake()
        {
            initialized = false;
        }

        public void Update()
        {
            if (!initialized)
            {
                if (!smr)
                {
                    smr = GetComponent();
                    if (!smr)
                        return;
                }

                if (originalBoneNames == null || originalBoneNames.Length == 0)
                {
                    originalRoot = smr.rootBone.name;
                    originalBoneNames = new string[smr.bones.Length];
                    for (int i = 0; i < smr.bones.Length; i++)
                        originalBoneNames[i] = smr.bones[i].name;
                }

                if (newSkeletonRoot == null)
                    return;

                // Reassign bones
                if (newSkeletonRoot)
                {
                    Transform newRoot;
                    if (!StaticHelpers.FindChildByName(newSkeletonRoot, originalRoot, out newRoot))
                    {
                        Debug.LogError("No bone found for:  " + originalRoot);
                        return;
                    }

                        Transform[] newBones = new Transform[originalBoneNames.Length];
                    for (int i = 0; i < originalBoneNames.Length; i++)
                    {
                        if (!StaticHelpers.FindChildByName(newSkeletonRoot, originalBoneNames[i], out newBones[i]))
                        {
                            Debug.LogError("No bone found for:  " + originalBoneNames[i]);
                            return;
                        }
                    }

                    smr.bones = newBones;
                    smr.rootBone = newRoot;

                    initialized = true;
                    enabled = false;
                }
            }
        }
    }


 Probably not the best formatting for this blog, but essentially, I'm storing the original bone names and order, and then, upon equipping to the character, I get the new bone transforms.  (StaticHelpers is my own class).

Anyway, with this issues solved, I could start making equipment for my characters -- of course, writing details and what aspect of the characters they affect is an entirely different design mess.

Tons to Do!

I still have tons to do and I'm not even close to calling this game done.  I'm submitting a prototype more or less to IndieCade in the hopes that I can get some good feedback and maybe generate some interest.  These are still the biggest issues I'm having:
  • RPG Design.  I feel I have a decent grasp of fighting game design after all of my Battle High 2 A+ work; however, even just the pathing system took me awhile and I ended up finding a solution that was better than what I  had been doing and implementing that!  I'm just nervous that managing all of the data like how much each item cost, the stats they effect, etc., is going to prove not only difficult but boring and make me lose interest in the game.  And don't get me started on UI.
  • Title!  I still don't have an official title for this damn thing.  Project Merfight could work, but it sounds unfinished.  Essentially, the game takes place in a fantasy world that is inhabited by merfolk -- more like Rikuo from Darkstalkers than Ariel from the Little Mermaid.  The original idea was that it was going to be more similar to a World of Warcraft world in terms of aesthetics, but my friend got me thinking to change that a bit, and I thought about bioluminescence and have this 80's / neon yet underwater idea going through my head.
  • Content!  Rpgs -- well all games really -- have a ton of content.  Part of my goal recently was to go through the game and see how quickly I can make the content.  Having an idea of how to swap objects -- whether it's through texture or  meshes themselves -- helps, but still causes a bit of anxiety.
  • Tutorial -- though there are games that have done this similar, I want to try and make the game more about discover and experimentation instead of me telling the player how to do everything.  That being said, I'm still going to need to make a tutorial.  I want to take the Final Fantasy Tactics approach where it's optional, but I'm afraid if I do that I'll just neglect it.
  • Story.  I like writing, but I always lack confidence in my writing.  I also want the story to branch by level objects -- defeat Boss A goes this route versus defeating Boss B for example.  This is a lot of work, and in this first iteration, I will most likely be cutting.
Anyway, my goal is to get at least 2 levels (3 if you count a tutorial) before the late IndieCade deadline of May 15th.  I know the game will be far from what I want, but again, having the deadline is helping me focus and solve problems I'd probably ignore for months before actually tackling.  I'll try and post more about Project Merfight as I continue to work on it.  In the meantime, enjoy some gifs!