Little problems in Dynamic Hair making (1 Viewer)

SyntaxTerror

Content Creator
Joined
Jul 24, 2014
Hello

I am trying to make hair ornaments with dangling parts (laces, balls, etc.) using the dynamic hair templates.
I used a dynamic hair mod from Dante to start (because Kona's templates need to be edited to work, i.e. there is no specific templates for Dynamic Back, Top, Under) and managed to make something, but I still have some problems:
When I put only one layer (the flower) everything seems OK, it is not deformed and the top damping value set to 0 (the minimum)makes it not move at all.
But when I add layers (for the balls), the flower and balls (but maybe the bottom one) are deformed, and the flower moves like the balls, that have a damping value set to 1 (the maximum).
/*
* Damping
* Movement amount multiplier. Smaller numbers mean the hair moves less.
* Range: 0 - 1. Default: 0.595.
*/
var damping:Number = 1;

/*
* Top damping.
* Additional damping multiplier for the first hair section.
* Useful for hair strands where the top needs to stay fairly still.
* Range: 0 - 1.
*/
var topDamping:Number = 0;
dynamic-test-png.59456

Can someone please explain me what I did wrong?
Here is my FLA: Test - Flower.fla
[EDIT] attachement removed
 
Last edited:

stuntcock

Content Creator
Joined
Jun 5, 2012
When I put only one layer (the flower) everything seems OK
The ultimate problem here is "SDT hair physics is a big undocumented pile of madness." The proximate problem is that "you've setup one of your Shapes incorrectly."

The origin (i.e. pivot point, fulcrum) for each shape should be near its top. There's internal code in SDT which measures the "height" or "length" of each segment by tracing downwards from its origin point to the bottom-most visible thing within that shape. If the origin point is at the bottom then the segment will be assigned a very small length, which screws up the physics calculations.

More importantly: SDT will rotate each shape around its pivot-point during gameplay in order to present the viewer with a contiguous hair-strand. I notice that you manually shifted the pivot-points in Flash, but SDT does not care about such adjustments. It respects only the origin point of each shape, and implicitly uses that as the pivot-point.

You can deliberately "make mistakes" in the origin point assignment in order to achieve different effects. I shifted the origin points downwards in the Adagio hairstyle to create a more "bouncy" rotation. But - to repeat a favorite phrase of college professors: "you need to understand the rules in order to break them properly." It's much easier to tinker with these things after you've gained experience by animating a few "ponytail" type hair strands.

There's a second potential problem here: it seems like you want the flower to remain perfectly still while the balls dangle and bounce around. If so, then the simplest answer is "setup the flower as a static HAIR element (or HAIR_COSTUME) which visually overlies the DYNAMIC_HAIR strand but which isn't actually dynamic at all." Doing so would make the topDamping stuff unnecessary. You'd then be able to adjust the damping value in order to achieve the desired amont of movement in the dangly bits.

However, I'm not 100% sure that you want the flower to be immobile. For now, I've simply adjusted your shape origin-points in order to make the SDT physics code perform properly.

Test - Flower (Edited).fla

damping topDamping
These variables are disappointing. They seem useful at first, but there are very strict limits on "what you can actually accomplish" by using them.

If you find yourself interested in experimenting with dynamic hairstyles then I'd be happy to introduce you to the extended hair physics mod. It suffers from the same problems as vanilla hairstyles in terms of drawing shapes, slicing them to segments, and laying them out (i.e. it's a big ordeal with many opportunities for time-wasting mistakes) ... but once you have a set of shapes on the canvas, it allows you to make them dance in more interesting ways :)

By the way: you don't need to give names to the shape instances. Unlike vanilla-template loading (which relies on magic words: "rightThigh", "chest", etc) SDT doesn't care about the names of hair segments. It processes them geometrically in a top-to-bottom order.
 

SyntaxTerror

Content Creator
Joined
Jul 24, 2014
the simplest answer is "setup the flower as a static HAIR element
I tried this actually, but the balls were deformed and didn't reach the flower. In fact, I wanted to speak of this, but I have redone all the mod in the mean time and forgot to mention it here...
By the way: you don't need to give names to the shape instances.
I did this for myself (and eventually other modders that could look my work), not for SDT. I've seen that Dante didn't gave names to most of his shapes.
I am still quite a big noob with Animate, I haven't experimented much with it and still do not know the exact purpose of many things, like the difference between clip and graphic for the symbols, nor what symbols are really used for.
I notice that you manually shifted the pivot-points in Flash, but SDT does not care about such adjustments. It respects only the origin point of each shape, and implicitly uses that as the pivot-point.
The use of pivot points is also quite obscure to me: maybe the problems I mentioned come from the fact that I didn't choose the right place for them when creating the symbols (center-top), and I tried to move the shape to put them in the right position, instead of making new symbols...
For now, I've simply adjusted your shape origin-points in order to make the SDT physics code perform properly.
Thank you, but actually I forgot to save before uploading my FLA, so you worked on an older version of the file (i.e. not the one shown on the example pictures).
I'll try later to redo completly everything using your edited mod and your advices to make something better (now it's time for me to go to bed!).
I need to tinker more with Animate to make better things. At the moment, I can only draw without having too much problems with the vectors and the nodes (this was horrible for me at the beggining).
 

SyntaxTerror

Content Creator
Joined
Jul 24, 2014
stuntcock stuntcock : I tried with a real reference and tinkered with the number of symbols and their sizes:
OkRhBRz.gif
It seems that the smaller are the symbols, the more they are "compressed", in height, but also in width (here, the right pendant is the same as the left one, reduced in size). It can be a problem with geometric shapes, but for natural objects like flowers, the distortion can be unnoticed.
Symbols seem to be also disformed by the movements. I think that konahion did this on purpose to have more natural movements of the hair, but when it is applied to solid objects, the result can seem strange.

Another thing is that the top of the first symbol needs to be put a little higher on Animate to be placed at the desired position in SDT:​
P68AN9i.png

For this mod, I use the Headwear template for the flower, so it is above the Dynamic Hair Top template used for the dangling thingy, and it allows to eventually add two RGB sliders.

I was surprised of the distortion of the symbols at first, but if there is nothing that can be done about this, I'll deal with it and manage to make something acceptable with a few more tries than usual.
 

stuntcock

Content Creator
Joined
Jun 5, 2012
Symbols seem to be also disformed by the movements. I think that konahion did this on purpose to have more natural movements of the hair, but when it is applied to solid objects, the result can seem strange.
Yes. I would classify this as a "known issue". I found it unacceptable when working with rigid metallic elements (e.g. chains) -- although in my case I was bothered mostly by stretching rather than compression.

The dynamic hair extender mod allows you to correct this issue by adjusting the dimensional elasticity of the segments. You can retain the default values (for normal hair), increase them (for rubber/slime/whatever) or reduce them (for metal/leather/etc). You can also tweak the numbers on a per-segment basis -- in case you have a single rigid ornament woven/sewn into the middle of a long flexible strand (of hair, fabric, etc).

Another thing is that the top of the first symbol needs to be put a little higher on Animate to be placed at the desired position in SDT:
Another known issue. Occurs because of the way that gravity is calculated. It's also fixed in the hair extender mod.

I was surprised of the distortion of the symbols at first, but if there is nothing that can be done about this
There's a fix, but it will require you to use the Loader (and force any consumers of your work to do the same).

You'll need to decide for yourself whether the trade-off is worthwhile. Your work will lose some compatibility. You'll lose some time while you're learning and configuring Loader stuff. You should see a decrease in frustration during hair-modding work (i.e. don't need to manually nudge the hair strand upwards because of weird gravity). You should also see an increase in the number of creative possibilities that can be realized (using hair physics for cloth, metal, bikini straps, etc).
 

SyntaxTerror

Content Creator
Joined
Jul 24, 2014
use the Loader (and force any consumers of your work to do the same).

You'll need to decide for yourself whether the trade-off is worthwhile. Your work will lose some compatibility. You'll lose some time while you're learning and configuring Loader stuff. You should see a decrease in frustration during hair-modding work (i.e. don't need to manually nudge the hair strand upwards because of weird gravity). You should also see an increase in the number of creative possibilities that can be realized (using hair physics for cloth, metal, bikini straps, etc).
For the moment I think I'm going to keep training to make Vanilla mods with Animate. This editor is already complicated enough for me not to learn to use the loader and to make mods for it at the same time.

I have redone one of my old hair mods: I was unhappy because the pendants of Yamashiro's hair ornament didn't move:
Static%20Hair%20-%20Yamashiro.gif
I discovered that the Top damping thingy really works. But with a value of 0, the top symbol still moves a little.
Here, I have put different values to every pendant, so they do not move all together and it looks more natural.
Yamashiro's SWF mod is available HERE (along with her hair only, and ornament only).

By the way, Animate CC is not made to handle complex SVG files (maybe on purpose?). The tracings get sometimes modified and/or deformed a little, some colours are changed, the gradients are reset to basic directions, and the imported tracings are quite tricky to modify.
I was thinking of upgrading all my mods to SWFs, but in fact the work will be too important.
In fact, I am really tempted to do my future static mods in SWF, I really like the neat result it allows.
 

SyntaxTerror

Content Creator
Joined
Jul 24, 2014
Strangely, I managed by accident to solve the problem, by moving a little the top symbol:

Pwvb687.png


tHGAkZU.png


Here the bell is the bottom symbol and the top one is just a little invisible line. When the top symblol anchor point is close to the one of the bottom symbol, the bell is deformed, but moving it a little above solves the problem.

Unfortunately, I tried to do the same thing with my "Test - Flower" mod, but couldn't fix it, so I do not really know the things to do or not to do. :confused:
 

stuntcock

Content Creator
Joined
Jun 5, 2012
Strangely, I managed by accident to solve the problem, by moving a little the top symbol:
I can't give you an exact diagnosis without examining the file, but I suspect that what's happening here is that you're implicitly rearranging the symbols.

SDT loads a hair strand by processing its segments top-to-bottom. If the y-coordinate of the bell is less than that of the invisible line, then the bell will become the topmost segment in the hair strand. But there's very little room between "top of bell" and "beginning of the invisible line" -- so the canonical length of that segment will be very short (e.g. 10 pixels). Hence, even a very tiny change during gameplay (e.g. 1 pixel of head movement) will cause a +10% stretch in the visual appearance of the bell. Vigorous motion during sex will cause heavy stretching.

When the symbols are arranged into the correct order (as you've already done), the excessive stretching effect probably still occurs. But it happens to the invisible line segment -- so we don't care :)

Unfortunately, I tried to do the same thing with my "Test - Flower" mod, but couldn't fix it, so I do not really know the things to do or not to do. :confused:
Can you please explain what's wrong with the file, or share it so that I can take a look?

If you mean that the segments are stretching and compressing more than you want them to, then that's probably a "known issue." SDT's built-in physics don't cope well with very short segments (e.g. jewelry chains), because small absolute movements (e.g. girl's head moves 10 pixels) are fairly large in the context of a 20-pixel hair segment. Hence, you'll observe intense local distortion effects as the impulse is transmitted through the chain.

The built-in physics system cannot effectively transmit impulses without this sort of distortion. The usual "fix" is to incorporate very long segments (e.g. complete ponytail = 3 segments) so that the distortions are less noticeable. In your case, you could try to "repackage" your Test Flower hairstyle so that each segment includes several crosses. The physics would be less responsive (because the strand has become more rigid - the total number of "hinge" points has been sharply reduced) but you'd see less of the unwanted stretching.

Or you could Join the Dark Side :) I've encountered this problem in many own hair-modding projects, and the code offers several ways to resolve it:
  • mass manipulation
  • configurable elasticity
  • simulation overclocking
  • slaved physics calculations
 

SyntaxTerror

Content Creator
Joined
Jul 24, 2014
Can you please explain what's wrong with the file, or share it so that I can take a look?
Unfortunately, I didn't saved my latest tests...
But on my new Jingle Bells Hair Ornament, I don't have the problem with the balls and the ribbons, but I have it with the white diamonds. Actually, I had to draw squares to get diamonds (but for the bottom one). Each ribbon is made of 3 symbols:

jGesitB.png

Here are my FLAs: Headwear - Flower 01.fla, Headwear - Bells 01.fla
[EDIT] attachements removed
 
Last edited:

stuntcock

Content Creator
Joined
Jun 5, 2012
Actually, I had to draw squares to get diamonds (but for the bottom one).
Short answer: gravity.

Each link in a hair strand has a specific amount of mass, which is used by the physics system to govern its motion. By default, you cannot change the mass values. The mass-vs-elasticity relationship is "balanced" for fairly-long hair segments ... but it's worth noting that the resting shape of a SDT hairstyle will usually be 5-10% longer than its shape on the Animate canvas. Gravity stretches everything downwards, and the built-in elasticity rules do not fully compensate. We don't notice this in the vanilla game because we see only the results; if we looked at @Konashion's project files then we might observe that the hair strands are 10% shorter than expected :)

When you have many small segments (such as the diamond-shaped ribbon), there are noticeable problems:
  • the mass of each segment is unreasonably high (imagine that you chop off a 5cm length of ribbon and discover that it masses 5kg)
  • the total mass of the ribbon is unreasonably high (because each segment has a separate mass). If you add another diamond onto the end of the chain then you'll find that the entire thing gets stretched further down.
  • impulse effects (e.g. head movement) can produce intense local distortions. The distal portion of the ribbon has too much inertia (because it's too massive) and it will tend to "lag behind" the movement of the girl's head. Until the ribbon has completely "caught up", there will probably be a few segments which appear noticeably stretched out.

Solutions:
  • Vanilla: test your work frequently and refine it as needed. Squash your shapes on the Animate canvas in order to compensate for the stretching that's expected to occur in-game. Choose longer hairstyle designs which are less susceptible to stretching. In extreme cases: change the direction of gravity and completely re-cut the vectors to fit.
    • note: you've already discovered this stuff on your own. I'm not trying to patronize you; I hope to explain this stuff for the benefit of novice modders who might read the thread.
  • Loader: draw your shapes normally. If you find that they get distorted, then fix the physics rules instead of adjusting your artwork. Apply smaller mass values so that you can have small segments without crazy stretch effects. Alter the elasticity rules. Encourage rotation at same hinge-points while discouraging it at others. Etc....

Here are my FLAs:
Do you want me to do something specific with these files? I don't mind troubleshooting files in search of errors, but it seems like you've already got these things working smoothly. I expect that I won't really find any mistakes; I expect to see a competent modder who's running into the limitations of the physics system :)

I could apply Loader techniques in order to illustrate the different effects which can be achieved, but:
  • I won't do that without explicit permission
  • you wouldn't be able to observe/compare the different effects without installing the Loader
  • I'd prefer to put such work into a new project instead of revisiting a project which has already fulfilled its goals
 

SyntaxTerror

Content Creator
Joined
Jul 24, 2014
Do you want me to do something specific with these files?
In fact i nearlly got what I wanted in the Jingle Bells mod, and the other one is just a test, so I do not really need your help on this.
As you said, I just have to make more tests and try to get what I want by tinkering the shapes.

I started this thread to get more information, and then I tried to show the result of my experiments to help others to have a better knowledge of these things.

I could apply Loader techniques in order to illustrate the different effects which can be achieved
Do as you wish! I do not mind at all if someone uses my work in any way. I consider it as "public domain".
Feel free to add your version to the Resource Manager too, just put a link to mine for the Vanilla users (if yours is Loader specific).
Ideas: you could try to add RGB sliders for the ribbons and top square for example, and maybe put everything outside of the hair templates, so the hair tint could be changed without affecting the ornament.
 

stuntcock

Content Creator
Joined
Jun 5, 2012
Do as you wish! I do not mind at all if someone uses my work in any way. I consider it as "public domain".
That's good to hear. I probably won't actually do it though, because it isn't optimal for users. Instead of (x hours of work creates mod A) and (y hours of work creates mod B), they get (x+y hours creates two similar versions of Mod A). It's similar to what happened accidentally with the Philia hairstyle -- it isn't an efficient use of resources.

Ideas: you could try to add RGB sliders for the ribbons and top square for example, and maybe put everything outside of the hair templates, so the hair tint could be changed without affecting the ornament.
Definitely possible with Loader scripting. I'd prefer to do this on a fresh project, though, because working on the Jingle Bells ornament would force me to make changes to the artwork (e.g. the square-vs-diamond shape). I hate re-doing that sort of thing, and viewers would scarcely be able to notice the difference. I know the deficiencies of the SDT physics system, and yet I still needed to watch your animations for several loops before I could notice what was wrong with it :)

Are there any projects which you've shelved or discarded because you felt that they weren't technically feasible? We might be able to revisit one of those and bring it to completion. I remember that you skipped a few of the long-haired characters from Kantai Collection -- that might be a worthwhile place to begin looking.
 

SyntaxTerror

Content Creator
Joined
Jul 24, 2014
Are there any projects which you've shelved or discarded because you felt that they weren't technically feasible?
I am quite new to Flash, and I didn't tried to make dynamic mods since last week, so I didn't tried to do many things already.
When I was making animated backgrounds, I wanted to play some animations randomly (e.g. making dolphins jump at random times on my Animated Background - Moon & Dolphins, or I had the idea of people or cars passing randomly, or fish moving randomly in an aquarium). I found some examples and tutorials on the web, but never concretised this. But it is not really linked to hair mods and physics uin fact...
I remember that you skipped a few of the long-haired characters from Kantai Collection
When I began drawing hair mods, I was doing only SVG/PNG static mods, and I find horrible how long hair moves (or rather do not move), so I sticked to short hair characters.
I tried also to make long hair, but I find quite difficult to addapt a reference to the body of the SDT girl (i.e. her shoulders, and strands in front of shoulders). I need more practice, but actually I do not have much motivation to do this...
What I really like to do is backgrounds, especially animated ones. Also, at the moment I want to make a few dynamic hair ornaments. I find it is a good way to increase my knowledge of Animate with quite simple projects, and to make a mod type that haven't really been done in the past.
It depends on how much time I will spend on dynamic hair mods in the future, but I will certainly stumble on problems that cannot be solved with Vanilla and need the Loader physics, so you'll be the first that I will call in this case!
Thank you for your help you already provided anyway. :smile:
 

dantethedarkprince

Content Creator
Joined
Jun 15, 2012
Dude, I'm loving these little add-ons, art is really pretty good. Glad those FLA's came in handy to others :wink:. Hopefully others will follow the example.
 

SyntaxTerror

Content Creator
Joined
Jul 24, 2014
Dude, I'm loving these little add-ons, art is really pretty good.
Thanks. It is always nice that others appreciate his work and say it, especially when it comes from awesome modders like you. :wink:
Hopefully others will follow the example.
I am afraid that we are currently lacking modders for SWF mods at the moment, especially for dynamic hairs. I think that only stuntcock stuntcock is able to make some at the moment.
For my part, I have been doing a bit of testing a few months ago, without any conclusive results, and the only dynamic hair mod I produced was in fact the looting of Konashion's SD Chan (SD Chan RGB Adjustable Dynamic Hair).
Nevertheless, I want to try again with my own work, because it interests me, and I know that one cannot learn anything without practice.
 

Users who are viewing this thread

Top


Are you 18 or older?

This website requires you to be 18 years of age or older. Please verify your age to view the content, or click Exit to leave.