Wednesday, July 20, 2016

Golem Jox 2: A Fighting Game Unet Experiment

During my spare time for the last couple of weeks I've been working on a fighting game prototype in Unity 3D involving primitive 3D shapes.  The following video shows the progression of this prototype:

I had the following two goals while working on this:
  • Create a 2.5D fighting game that utilizes Unity3D's Animator class
  • Make the game work online using Unity's new(er) high level networking API
The game idea, entitled Golem Jox 2, is based off an old jam week project I did at Schell Games a few years ago.  The overall design is that by switching various body parts, legs, arms, etc., the player would have different moves and attacks available.  Though this would be a balancing nightmare -- a nightmare I'd at least attempt to live through -- it could have served as a unique way to allow players to create a fighter that fits their particular play style.  Unfortunately, I didn't get time to integrate the UI needed to allow for swapping.
What I did get to focus on, instead, was the networking aspect using UNet, Unity3D's networking API.  This post is about that game prototype, some lessons I learned, approaches, etc.

Deterministic Approach

So as much as I like Unity3D, one issue I have is that it doesn't feel precise at times, meaning if the game is running at a certain frame rate on one machine it'll yield results different from those of a machine that runs better or slower.  There are ways to resolve this issue, such as using Time.deltaTime, but sometimes there can even be issues with this such as floating point precision issues.
With this goal in mind, my first task with this was to create a way to update the game in a way that would be consistent regardless (or nearly regardless) of any slowdown.  To accomplish this, I used something that resembled the following in my Update method:

// The amount of time, in seconds, that must elapsed before updating the game.
float frameRate = 1f/60f;

// The current frame the game is on.
uint currentFrame = 0;

void Update
     time += Time.deltaTime;
     while  (time >= frameRate)
          time -= frameRate;

Now, this is similar to FixedUpdate, which is supposed to be consistent; however, I suspect that sometimes a frame can be skipped, or the game can be running slow and the value of currentFrame wouldn't increment when I want.  I'll explain the importance of currentFrame later.  Anyway, within the method, ManagedUpdate, I update the players, their physics, any other collision testing I need to do.  I even manage their Animators, which can done by disabling the Animator Component and calling animator.Update(frameRate).  This allows me to know that the Animator is updating consistently and if a few frames need to be skipped, these are skipped in the Animator.

Animator + Mecanim

When Mecanim / Animator, Unity3D's updated solution for playing animations, was announced, my initial thoughts were very skeptic.  I was having some issues and the editor could be better for it; however, its ability to allow for animation retargeting, animation blending, and IK functionalities made it something I really wanted to do for this game.
The following is what the initial state machine of my Animator Controller graph looked like:

I'd show more if Unity let you zoom out...

For this prototype, I used a lot of asset store animations such as and  What was great about this was that, because of humanoid targeting, I could use a variety of animations and have them blend smoothly with little to no popping.  Another aspect that Mecanim made useful was StateMachineBehaviours.  StateMachineBehaviours have entry, exit, update, movement, and inverse kinematic methods that can be overwritten.  I usually just used entry, exit, and update.  Originally, I tried using internal variables within each StateMachineBehaviour such as tracking the frame and assigning an exit frame.  There were some issues when you try and enter the same state and use this method, so I decided to use a parameter instead.  Also, it's important to note that Exits happen after Enter if a transition is utilized.
In addition, prototyping is a great time to just experiment with fun things in general.  I did this with the smear effect, which was a vertex shader I found on Twitter:


So, for a long time, online multiplayer has been very intimidating to me.  In a previous game, Battle High 2 A+, I didn't even attempt to try and do it as I felt I wouldn't be able to do the job properly.  Now, using UNet, I decided to try my hand at prototyping online multiplayer with this.  My goal wasn't just to use UNet's basic functionality though such as SyncVars and NetworkTransforms, but instead just send Commands and use RPC Client calls to try and simulate a rollback system similar to GGPO -- I knew I wasn't going to get anything that sophisticated in less than a week, but I still attempted it for my prototype.
The main goal when doing this is that the local player should feel like their inputs are immediately respected and reacted to.  The problem with this is that when the player immediately changes state, this needs to be sent to the server and then to the opposing client.  Naturally, there will be delay, even if just a few frames and this needs to be dealt with properly.
This is where the currentFrame variable came into play.  My thinking was that I would record the frame when the player changes state, send it over the network and compare the opposing client's current frame with the received frame and then fast-forward that character that many frames.  This, surprisingly, actually got me decent results.  They were FAR from perfect, but I was able to get the game running over the network.  Note, I did this with a StateMachineBehaviour that called a Command upon entry depending on the state.
Most issues would arise when the two players would get out of sync; for example, if the delay was bad -- about 8 or more frames -- some attacks would not register on the opponent's side.  One reason for this could have been that, when I received the values, I wasn't checking attacks when doing the fast forward process; just fast-forwarding the character to make sure the positioning was accurate.  I also wasn't rewinding the entire game this many frames; something that could have resolved some issues.
Anyway, after only three days of focusing on the online aspect, I had something playable over the internet.  It wasn't perfect, but people were able to play the game on two separate machines with relative accuracy.


In conclusion, I learned a lot doing this prototype.  To be honest, I'm unsure whether or not I'll continue working on this, but the hope is that when I start a new fighting game project, I can carry over the lessons I learned from doing this.  I'd like to also try to use more of UNet's functionality to try and make the online components such as SyncVars and NetworkTransforms to try and make the networking more reliable.
In addition, I'm unsure that I'll be able to use this approach if I ever try to add networking to Battle High 2 A+, but it could be possible in the future.  My only issue is that because I'm using Unity3D's networking solution and am not a seasoned network programmer, that whatever work I ever do, especially in this genre where online play is highly scrutinized, won't be great.  This, however, does take practice and that practice will only come by making (and eventually releasing) games that try and utilize this functionality.
Anyway, if you'd like to play this game, you can download the build here: .  Enjoy and please let me know your thoughts.

Wednesday, May 25, 2016

Art Prototype Dev Blog 03: Tired of Attire

So, for the next part of my character, I decided I needed a bit of clothing.  Clothing usually hasn't been a big issue for me; however, there are a lot of aspects to it that can quickly make the pipeline I'm trying to develop rather challenging.
Essentially, I have a few options, which I explored:
  • Marvelous Designer
  • Use iClone Character Creator's clothing
  • Model Clothing from scratch
  • Find existing clothing

Marvelous Designer

I really liked Marvelous Designer at first.  It's a cool program for designing clothing; however, I eventually found, once the coolness wore off, that it just isn't really for games and it just really isn't that much faster because of the required knowledge needed sew clothing together.  In addition, it's expensive, and with 3D Studio Max having its own version of Marvelous Design built into it with Garment Maker -- with the caveat of it being far inferior -- I decided to pass on this program.

iClone Character Creator

One nice aspect of iClone's character creator is that it comes with a decent amount of clothing.  It doesn't have every type of costume -- martial arts, occupational, etc. -- but it has enough casual clothing that you could probably construct usable outfits for most things.  In fact, it uses Substance Designer materials to edit clothing.  I didn't really dive into this, but if I want to make a shirt with a certain type of pattern or decal, this probably wouldn't be that challenging.  The bigger challenge would just be making the textures -- an area I didn't touch yet because my texturing skills are rather weak.
My only issue is that the clothing is rather high poly, a pair of jeans being about 12,000 triangles.  Again, for a next gen. fighter, this probably isn't a big deal, but I still have the feeling I'd have to do some clean up in most other cases.
Another issue that came up is that this clothing will always look the same, so I probably will need to do some adjustment.  I thought to try and use Blendshapes to make the pants a little more baggy, this way, I wouldn't have to reskin the entire thing.  Unfortunately, because of an issue with smoothing groups, when the jeans were reimported, the smoothing groups were eliminated, making it look like something from Virtua Fighter.

Though interesting, that square, patch pattern is not intentional.

Modeling Clothing from Scratch

When I say "from scratch", I really mean one of two things.  One is modeling clothing from scratch, something I'll probably need to use from time to time for more complex attire; however, for some clothing, I'll sometimes just take existing parts of the mesh, duplicate, remove geometry I don't need, and boom -- I have a pair of gloves.  This technique isn't perfect for all clothing, but again, good for tight, form-fitting clothing or gloves.

Glove and inner sleeve made by just duplicating parts of the original mesh.  Needs texture work, but for an initial pass, works.

Find Existing Clothing

Since I'm making a fighting game character, I wanted to try and make an alternate costume.  I decided to try martial arts attire; however, I didn't want to spend hours modeling it from scratch, so I decided to look for one.  After failing to find one on Turbosquid, I found one on a site called CGTrader.  It had nice edge flow, and with some minor adjustments, I was able to use skin wrap to get it onto the character.  The skinning isn't perfect, but with the amount of modeling time saved, I could definitely spend a little time adjusting the skinning.  It was about $50, and it's not something I would want to do for EVERY outfit, but I think this approach isn't bad for when I need an article of clothing for a character quickly.

Untextured, but this took very little time to fit and skin; the arm pits verts need work, but in the amount of time it'll take to fix that, I'd probably barely have the pants model if I were to do it from scratch.

Again, the goal of this prototype is to see if making a character by myself in a short period of time (1 - 2 weeks) is viable.  So far it's shaping up to be.  Here are some of the biggest challenges I've faced thus far:
  • Hair!  I need to come back to this, but decided to take a break.
  • Closing gaps -- when working with clothing, a lot of it is open, but Unity culls faces based on the shader -- and not culling (making it double-sided) increases render processing -- so you get these strange instances where the inside of a sleeve becomes see through.  There are several techniques for preventing this, but it's a bit of extra work, and I wish I didn't need to do it at all.
  • Texturing.  I'm going to try and use 3DCoat to see if I can texture clothing in a way that doesn't make me want to abandon the project altogether.
  • Will it animate?!  Once I get the entire character's look figured out, I have to see if my biped rigging script will do it any justice, will the clothing deform in a way that looks decent, etc.?
  • Shaders -- I'm not sure if I should use Unity's built-in shaders or my own; however, one thing I learned from past projects, is that when figuring this out, you should do the textures simultaneously as some shaders will change the setup of you textures -- channels, normal map use, etc.

Tuesday, May 17, 2016

Art Prototype Dev Blog 02: Hairy Situation

So I spent the weekend working on the art prototype mentioned previously.  I decided to try and make a 3D version of this character that I concepted over a year (maybe two or even three) ago.

Why am I not a professional concept artist you ask?  This, this is why.  Now stop asking!
I'm serious about this prototype, so I even made a spreadsheet, splitting up task.

I was pretty excited, getting a pretty decent body and face done in iClone Character Creator relatively quickly.  I knew it wasn't going to look exactly like my concept, but I had the major components figured out.

I did learn that iClone Character Creator spits out a lot of textures, at most four -- diffuse, spec, normal, and alpha -- per part:
  • Head
  • Body
  • Eyes
  • Transparent Layer of Eyes (which I'm tempted to remove)
  • Upper Teeth
  • Lower Teeth (which aren't the same size as the upper)
  • Tongue
  • Fingernails
  • Toenails
  • Eyelashes
This is one aspect of iClone I like over Mixamo Fuse.  Fuse has less textures, but you still had to make multiple materials since the eye lashes -- which needed transparency -- were on the body and face's texture.  I'm pretty sure using cutouts would have sufficed though.  Anyway, I wrote a script to make one texture's alpha channel the red (or any channel) of another texture.  This is important because if I plan on using Unity 3D's built in shaders, they require the alpha channel to be utilized.  For diffuse textures, the alpha is used for transparency; in the specular (or metallic) it's used as the texture's smoothness.  This is how the character looks in Unity3D after playing around with various work on this:

The top image is how the character looks with the built initially exported spec map, which has an alpha of 255.  It's extremely reflective and unnatural.  I lowered the alpha to 64, resulting in the lower image, a lot less reflective and smoother.

After getting the base model figured out, I, instead of doing clothing, decided to try my hand at hair...which quickly made me think...

At the same time, it made me realize why so many games have bald or short-haired characters.

Anything else is expensive -- whether that's the amount of time needed to create decent looking hair or the rendering power needed to deal with the transparency created by using the alpha plane technique.
It was also at this time that the hair in most character creators -- Fuse and iClone CC included -- are just not amazing.  Don't get me wrong, they are much better than I could make as I soon learned trying to make my own, but they just feel lacking compared to other games.
For myself, the problem is that there are a lot of different ways to do hair and a lot of the tutorials I found were for rendering realistic hair for animation, not games.
So, for my situation, here are some possible solutions:

Use What's Out There

Fuse and iClone do come with some hair, and, though I don't love it, it is usable.
"Messy" hair exported from Fuse and put on my character with minor modifications.
I could probably take this hair and manipulate it enough to get various styles.  There are also stores and other resources out there I could use to find new hair.

Learn to Model Hair

As I mentioned previously, there are dozens of tutorials out there.

These are just two of many that differ on skill, time, programs, etc.  I tried modeling my own, but I think I came across a bigger problem:  My concept isn't really complete.  It's just a single pose of the character.  I think, because I knew I'd be using a character creator, that thought I wouldn't need a character sheet with front, side, and back views; however, because the hair is rather atypical, I should have clarified it.
Because this is a prototype -- and because I was in a bad mood pulling my hair (and his) out -- I decided to just use Fuse hair to improvise a new haircut.  This is what I came out with.  I'm still not in love with it; from some angles it looks odd.  The biggest problem I discovered is that rendering hair is rather difficult.  It was particularly frustrating because in Fuse, the hair looks fine, but they are using a unique shader that isn't built into Unity.
Not only does this need specular adjustment, but there is odd Z-fighting, particularly at the front bang
Despite my efforts creating various shaders in Shader Forge, I still couldn't quite get the hair to look right.  Fortunately, I was able to find a shader in the Unity asset store, Advanced Hair Shader.  I had to get a version compatible with Unity 5; fortunately, the developer was very quick to respond to my email.  Though, despite getting a good version of the shader, I still wasn't feeling it.

The parameters need a lot more adjustment, but the Z-fighting is gone at least.
As I continue these characters, I'm going to avoid using alpha transparency in my hair.  It'll probably require more triangles in the meshes, but I think it'll create a better look overall, especially for the more cartoony, bright look I'm going for.  Also, when working in Unity, I try to prevent myself from fighting with the engine.  I'll either make a workaround -- as in with using my own simplified physics solutions -- or work with the engine.  It obviously doesn't work great with alpha transparency, so I'll avoid using it when I can.  I was also having some luck using muscles in 3DCoat to make hair -- retopologizing was inducing some rage though -- and I want to explore that further and see if that can create nice, sculpted hair.  I know I can't use that for everything, but it's worth a shot for sure.Overall, I hit a bit of a bottleneck in the character creation process.  I should have probably done attire instead of hair.  Admittedly, attire will create similar problems and have its own questions like how do I close gaps?  Do I use clothing provided by Fuse or Character Creators or use Marvelous Designer or something else to make clothing?  The most challenging part will most likely be tying all the parts together, making them coherent and consistent, but I'm going to keep trying -- at least for a bit before finishing the next Battle High 2 A+ character, Beat.

Thursday, May 12, 2016

Art Prototype Dev Blog 01

So for the last month or so after pausing Project Merfolk and besides new character work for Battle High 2 A+, I've been trying to work on improving my art skills and my art pipeline.  I wrote a script to convert any rig to the 3D Studio Max biped

I then did research and experimentation with various other programs such as iClone, 3DCoat, and Marvelous Designer, all with the goal of becoming a better and self-sufficient artist.  I've been wanting to start a new project, but since I've been doing all of this art exploration, I thought that it would be a good idea to, instead of making a gameplay prototype, make an art prototype, a prototype of the way the art in my game would look and feel.
This is an important step for my next game, regardless of what it is, so I'm going to start this now.  I'm going to do it live!
Well sorta...and with a lot less anger

The first thing I need to do is determine the look I am going for.  There are several ways to go about this.  One is to determine my strengths and weaknesses.  I know photorealism is definitely not an option.  It takes too long for me, and there are certain skill sets that I don't possess and would take way too long to try and develop -- high res sculpting, complex retopology, etc.  Another tool to help with this is to develop a style guide; from what I know, a style guide is similar to a game design document, but focuses solely on the visuals of a game and usually done very early in a game's production.
I'm going to develop the style guide for the look of characters for my next game, Cupkick.  The first part, is on a scale from realism to cartoony, how do I want the characters to appear.  The following image shows a character made in iClone Character Creator.  It uses the Slim morph -- one I find rather cartoonish and like -- and ranges from no (0%) influence to 100% influence of this morph.

Based on this morph, I want something a bit higher than 25% but not any more than 50%.  The game is going to be a 3D fighter, so characters will be a big focus.  I like this range because it's not 100% realistic, but the 100% is a bit too cartoony and looks weirdly unnatural.  This could be due to the use of a realistic texture on a cartoon-proportioned model. (Note, I'm going to edit these textures before using them in game.)  Regardless, the previous image is just one of many types used in a style guide.

Another part done for style guides is just the use of finding existing work and stating what aspects you want and what aspects you don't.  Here are some games I'm looking at for influence:

Team Fortress 2

Though not a fighting game, TF2 has a unique style that has many aspects I like such as strong silohuettes -- important in a figthing game to help identify moves and simple yet bright colors.  One aspect I don't like is that the proportions are a bit too on the cartoon side for what I'm shooting for.

Dead or Alive & Tekken

I've been a big fan of the Dead or Alive and Tekken series.  I do like the way the characters look.  There's an anime influence in their faces; they aren't realistic so they avoid an uncanny valley look, but they are still strong.  Also the game is bright as a whole.  The negative takeaway is that the world and shading as a whole is a bit too realistic and sometimes silhouettes can get lost.

Marvel Vs. Capcom 3


I really like the graphic style of Marvel Vs. Capcom 3.  The characters are a great mix between realistic and comic style.  The graphic style is a bit too harsh and flashy for what I'm shooting for, gameplay elements can get lost sometimes.

Super Mario Galaxy

Super Mario Galaxy is a bit too cartoony for what I'm shooting for; however, there are aspects of the game's looks I'd like to capture, particularly its cleanliness and bright colors.

Street Fighter V


It's contested, but I think SFV is a great looking game.  The character models, though not all beautiful, are great because they have strong silhouettes.

So, comparing these, I sorta want the following in my game:
  • Bright colors
  • Easy to discern silohuettes
  • Slightly unrealistic characters
And here are some elements I don't want:
  • Comic book style / harsh outlines
  • Photorealistic graphics (in characters AND environments)
  • Cartoony proportions
My biggest issue, of course, is that achieving this level of art fidelity on my own is going to be very difficult (if not impossible).

So what is my goal?

My goal is to create one character from scratch for this game with the following goals in mind:
  • Determine how long creating a new character will take; for example, if it takes 2 months for one character, this is way too long, and obviously i need to invest in other avenues to create characters.  
  • Develop and polish a pipeline for creating characters
  • Achieve the look of the characters I am developing
  • Have something more visually appearing to show off early to gain excitement
I mention the last one because I've felt for my previous prototypes that because they usually have prototype are or look boring, usually get ignored or I get little feedback on them.  I want to see that, if I start with stronger visuals first, that I can get more interest in what I am working on early.
In addition, here are some other, more specific questions I want to answer:
  • How am I going to do hair?!  I like planar hair, but it usually takes a long time to model.  Can I find a starter base asset somewhere and work with that?
  • Will the iClone Characters be good enough?  Too high poly?  Too recognizable?
  • How will I do clothing?  All iClone?  Marvelous Designer?  Model from scratch?
  • What shader / materials will I use?
  • Will these characters run well in Unity3D? On Xbox One?  On PC?  On mobile?
Anyway, this is just a short blog post about what I'm working on next.  Hopefully I'll be able to show progress as I continue working on it and smoothing out the pipeline.

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



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
        bool initialized = false;

        SkinnedMeshRenderer smr;

        public Transform newSkeletonRoot;

        string originalRoot = "";

        string[] originalBoneNames = null;

        void Awake()
            initialized = false;

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

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

                if (newSkeletonRoot == null)

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

                        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]);

                    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!

Thursday, March 24, 2016

Struggling With the Social Media Spiderweb

I'm working on a new project, which I've been posting about at a variety of locations:  Twitter, Tumblr, Facebook, etc.

The issue I'm having is that it's just so MANY different places.  This essentially is all of the areas I can post things about my work:
Even worse, there are probably 100+ social media sites I'm completely unaware of.  Maybe this isn't too much for some, but for one person, it gets pretty daunting, especially when the information being posted feels redundant at best -- queue the spiderweb metaphor.

The social media spiderweb! (or a real one)

I guess my one question is, how can I do this more efficiently?  Here are some ideas:
  • Twitter
    • Post messages and/or images
  • YouTube
    • Post videos
    • Put video links on Tumblr
    • Also post link on Twitter with an accompanying .gif made through Giphy (which I just discovered and is pretty great for.gif making)
  • FaceBook
    • Post links to various tweets and videos
  • Forums
    • Make unique posts / thread, but use information posted on Twitter and YouTube
This leaves two things sorta untouched.  One is my personal website.  I haven't really touched it since I made it using a free WordPress theme awhile ago.  I'm tempted to remake it using a premium theme, but filling in content is still tough.  I could abandon this blog and post everything on my personal website instead, making it a portfolio site as well as a game development blog; however, maybe it'd be better to separate them as I sometimes get a bit "feely" on this blog.


Anyway, this is something I'm still sorting through as I work on my next game (and hopefully the new Battle High 2 A+ updates soon).