hoggyart
The hoggy as a thing on screen.
One hoggy is a generated quilled body under a rig of authored parts: a ridge of blunt spine quills that gives the silhouette at the gameplay camera, a belly that fills with the glew it has eaten, a snout and nose carried past the body's outline so the creature reads as aimed, two eyes that catch the light, and a warm point light inside the belly that puts the hoard on the grass around it.
The generated body carries the fine detail — snout, ears, pale underside, the fuzz of small quills. The authored parts carry the read from twenty metres up the hill, where that fuzz is below a pixel.
local Art = require("game.hoggy.hoggyart")
local parts = Art.build(rootEntity, seed) -- seed 0..1, per-creature variation
Art.setBelly(parts, 0.6) -- 0 empty .. 1 full
Art.setAlarm(parts, 1) -- 0 calm .. 1 about to charge
Art.pose(parts, dt, { gait = "waddle", speed = 2.4 })
Art.destroy(parts)
build returns a plain table of live entity proxies; every other call takes it
back. Everything it spawns is temporary, so nothing here is saved into the
scene.
The two reads
setBelly is what the player crosses the hill for: the belly swells and lights
the grass, and the body warms from slate toward amber. setAlarm is the tell
they need a moment later: the per-instance outline goes amber while the hoggy
is worth henting and ember while it has decided to come at them, and the ridge
lifts and splays as it rouses.
Neither touches a material, so five hoggies at five different fullnesses share one set of materials — the fullness lives in per-instance tint, outline, scale and light intensity.
The gait
A hoggy is round and short-legged, so it does not walk, it rocks. pose takes
a gait: waddle while it grazes, charge when it is coming for the lantern,
eat with the snout down, stun for the wobble after it has hit something,
and idle when it is standing about.
Where the body comes from
generated.meshes.A_stylised_low_poly_folk_tale_creature — a .bundle, about
1.9 m long about its own origin with the snout along +Z, scaled down to
Art.LENGTH and turned to face the way the creature walks. With that bundle
absent the module blocks out a round body instead, so the ridge, the belly and
the face still read.
Scoped to this part · feeds back into the world's score.