Nightcycle Studios 11/8/2020 "Weekly" Update

Sooo, this isn’t Monday. I think it’s technically Sunday. That means I’m both a week late, and a day early!

Confused applause

But let’s get down to business - what’ve I been up to? Why did I wait an extra 5 days to post? Well the gist of it is I was working on something really cool and it wasn’t ready 5 days ago. To be honest it was ready 2 days ago, but I got distracted and here I am on Sunday at 1 AM. But I’m really excited to show y’all my progress!

IK Improvements
I rewrote part of the IK engine to get it to adjust clipping limbs in a more natural way. This means that when a character’s running and they sink closer to the ground for a jump, the feet stay above the ground! It just works now, and I think I can safely say I won’t have to bother myself with limb IK for another few months (not counting adjusting for different character scales).

Procedural Hair
So, I realized at one point that the way Roblox - and many games - do hair is quite silly. It’s more like selecting a hat then actual hair. I’m an indie developer with limited time and budget - I can’t necessarily make or buy 40-50 custom hairstyles. I need a systemic solution that allows me to visualize a ton of hairstyles with limited assets.

On top of that, even if I could buy a bunch of preset looks, I doubt I’d ever be able to get all the looks in that people want. There are legitimately over 1,000 hair assets in the Roblox catalog - and yet UGC creators keep pumping them out. That’s because with preset looks you will never have all the variants your community wants. Imagine if instead of making SHL a custom superhero game, I just spent all my time making 1,000 custom heroes for you to play as? It’d take a lot longer, and tbh you probably wouldn’t like it as much.

No, I need a hair solution that I can easily implement, polish down the road as I get more time, and will provide my audience with the most control over the look of their character.

image

So, I took a day and learned how to use blender. The next day I made a general hair strand asset, composed of 136 triangles. I then procedurally planted 41 of these strands onto the scalp. This meant that the hair in total was composed of 5166 triangles - half the triangle limit for a single custom mesh on Roblox. It was looking great - and so the first hair 2.0 was born.

image

Isn’t it beautiful? In all seriousness though despite technically being functional, it required a good bit of tuning before it looked like a haircut anyone would want.

image

After cleaning it up a bit we had something that actually looked like hair! Problem is though the only look you could achieve with it is someone who has a ton of hair product in, because it refused to obey the laws of gravity in any sense.

2SEkniYokb

So, after messing around for a bit I got it to guide strands towards the direction of gravity. What you’re looking at isn’t actually a real-time simulation though - it does this calculation once at the beginning. The reason the hairs look like they’re falling over multiple frames is because I have it apply this calculation to the hairs iteratively through the Lerp() function for CFrames.

This hair still had a ton of problems though, while it was cool enough to receive praise on twitter it was certainly not game ready.

image

All the hairstyles were having this bald-spot on the back of their head. This was due to how I was placing the strands.

Here is a debugging visualization of what was happening every time I placed the strands. It was a bunch of raycasts made onto the head from orbit, and unfortunately it didn’t think much about how to avoid gaps in the hair-line. So I adapated!

A smart person, who I don’t remember, but if it’s you thank you, once talked to me about how the No-Man’s Sky developers mapped out landscape by generating it onto a cube, then mapped each cube surface onto a sphere. If it sounds familiar that’s because it’s how pretty much all textures work on meshes at a high level. You can see an easy visualization of the effect by applying a decal onto a ball part. You’ll see it stretches the image to cover the entire surface - I was going to do that for the scalp map.

image
image

Here are the results! The scalp gaps were almost completely remedied, with only really short hairstyles revealing them. Most medium length hair though now covered perfectly fine - so much so I was actually able to increase strand size a ton, reducing the amount of parts needed, as well as creating a hairstyle that better fit the level of detail of the overall character. These new haircuts felt almost intentionally designed - like you could see the lower one on the catalog with a name like “Old Man Charlie” or something.

However at the moment, I could only really use gravity to style the hair - what if you wanted your hair to go up in certain areas, and down in others? So I added a new aspect to the hair creation formulas - styling intent.

image

Here’s the result! Not only do I think this looks like hair, I’m pretty sure I’ve had this exact haircut a few times. With the styling intent additions, I could specify the length and intended direction of hairs across programmable sections of the scalp. With this I could handle almost any short hairstyle.

I wasn’t done yet though - I’d already done 90% of the work needed to get a real-time hair physics thing going, why would I stop? Through some restructuring I applied the hair simulation every frame, allowing me to feed in stuff like character momentum, air resistance, as well as some noise to add variations over time / slight flapping at faster speeds.

minihairdemo

So I had it! Hair that would actually react to your movement! This technology means many awesome things are to come, ranging from more dynamic outfits like the inclusion of dynamic capes, as well as obviously a potentially infinite number of hairstyles.

Are You Done With Hair?
Well, one issue that comes up for mid-back length hair is clipping, especially around the shoulders. The same thing happens with bangs on occasion. In order to avoid this I’m going to need to run a quick clipping check on the strands without slowing down things too much. In order to do that I’m going to define a handful of spheroids (spheroid = ellipses in 3D, ellipses = stretchy circle) to be designated as tangibility zones - meaning the hair wouldn’t be allowed within it. This will allow me to do a quick adjusted radius check for each bone in the strand - no need for any heavier physics or hundreds of raycasts per frame.

I’ve actually already accomplished this part, the problem I’m facing right now is how to redirect the hair once it’s in violation of a no-go zone, so this week my hope will be to accomplish this - though to be honest I might also just delay it for a later version of the game. Like yeah it’d be nice, but avoiding bang clipping can also be down by just applying certain styling intents on the player’s end of things. Same with most clipping honestly - if I don’t figure it out within a few hours this will like be the fate of it. This isn’t to say I’ll never do it, but rather it’s not an important enough thing to polish to warrant me spending another week on it - I have other things to do.

Instead, next week I’m going to focus a bit on adding a hair-tie option - this shouldn’t take more than an hour or two. I also want to import a few other minor hair-strand options for people with curlier hair + a basic super-short hair mesh for, well, super short hair. After that though I have other fun tasks ahead.

ezgif-7-0f013d772968

One final thing worth including, here’s a hairstyle since dubbed by the community as “Bacon 2.0”.

What’s next
Next week I want to take on capes! I first tried to make a dynamic cape in 2018 but lacked the technical ability to do so, based on the hair simulations running great I’d say cape physics are perfectly possible! I also want to throw in some stuff like emblem placement on bodies - all that kind of fun attachment based stuff I can create by evolving the hair technology.

The next big thing on the plate is character scaling, allowing for different body types, as well as larger/smaller avatars. This will be a lot of math but should be doable. It should also be really cool to watch.

By the end of the week I’m hoping to also make some more improvements to the actual avatar response time to controls. Currently it still delays a bit when doing a 180 turn, and struggles doing that turn when stopped - I want to change that. It shouldn’t take more than a day, and once done I think we’ll be in a really good place with the avatar.

As well as the previous items, this week I’d love complete the mobile port, as well as add a first person mode! These shouldn’t take toooo long, as I’ve already added some of the groundwork for them in pre-existing systems. Due to having full control over the body IK, I’m thinking first-person mode will be pretty easy. I can just use IK to mirror the camera’s movements, which should allow me to look down at my own avatar while in first-person, that’ll be exciting! I think the core of SHL as a series is fantasy, and what’s more immersion heavy than a first-person mode?

If I’m lucky - and I’m already asking for a lot this week - I’ll be able to get some face stuff added. We’ve been working on it in secret for a bit, trying to make sure it doesn’t go too far into uncanny valley. It’s no easy task, and it’s also not set in stone -it’s very possible we get a lot of negative feedback from whatever we make, and have to return to square one. But this is why we test, this is why the 0.1.0 release coming up is private to testers only, because nothing has been proven as ready for the public yet.

0.1.0 Release Date
So, you wanna hear something miraculous? The release date is still November 23rd!!! After 15 days of work, I stayed on schedule! The new task organizer I spent a few days setting up seems to have really helped me out. I can quickly adjust estimates, add new areas, delete old stuff - I can even do it on my phone! It’s been super helpful for keeping things flexible, and staying on track for a 11/23/20 release. A date which, I just realized, is as far in the future as the previous blog post is in the past. This is going to be here before we know it!

In case y’all are wondering, 0.2.0 is all about character customization - something I am very excited for. It’s also not going to be as heavy an update meaning instead of taking me 3-4 months like 0.1.0, it’ll be done in 1-2. I haven’t actually done any of the task estimates yet though so please don’t hold me to that.

Until next time!

11 Likes