Townsperson, explained · celworld

Townsperson

.cel · 30 lines · 21 shapes · 6 joints · seed 1

Townsperson is 15 shape lines that grow into 21 shapes, with 10 genes the seed draws, 4 motions on 3 joints.

a person-scale chibi in the house style: a round head with the house face, a superellipse torso, sleeve and sock bands, a hair cap (bowl, bob or bun); arms and legs swing

seed

From the ground to each spot

Each part rides the one before it, so whoever sits at the end feels every motion at once.

Always on

State walk

State cheer

L1

Townsperson

asset
1asset figure "Townsperson" ref=person complexity=5

The asset line names the model figure, titled Townsperson. complexity=5 holds it to 100 shapes, 8,000 triangles and 4 draw calls; going past any of them is an error. ref=person pairs it with a hand-coded generator for side-by-side comparison.

tier
c5
shapes cap
100
triangles cap
8,000
seed
1
L4

S

let
4let S = .82..1.12

A gene, S: a value drawn between 0.82 and 1.12 for every seed. This seed picked 1.04. Every line that reads S follows it.

this seed
1.04
draws
from the seed
L5

R

let
5let R = .19..0.22

A gene, R: a value drawn between 0.19 and 0.22 for every seed. This seed picked 0.195. Every line that reads R follows it.

this seed
0.195
draws
from the seed
L6

skin

let
6let skin = skin0|skin1|skin2|skin3|skin4|skin5|skin6|skin7|skin8|skin9

A gene, skin: a weighted pick from skin0, skin1, skin2, skin3, skin4, skin5, skin6, skin7, skin8 or skin9. This seed picked skin5.

this seed
skin5
draws
from the seed
L7

shirt

let
7let shirt = cherry|tangerine|sunflower|lime|teal|cobalt|grape|pink|coral|white|navy|bottle

A gene, shirt: a weighted pick from cherry, tangerine, sunflower, lime, teal, cobalt, grape, pink, coral, white, navy or bottle. This seed picked coral.

this seed
coral
draws
from the seed
L8

pants

let
8let pants = denim:3|navy|iron|oak|bottle|plum|cream

A gene, pants: a weighted pick from denim (3 in 9), navy, iron, oak, bottle, plum or cream. This seed picked navy.

this seed
navy
draws
from the seed
L9

shoeC

let
9let shoeC = iron:2|walnut|cherry|white|cobalt

A gene, shoeC: a weighted pick from iron (2 in 6), walnut, cherry, white or cobalt. This seed picked iron.

this seed
iron
draws
from the seed
L10

sock

let
10let sock = white:2|cream|sunflower|pink

A gene, sock: a weighted pick from white (2 in 5), cream, sunflower or pink. This seed picked white.

this seed
white
draws
from the seed
L11

hairC

let
11let hairC = hairBlack:3|hairBrown:3|hairAuburn|hairGinger|hairBlonde:2|hairGrey|hairPink:.3|hairTeal:.3

A gene, hairC: a weighted pick from hairBlack (3 in 11.6), hairBrown (3 in 11.6), hairAuburn, hairGinger, hairBlonde (2 in 11.6), hairGrey, hairPink (0.3 in 11.6) or hairTeal (0.3 in 11.6). This seed picked hairBrown.

this seed
hairBrown
draws
from the seed
L12

style

let
12let style = "bowl":3|"bob":2|"bun"

A gene, style: a weighted pick from bowl (3 in 6), bob (2 in 6) or bun. This seed picked bob.

this seed
bob
draws
from the seed
L13

SL

let
13let SL = .45:2|.9

A gene, SL: a weighted pick from 0.45 (2 in 3) or 0.9. This seed picked 0.9.

this seed
0.9
draws
from the seed
L16

pelvis

lathe
16lathe pelvis at=(0, .6*S, 0) h=.16 r=.16 prof=[0:.86 .5:1 1:1] sq=3 depth=.72 color=pants scale=S joint

A lathe, a profile spun round Y: pots, bodies, columns, domes, bells (base at the origin). It stands at the model's origin. It is a joint, so it and everything on it can move.

body: the pelvis is the root, everything scales with it

h
0.16
r
0.16
prof
[0:.86 .5:1 1:1]
sq
3
depth
0.72
color
navy
scale
S
L17

torso

lathe
17lathe torso on=pelvis at=(0, .15, 0) h=.36 r=.16 prof=[0:1 .55:1.05 .86:.98 1:.6] sq=3 depth=.72 color=shirt

A lathe, a profile spun round Y: pots, bodies, columns, domes, bells (base at the origin). It rides pelvis, at (0, .15, 0) in its frame.

h
0.36
r
0.16
prof
[0:1 .55:1.05 .86:.98 1:.6]
sq
3
depth
0.72
color
coral
L18

neck

cyl
18cyl neck on=torso at=(0, .33, 0) h=.08 r=.05 color=skin

A cyl, a cylinder (or tapered drum) with rounded edges, base at the origin. It rides torso, at (0, .33, 0) in its frame.

h
0.08
r
0.05
color
skin5
L19

head

ball
19ball head on=torso at=(0, .38+R, 0) r=(R, R*.98, R*.94) color=skin joint

A ball, an ellipsoid centred on the origin. It rides torso, at (0, .38+R, 0) in its frame. It is a joint, and line 37 rocks ±3°: everything on it moves too.

r
0.195, 0.191, 0.183
color
skin5
L20

look

face
20face look on=head eyes=round:3|dot|happy|sleepy mouth=smile:3|grin|open|flat|cat blush=chance(.4) iris=#5a3a28|#3a6a8a|#4a6a3a|#2a2a3a brows=hairC*.7

A face, a house face (unlit, never inked) on the parent surface: eyes, mouth, blush, brows. It rides head, at its origin.

eyes
round
mouth
grin
blush
no
iris
glassDark
brows
skin9
L21

ear

ball
21ball ear on=head surf=(86, -6) upright mirror r=(R*.1, R*.18, R*.13) color=skin*.84

A ball, an ellipsoid centred on the origin. It sticks to the surface of head at (86, -6) (azimuth, elevation). 2 copies and a mirrored twin across the parent’s centre line.

copies
2
r
0.019, 0.035, 0.025
color
skin6
L22

nose

ball
22ball nose on=head surf=(0, -14) upright lift=-R*.03 r=(R*.1, R*.09, R*.09) color=skin*.84 if=chance(.6)

A ball, an ellipsoid centred on the origin. It sticks to the surface of head at (0, -14) (azimuth, elevation). Only when chance(.6).

lift
-R*.03
r
0.019, 0.018, 0.018
color
skin6
L25

cap

ball
25ball cap on=head at=(0, R*.1, -R*.08) r=(R*1.05, R*1.02, R*1.06) half rot=(-34, 0, 0) color=hairC segs=18 rings=7

A ball, an ellipsoid centred on the origin. It rides head, at (0, R*.1, -R*.08) in its frame.

hair

r
0.205, 0.199, 0.207
half
yes
rot
(-34, 0, 0)
color
hairBrown
segs
18
rings
7
L26

fringe

ball
26ball fringe x3 on=head surf=(-32+t*64, 40) decal lift=-R*.03 r=(R*.34, R*.2, R*.12) color=hairC segs=10 rings=5

A ball, an ellipsoid centred on the origin. It sticks to the surface of head at (-32+t*64, 40) (azimuth, elevation), lying flat on it. 3 copies.

copies
3
lift
-R*.03
r
0.066, 0.039, 0.023
color
hairBrown
segs
10
rings
5
L27

bobback

ball
27ball bobback on=head at=(0, -R*.12, -R*.2) r=(R*1.1, R*.9, R*.96) color=hairC if=style=="bob"

A ball, an ellipsoid centred on the origin. It rides head, at (0, -R*.12, -R*.2) in its frame. Only when style=="bob".

r
0.214, 0.175, 0.187
color
hairBrown
L28

bun

ball
28ball bun on=head surf=(180, 50) upright lift=-R*.08 r=R*.4 color=hairC if=style=="bun"

A ball, an ellipsoid centred on the origin. It sticks to the surface of head at (180, 50) (azimuth, elevation). Only when style=="bun".

copies
0
lift
-R*.08
r
R*.4
L31

arm

limb
31limb arm on=torso at=(.175, .265, 0) mirror roll=7 len=.42 r=(.062, .05) bands=[SL:skin] color=shirt joint

A limb, a capsule hanging DOWN from the origin (a joint at the top): arms, legs, necks (rot to aim). It rides torso, at (.175, .265, 0) in its frame. 2 copies and a mirrored twin across the parent’s centre line. It is a joint, and line 39 tips ±16° and line 40 keyframes on rz: everything on it moves too.

arms and legs

copies
2
roll
7°
len
0.42
r
0.062, 0.05
bands
[SL:skin]
color
coral
L32

hand

ball
32ball hand on=arm at=end r=.058 color=skin

A ball, an ellipsoid centred on the origin. It sits at the end of arm. There is a set on each of the 2 arm copies, 2 in all.

copies
2
r
0.058, 0.058, 0.058
color
skin5
L33

leg

limb
33limb leg on=pelvis at=(.08, .04, 0) mirror len=.52 r=(.088, .07) bands=[.8:sock] color=pants joint

A limb, a capsule hanging DOWN from the origin (a joint at the top): arms, legs, necks (rot to aim). It rides pelvis, at (.08, .04, 0) in its frame. 2 copies and a mirrored twin across the parent’s centre line. It is a joint, and line 38 tips ±22°: everything on it moves too.

copies
2
len
0.52
r
0.088, 0.07
bands
[.8:sock]
color
navy
L34

shoe

ball
34ball shoe on=leg at=end+(0, -.12, .04) r=(.074, .08, .13) half color=shoeC

A ball, an ellipsoid centred on the origin. It sits at the end of leg, nudged by an offset. There is a set on each of the 2 leg copies, 2 in all.

copies
2
r
0.074, 0.08, 0.13
half
yes
color
iron
L37

head rocks ±3°

anim
37anim head sway amp=3 hz=.45

head rocks left and right by ±3°, once every 2.2 s (.45 Hz). This is the sway preset: a slow side-to-side lean (trees, signs, idle bodies). Everything on head goes with it.

idle always; walk and cheer are named states a game triggers

channel
rz
wave
sin
rate
.45 Hz
amount
±3°
L38

leg tips ±22°

anim
38anim walk: leg gait

leg (all 2 copies) tips forward and back by ±22°, once every 1.1 s (.9 Hz). This is the gait preset: legs or arms that swing in turn (mirror twins alternate). The mirrored twin runs 0.5 of a cycle apart, so the pair alternate. It plays only while the model is in the walk state. Everything on leg goes with it.

channel
rx
wave
sin
rate
.9 Hz
amount
±22°
state
walk
L39

arm tips ±16°

anim
39anim walk: arm gait amp=16 phase=.5

arm (all 2 copies) tips forward and back by ±16°, once every 1.1 s (.9 Hz). This is the gait preset: legs or arms that swing in turn (mirror twins alternate). The mirrored twin runs 0.5 of a cycle apart, so the pair alternate. It starts 0.5 of a cycle in. It plays only while the model is in the walk state. Everything on arm goes with it.

channel
rx
wave
sin
rate
.9 Hz
amount
±16°
state
walk
L40

arm keyframes on rz

anim
40anim cheer: arm rz keys=[0:0 .3:150 .5:135 .7:150 1:0] hz=.7

Plays arm (all 2 copies) through keyframes on rz: [0:0 .3:150 .5:135 .7:150 1:0], one cycle once every 1.4 s. It plays only while the model is in the cheer state. Everything on arm goes with it.

channel
rz
wave
keys
rate
.7 Hz
state
cheer