Working remotely, ragdolls and root motion

Home / Uncategorized / Working remotely, ragdolls and root motion

One of the unexpected perks of working on your own project is that I’m no longer limited to work from the same place. My wife is a teacher and she gets very long Summer breaks, so we decided to spend the last months in Quebec city, her hometown, to be closer to her family.
So 
for the first time, I’ve been working remotely on Twelve Minutes and it’s been quite a new experience.

As a 3D artist I need to be able to draw, paint and sculpt digitally and to do so, we use graphical tablets. At home I have a Wacom Cintiq monitor that allows me to draw directly on the screen surface with a pen that has pressure sensitivity.
Up until very recently, if you wanted to do the same and be portable, you were out of luck. Some alternatives have been showing up, like the Surface Pro, but without really focusing on artists, with the usual issues of lack of proper pressure sensitivity, matte screen for outdoor lighting conditions, thick border for hand placement and worst of all, missing exterior buttons for keyboard shortcuts.

Fortunately, Wacom finally decided to step into that market and about a year ago release the Cintiq Companion 2, which I’ve been using since I’m here in Quebec and have to say…I’m impressed.
It can’t rival a desktop computer in terms of processing power, (something that explains why the gifs I generated for this post are so choppy) but it’s more than enough for me to work, and once connected to a second monitor I sometimes forget that I’m actually on a laptop. Here is my current setup as I write the blog post:

MobileSetup

If you are in a similar situation, there a few extras that I found crucial; A proper Bluetooth keyboard that allows you to type comfortably, an adapter with extra USB ports and a Ethernet port, an HDMI cable to connect to that second monitor and finally a proper stand.
The one that ships with the
 Companion is terrible but luckily, someone decided to fix that problem and created the awesome FlipSteady case/stand that I got just before arriving here. It has a strange folding design that kinda organically adapts to whatever angle you need, even allowing me to draw on my knee or another irregular surface. Never seen anything quite like it and love it so far.

FlipSteady

 

Now for the actual game development, as I mentioned previously, I’ve been going over all the features that were just drafted mock ups and adding the proper structure so they can be further built upon by me as well as external collaborators. During this process I’m often finding that what originally looked like a small issue, turns out it needed a lot more work than expected to be properly implemented.


One of these issues is how characters interact with each other in such a confined space. There is little room for broad movements, like when characters get handcuffed, and my rough solution for the prototype was to manually snap both actors to a defined valid location, where I was sure they would have enough room to play the animation without clipping with the furniture:

Handcuff_SnapActor

 

To fix the problem above, my idea is that the cop grabs the actor, gets him in a arm lock and then takes him to a spot where he will finally handcuff him.
The first challenge was to create an automated way of finding the closest available floor space for an actor to fall down without hitting anything. In the image below you can see the ‘floor reference’ shape. The big red rectangle is the space needed for the actor to fall down without hitting anything, the small square on the top is where the actor doing the handcuffing needs to be and the second smaller rectangle on the right is where someone would go to in order to interact with a fallen actor.

FloorRef

With these constraints in mind, I created a system that automatically looks for the closest available space for this ‘floor reference’ as well as taking into account other already placed ‘floor references’ (e.g. the wife is unconscious on the floor). Also notice the green slabs on the doors frames, those are also considered invalid areas, so that no one falls between doors and then it looks weird when the are open/closed.

ValidFloorRef_Others

And here is how the whole action currently plays. It’s still kinda robotic between motions since the animations are placeholder and I’m just focusing on the system, but once final it should read pretty nicely.

Handcuff_New

There are still rare cases where an actor needs to fall immediately, with no time to look for a floor reference, so for these situations, a ragdoll system will still take over, but hopefully will be used as little as possible.

NotLikeThis

Another challenge is natural character movement in closed spaces. The pathfinding system calculates the best route between two points but it doesn’t care if it’s moving a car, a person or a box, it just slides the object through the valid path towards the destination.
For the prototype I would just calculate the speed of the actor and apply a walking animation (e.g. the faster the speed, the faster the walk animation) but no matter how much I tweak the animations or values, the actor will always slide while moving. Even worse is turning while moving, making a strange rotation walk that I can’t make a custom animation for. You can see the issue below the moment both actors start walking:

Walk_Slide

When moving in small spaces we usually turn on the spot, before starting to walk, to make sure we don’t hit anything. To implement this kind of system, I decided to let the root motion of the animation drive the actor movement while still following the predefined path. This way foot placement is perfect while walking and turning.
I’ll need to do a few more animations to cover extreme cases and it still needs further tweaking (as usual these are all temp animations) but it already feels more realistic than the previous version:

Walk_Turn_Low

 

Over the next weeks I have two other major tasks to fix. One is actors picking/dropping objects in the world, and the other is interactions with doors.

At the moment, picking and dropping objects happens immediately without any actual contact with the world, making it feel very fake, so I need to setup an IK system where the hand actually interacts with the object it’s trying to pick up. This also means that these small actions will now take a few seconds, pilling up on how long everything takes, which might affect the gameplay and pacing.
As for the door interactions, I have a feeling I’ll write a whole post about it in the future. It’s always a challenge due to all the possible combinations you can end up, like like what happens if two actors try to open the same door from opposite sides, or someone closing the door on your face, etc.

Once these are complete, I can go back to playing the game and focus on design without having to worry about the code that holds the gameplay and above all, know that I have a solid layout for the other people to join in, in this case the writers and animation team!

 

Comments(0)

Leave a Comment