For all Unity developers and developers-to-be, both beginners and professionals!

Report article RSS Feed Folk Tale Dev Blog 20

We're making solid progress in the 0.2.x release cycle, and today we're able to take an early look at two major improvements in the pipeline. We have a working Player breathing life into custom maps designed in the Editor, and Character Studio where we can experiment with character randomization.

Posted by GamesFoundry on Mar 21st, 2014

We're making solid progress in the 0.2.x release cycle, and today we're able to take an early look at two major improvements in the pipeline. We have a working Player breathing life into custom maps designed in the Editor, and Character Studio where we can experiment with character randomization.

Sandbox Player

One of the key requirements for Patch 0.3 is the ability to play a custom map designed by us in the Editor. Internally we're now able to run Sandbox maps and test dynamics including character movement and construction. Testing pathfinding is particularly important as we've deprecated the memory inefficient grid based graph system in the Tutorial and developed a faster Tile-Based Navmesh system that supports updating during gameplay.

User Posted Image


Developing a new pathfinding solution helps reduce the overall game footprint in addressable system memory ( reduced probability of a memory related crashes on marginal systems ), while making path calculations faster ( better frame rate ).


The blog video demonstrates a test case of running one group of villagers over a bridge while the other group run under it. This wasn't possible in the Tutorial ( anyone notice the rubble blocks in the Old Forge blocking access to the ramparts above the portcullis entrance? ), but for Sandbox it opens up lots of design options.


Character Studio
One of the frequent pieces of feedback we received following launch ( particularly in Let's Play videos ) concerned all the villagers looking like drones. Given that a major feature of Folk Tale is the detail of the lives of your Villagers and the adventures they become involved with, it's important that we give them an identity.

In the Sandbox Vision Presentation I explained why it wasn't possible to achieve full RPG level of visual customization due to memory constraints ( GPU texture memory and overall system memory ). Instead, we set out to give each villager a unique face, and show their currently equipped hand items ( tools and weapons ). In Dev Blog 10 I highlighted early development on facial customization, and since then we've expanded the customization system into something that is usable and will be included in Patch 0.3.


User Posted Image


There's a lot more going on under the hood of Character Studio than first meets the eye, specifically to address technical objectives:


Minimal Memory Footprint

We've designed the character system using minimal base geometry and a single hair/skin texture to keep memory requirements down. We have one universal skeleton for all humans, two master head models - male and female - and a number of uniforms. We have a range of hair styles, eye brows, and facial hair, that we'll continue to add to throughout development to add more variety. All the geometry is combined at runtime into a single skinned mesh with just two materials: one for the uniform and one for the skin and hair, both of which are color tinted separately in the shader.

Performance

The more bones included in the skeleton the longer it takes the CPU to calculate the position of each vertex in each frame of animation before sending to the GPU, and that means lower frame rates. To achieve both a unique appearance AND good performance, we're baking appearances and then removing the influence of certain bones ( e.g. facial bones, 2nd-4th fingers ), reducing the bone count down from 140+ to around 60. This wasn't something we did in the Tutorial, and should achieve a performance boost.

Baking appearances does mean character faces won't be animated during normal gameplay, but will be during cinematics where facial animation can add a lot of emotion. We have implemented bake quality, so it might be possible on higher specification systems to enable facial animations during gameplay. It's something we'll be exploring after Patch 0.3 but is not something we're committing to at this stage.
Combining multiple meshes ( head, hair, facial hair, eye brows, uniform, exposed skin ), optimizing out bones and baking into one skinned mesh at runtime needs to be extremely fast considering how many characters we have and the possibility for changing weapons and tools, so we've invested time up front in optimizing the process. From very early proof of concept code taking 500ms per bake, within a matter of hours it was reduced to under 2ms. That means we can bake several characters at once ( for example when new villagers are created ) without significant impact on frame rate. In reality this only happens a few times every minute, or when hand-held gear is swapped out, so we are well within acceptable performance targets.

Universal Skeleton

Having a universal skeleton for all human characters means we can play any human animation on any human character. For example we can have men walking like women, but that's not the real use. The main strength lies in how we implement weapons. We're creating combat animations around weapon types: one-handed, two-handed, and dual wield. A pitch fork and halberd are somewhat similar in that they are held with two hands and look perfectly acceptable using the same combat animations. A sword and mace are also similar and can use the same one-handed combat animations.

In a game with lots of buildings, lots of characters, and lots of weapons, there's lots of creativity and trickery required in striking a balance between the quantity of assets and achieving an acceptable quality and accuracy of animations. The hard constraint of memory means eventually you hit limits, and you can't increase one without reducing the other.


User Posted Image


While we only need randomization, baking and bone optimizations working for Patch 0.3, beyond that there's lots of potential for Character Studio. Here are just a few low-priority ideas we'll be considering at a later date:

  • sharing configuration text strings with others in the community forum to recreate characters;
  • naming and adding personality traits for inclusion in your games ( e.g. if you always want Henry The Coward to be one of your villagers );
  • uploading NPCs to Steam Workshop.

Art Assets - Characters
We're keeping up character production momentum with the addition of the male and female Peasant, Woodcutter and Baker. They Peasant and Woodcutter follow the visual style established in the Tutorial, but remade to fit the new customization system while standardizing the look of the villagers.

User Posted Image


User Posted Image


User Posted Image


Art Assets - Buildings

Three more sandbox-spec buildings are finished ready for inclusion in the next patch: Stonecutter Lodge, Storehouse and Tavern. With the Sandbox Player advancing at pace, the next step is to enable Resources ( Logging Camp, Iron Mine, Stone Quarry ) and early stage Sandbox gameplay ( resource collection and processing ).


User Posted Image


User Posted Image


User Posted Image
 

Post comment Comments
MrEmjeR
MrEmjeR Mar 21 2014, 5:52pm says:

This game is amazing :)

+2 votes     reply to comment
Post a Comment
click to sign in

You are not logged in, your comment will be anonymous unless you join the community today (totally free - or sign in with your social account on the right) which we encourage all contributors to do.

2000 characters limit; HTML formatting and smileys are not supported - text only

Established
Oct 31, 2010
Privacy
Public
Subscription
Open to all members
Homepage
Unity3d.com
Contact
Send Message
Email
Members Only
Membership
Join this group
Group Watch
Track this group
News
Browse
News
Report Abuse
Report article
Related Games
Folk Tale
Folk Tale Indie Single Player 4X
Related Engines
Unity
Unity Commercial Released May 30, 2005
Related Groups
Indie Devs
Indie Devs Hobbies & Interests group with 1,092 members
Unity devs
Unity devs Hobbies & Interests group with 1,174 members