v1.1.1NeverDark ModuleBSD-2-Clause

nd-mob for axil-nd, ported from SIC to libxylem and expanded with a pure-C header-only procedural 3D creature, skeleton, IK, and PBR atlas suite.

GitHub
git clone https://github.com/tty-pt/nd-mob

Documentation

axil-nd-mob

nd-mob for axil-nd, ported from SIC to libxylem and expanded with a pure-C header-only procedural 3D creature, skeleton, IK, and PBR atlas suite.

Owns mobiles on the server (spawning entities onto generated tiles via on_spawn from data/mobs.dsv) and ships the shared pure-C 3D creature generation headers consumed by nd-mob-gl and other NeverDark viewports.

Install

make install

Installs:

lib/libnd-mob.so
include/nd/mob_dna.h
include/nd/mob_anatomy.h
include/nd/mob_subdiv.h
include/nd/mob_sdf.h
include/nd/mob_head3d.h
include/nd/mob_mesh3d.h
include/nd/mob_anim.h
include/nd/mob_ik.h
include/nd/mob_atlas.h

There is deliberately no lib/nd-mob.so symlink (see axil-nd-wts for why: mods.load names the installed filename, and the OpenBSD packing list never lists a symlink).

Also packaged across all 9 platforms (deb, apk, rpm, pacman, brew, openbsd, winget + Scoop, android-lib, and ios-lib + SwiftPM XCFramework) from a v* tag.

Build from source

Builds use the shared libstele makefile rules (../libstele/mk/include.mk, or resolved via TTYPT_MK / pkg-config --variable=include_mk stele):

make

Needs libxylem, libstele, and the engine's game API (<nd/xy.h>), plus the sibling types it reads (<nd/fight.h>, <nd/plant.h>, <nd/race.h>) โ€” from checkouts beside this repo or from installed packages:

git clone https://github.com/tty-pt/nd-mob && cd nd-mob
git clone https://github.com/tty-pt/axil-nd ../axil-nd
git clone https://github.com/tty-pt/nd-fight ../axil-nd-fight
git clone https://github.com/tty-pt/nd-plant ../axil-nd-plant
git clone https://github.com/tty-pt/nd-race ../axil-nd-race
make

CI names the deps explicitly (axil-nd,libxylem,libstele,nd-fight,nd-plant,nd-race).

What it does

Server Module (src/libnd-mob.c, data/mobs.dsv)

  • xy_install() loads creature/NPC definitions from data/mobs.dsv via nd_table_load().
  • on_spawn reads the tile (plant_tile_t), race, and fight skeleton to pick species by spawn density and place mobs.

Procedural 3D Creature Headers (include/nd/mob_*.h)

  • Creature DNA & Anatomy (mob_dna.h, mob_anatomy.h, mob_subdiv.h, mob_sdf.h):
  • Generalized creature archetypes across humanoids, ungulates (Horse, Cow with Holstein coat spots/udder/muzzle pad), carnivores (Wolf, Fox, Bear, Cat with dedicated anatomical limbs/muzzles/tails), birds (arched/hooked beaks, flight wing dihedral, tucked flight legs), and aquatic/small fauna.
  • Catmull-Clark manifold subdivision (mob_subdiv.h), SDF primitives (mob_sdf.h), and anatomical muscle/limb cross-section profiles (mob_anatomy.h).
  • Facial Sculpting, Garments & Hard-Surface Armor (mob_head3d.h, mob_mesh3d.h):
  • Concentric face cage with Nordic facial planes, orbital sockets, supraorbital brows, hooded eyelids, tucked ears, parted non-wrapping hair locks, layered beards, and open-faced headgear.
  • Fitted arming doublet / dark gambeson underlayers, non-subdivided forged steel plate armor (plate_sd: 6-ring spline breastplate, domed 3-lame pauldrons, flush couters, baldrick straps + clasp), V-neck tunics/robes/capelets, flush belts, and 3/4 held weapons/shields.
  • 32-Bone Rig, Animation & Slope IK (mob_anim.h, mob_ik.h):
  • 32-bone skeleton with contrapposto idle, walk/run/swim/flight gaits, tucked shield carry and outward longsword stances, and 2-bone analytical terrain-slope inverse kinematics (mob_ik.h).
  • 2048ร—2048 Procedural PBR Atlas (mob_atlas.h):
  • 4ร—4 grid of 512ร—512 padded tiles (MOB_ATLAS_SIZE = 2048, MOB_ATLAS_TILE_PX = 512, MOB_ATLAS_PAD_PX = 8) baking albedo/alpha and tangent-space normal/roughness/AO maps (combed directional pelts, forged iron/trim armor, skin/eye/cloth tiles).
  • Supports full-atlas baking (mob_atlas_generate()) and single-tile parallel async baking with 10-level bit-exact mipchains (mob_atlas_generate_tile(), mob_atlas_generate_tile_strided(), mob_atlas_generate_tile_mips()).

Packaged Assets

  • Data (data/mobs.dsv): Declarative species and NPC spawn definitions.
  • Art (art/): Monster, creature, and NPC entity graphics stored in art/entity/.

Testing

There is no test.sh here. Behaviour is asserted by the engine's own suite:

cd ../axil-nd
make && ./test.sh

Notes from the port

  • SIC_DEF โ†’ XY_IMPL, mod_install โ†’ xy_install. There was no mod_open with a distinct body; xy_install is the old mod_install verbatim.
  • Links cleanly via -lxylem -laxil-nd (with -undefined dynamic_lookup on macOS).

License

BSD 2-Clause, carried over from tty-pt/nd-mob. See LICENSE.

Maintained by:tty-pt