Birdoggydog's Builds

Building armor as 35 swappable pieces in Blender

A kit that makes rigid armor pieces from a table of numbers, fits them to boxes measured on a body, and two sliders for how far a suit sits off the skin.

Blobber has an armor kit now. It builds 35 rigid pieces, in three high fantasy suits, from a table of numbers, and any piece from one suit can be worn next to any piece from another. The kit is also in the model workbench with 33 knobs. I had agents build it as a study on 10 October, and nothing is installed in the game yet.

Building a suit as separate pieces

The bare orc dressed a region at a time into the knight, the three suits, regions swapped into a mixed set, the long skirt at the hip, the legs through the walk, and the goblin in the same pieces.

The three suits are plain clothes (11 pieces), a raider (11) and a knight (13), all with rigid trousers and boots. Each piece is a separate model that goes on one spot on a body and gets sized by that body.

The bare orc and the plain, raider and knight suits at 2, 5 and 12 meters, under a lamp and in daylight
The three suits on the orc at the distances the game shows a monster.

I liked the themed orc from earlier in the day except at the hip, where the armor was weird, and he needed pants and shoes. I wanted whole suits from a generator, and I wanted to be able to swap every piece individually. The goal behind it is to get assets into the game faster and to ship fewer printed models, because they’re so large.

A body has 21 slots of 13 types: head, chest, back, waist, belt, hips, and a left and a right shoulder, upper arm, forearm, hand, thigh, shin and foot. A slot is a socket (a bone and a frame in that bone’s space) plus a size on three axes. The size is measured on the exported skin and written into the body’s manifest, so I don’t have to rebuild a body to give it a new slot. The waist slot is there because a single rigid piece from ribs to waist went 117 mm into the hip piece when the orc bent over to strike.

A piece is one .glb with one mesh and one material, and it isn’t made for any particular wearer. Its manifest says which type of slot it goes on, the slot size it was drawn for, and how it gets fitted. box scales each axis by the wearer’s slot size divided by the drawn size. uniform uses a single number, for something like a slung shield or a satchel. The same model works on the left and the right, and both frames are rotations, not mirrors.

Nothing is painted onto the body’s skin, and everything is rigid, including the trousers. They can be blocky. That fits the genre.

The party’s five equipment slots are regions made of those 21 slots. Helmet is the head. Chest is the chest, back, waist, shoulders and upper arms. Legs is the belt, hips, thighs and shins. Hands is the forearms and hands. Feet is the feet. So an item is a suit plus a region.

What does a state cost when it’s baked?

All the pieces in a theme share one material and one palette made of three textures, 128 by 64 pixels. A state (how worn the armor is) is four numbers on that material: wear, grime, dust and glow. They’re set per piece, so one wearer can mix conditions.

The other way to do it is a baked texture for each piece in each state, and that looks better. I loved those rows on the sheet. But the knight baked that way was 710 KB. All 35 pieces with the shared palette are 270 KB, and the palette is 1,516 bytes. I didn’t want to pay that cost for states.

In the game, the four numbers need one shader with per-instance values. That’s specified but not written yet.

The first sheets had light bands across large plain surfaces. The palette had eight flat light steps, and those were the cause. It was found by removing one possible cause per column on a sheet. The palette is a continuous ramp now, at the same size.

Checking the fit through every clip

The fit check runs all five animation clips. Skin only counts as poking out where it comes through the wall of a piece. Two pieces that meet at a hinge fail when a point on one sticks more than 10 mm out through the wall of the other. The death clip is listed separately and doesn’t have to pass. Death is ok to be worse.

On the orc, six sets have 0 faults in every clip except death, and 7 to 14 per set in death. The goblin isn’t tuned yet and has 2 to 3 per set.

Three things got thrown away along the way. The first fit rule tested 50 mm deeper than at rest, and every hinge failed it. A shin tube that ran past the knee came 12 mm through the thigh piece. And collapsing round pieces to 150 triangles crumpled the skirt’s plates and the cuirass.

I chose the roundest of three levels of blockiness. Round pieces don’t stick out as far at the corners, and that caused 5 to 8 fit faults per set until some piece types were fixed: two-segment knee caps, wider ankle rings and a wider plain shin. A full set is 1,475 triangles for plain, 1,878 for the raider and 2,661 for the knight. A single piece is 28 to 228 triangles and 3.8 to 13.9 KB.

Making a suit less bulky with one number

The knight in the workbench: bulk dragged from 2 down to 0, follow from 0 to 1, the hand alone as a mitten and as a back-of-hand plate, the legs region, the raider, and the plain clothes at bulk 0.6.

The round armor looked a little too bulky to me, so I had the kit added to the workbench (a Godot tool with sliders and a live preview on top of the Blender generators). A model in there is a suit worn on the orc. It can be the whole set, one of the five regions, or one piece. A whole knight drafts in 0.4 seconds.

The knight at bulk 0, 0.5, 1, 1.5 and 2 from five views, with stand-off, liters and fit faults beside each row
Bulk from least to most. Only the default row passes the fit check.

Scaling the pieces uniformly opened up every join, so bulk isn’t a scale. Every slot is a box measured on the skin, and 1.0 across a slot is the widest the body gets there. Pieces are drawn in slot units as rings, boxes and domes. Bulk only acts on the part that sticks out past the box:

r' = 1 + bulk * (r - 1)    for r > 1
r' = r                     otherwise

Bulk 1 is the suit as drawn, 0 is skin-tight to the slot’s box, and 2 is twice the air gap. Five more knobs let me set it separately for each region.

follow pulls each piece in toward the shape of whoever is wearing it. The wearer’s cross-section gets measured once. For nine slot types, at 9 stations along the slot’s axis and in 16 directions, it records how far the skin is from the axis. Each ring point on a piece is then pulled toward that cross-section, but it always keeps at least 0.06 slot units of air (6 mm on a limb, 15 mm on the trunk). Pulling whole pieces in gave 18 fit faults, and the hem of a thigh plate went 66 mm through a knee cap during the walk. So the pull fades out. It’s at full strength in the middle half of a slot and at zero from the joint outward. That leaves 1 to 3 small faults, and the effect is modest.

There are three measurements under the picture: the mean stand-off from the skin weighted by face area, the liters the pieces enclose, and the fit faults.

KnightMean stand-off (mm)LitersFit faults
bulk 033.945223
bulk 0.539.452810
bulk 1 (default)49.46130
bulk 1.559.37075
bulk 269.58129
follow 146.25782
bulk 0.5 + follow 136.25019

Bulk looks right at rest from about 0.5 to 1.3. It only passes the fit check at 1.0 and 1.1, because the joins were tuned by hand at bulk 1. A suit picked anywhere else needs its joins fixed, and that’s the next piece of work.

Why did the armor get bulkier?

It was the long skirt I asked for at the hip. The knight in the first pictures enclosed 585.8 liters, and the one that landed encloses 618.8. The skirt alone went from 130.6 to 179.1 liters, and from 83 to 102 mm off the skin. Every other piece got 0.7 to 3.9 liters smaller when the pieces went from six-sided to round.

The gauntlet went back to being a cuff and a plate over the back of the hand, with the fingers bare. I liked it even though it’s a little silly. The full mitten is still there as a type, made slimmer: 1.24 across where it used to be 1.38. Neither one crosses the grip of any of the four installed weapons.

I also settled what fitting armor to a body means. One piece works for every race and gets pulled to the body. I’m not making pieces per race.

Also done

  • The 35 pieces come out as the same bytes when they’re built twice.
  • The slider ranges come from 283 builds across the three suits, and none of them failed. They mark where a build succeeds, not where it looks right.

Next

The pipeline doesn’t have a class for a single piece yet, the goblin needs tuning, and none of this has run in the game.