Jump to content

Algorithm for determining Skin Exposure


Omega Haxors

Recommended Posts

For simplicity sake, each clothing slot will take its most common value. There will be exceptions to these, but more or less you should get a really good idea what each slot is going to cover (since there's usually little variance)

First we need to slice the body up into parts. For this, I went through various clothing to get a glimpse of what 'regions' were covered by the various clothing items. Eventually I came to these parts:

image.png.e89ea3710e0319e1e71f1f623f3ffaea.png

Head Top & Back: Covered by hats and Helmets

Face Bottom: Covered by masks and Helmets

Body Back: Covered by capes, shirts, jackets and Bodies

Body Top: Covered by capes, shirts, jackets, and Bodies

Body Bottom: Covered by shirts, pants, jackets, and Bodies

Arm Top: Covered by jackets and Bodies

Arms Bottom: Covered by gloves and Bodies

Legs Top: Covered by pants, Bodies, and Leggings

Legs Bottom: Covered by boots and Leggings

 

Now that we have the regions defined, we need to give them a value on how much coverage each provides.

First lets use the Model Editor to see what each of our slots cover. Thankfully the model requires very little tweaking to get the results we need, with most of the regions lining up perfectly to the ones created here.


Head Top & Back: 44

Face Bottom: 30

Body Back: 60

Body Top: 30 (Only the front face since the back is already accounted for, and the arms block the sides)

Body Bottom: 30 (^ditto)

Arms Top: 49 (inside covered by body)

Arms Bottom 52 (^ ditto)

Legs Top 24 (^ ditto again)

Legs Bottom: 140

Total score: 459
 

Now you want to iterate over each 'slot' and set it to "false" if there are any items in that slot. If there isn't, move on to the next slot, and if there are no more slots left, set the value to "true" for that region. This means the slot is uncovered.

Take the score of each slot and multiply it by the boolean value (so false sets the score to 0) then add all of the scores together. Divide the value by 459 to get it as a % value. Finally you'll have an "uncovered" percentage which determines how much skin is exposed.

 

BONUS: I have calculated the surface area of the player to be 5.4265m^2 using this math
By standing on a 1/16h block you can see that you're 2 blocks high, so they are 1.9375m tall
By taking the character in the editor, you can see that they are 30.2 editor units tall
By dividing the size in meters by a 1unit cube, we learn that each unit is worth 6.4155cm (or 0.064155m)
Since the surface area (in units) is measured as 459 units that means 29.447145m of surface area.
Square that to get your value: 5.4265m^2

Edited by Omega Haxors
finishing up
Link to comment
Share on other sites

6 hours ago, Omega Haxors said:

I tried doing this but the pixel measurements were kicking my ass, so just kinda... guesstimate? Might come back here later once I figured them out, but for now I just have to throw the towel and admit I have no way of actually measuring out how much 'area' each part of the body covers with any level of consistency.

Go to assets/game/shapes/entity/humanoid/seraph-faceless.json and crack it open with the VS Model creator. You can get the measurements easily there.

  • Thanks 1
Link to comment
Share on other sites

5 hours ago, l33tmaan said:

Go to assets/game/shapes/entity/humanoid/seraph-faceless.json and crack it open with the VS Model creator. You can get the measurements easily there.

That was actually my first attempt but after an hour wasted trying to get the texture to actually go on the model, I burnt out and gave up.
I don't mind grueling math, but what I can't handle are nonfunctional programs that don't do what they're supposed to do.

 

EDIT: I just remembered that the editor uses quads, so I can use those to avoid having to do pixel measurements at all. I'll continue with this knowledge.

Edited by Omega Haxors
Link to comment
Share on other sites

Why are you trying to place textures on it at all if you're trying to determine the dimensions of each slot? I believe everything you highlighted except for the head is its own shape in the seraph-faceless.json file, so you can use the dimensions there and save yourself some time. The size of pixels on the model can be changed anyway, so it's not the best indicator to use for determining sizes.

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.