v1.0.4NeverDark ModuleBSD-2-Clause

nd-race for axil-nd, ported from SIC to libxylem.

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

Documentation

axil-nd-race

nd-race for axil-nd, ported from SIC to libxylem.

Owns the five playable races: their per-attribute bonuses, their fight weight, and the name↔id association. It co-implements nd-attr's attr_stat chain (base value + race bonus, read through nd_last()), implements fighter_wt with the racial weight, and is the first and only consumer of the engine's nd_assoc XY hook.

Install

make install

Installs:

lib/libnd-race.so
include/nd/race.h

There is deliberately no lib/nd-race.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

make

Needs libxylem and the engine's game API, <nd/xy.h>, plus <nd/attr.h> for the chain this module co-implements. Note the Makefile carries no sibling -I: <nd/attr.h> resolves from the installed nd-attr package (or a checkout at ../axil-nd-attr only if the compiler already finds it), so build against an installed engine and installed nd-attr, or add the -I yourself for a fully uninstalled tree. CI names the deps explicitly (axil-nd,libxylem,nd-attr).

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

What it does

  • xy_install() registers the race table (auto-indexed), the race_id

and race_sid maps, and the race_rhd secondary index, then associates names to ids through the engine's nd_assoc hook.

  • race_set / race_query / race_add assign and look races up;

attr_stat adds the racial bonus on top of the chain value; fighter_wt answers the racial weight; on_add and on_status cover creation and display.

In-Game Commands (man-src/)

Race selection is handled during onboarding (begin.10) and reported via character sheet review (status.10).

Packaged Assets (art/)

Racial heritage portraits, avatar silhouettes, and species icons.

Wire Protocol & BCP Integration

Racial attribute adjustments (e.g. elf dexterity, dwarf constitution) fold into BCP_STATS frames.

Modder Extension Guide

To introduce a new race:

  1. Define a race_t record specifying baseline attribute bonuses, weight, and size.
  2. Register the race into the race table during xy_install().
  3. Co-implement the attr_stat and fighter_wt XY chains.

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, sic_last(&last) β†’

nd_last(&last). stat became attr_stat: the bare name collides with libc's stat(2) (pulled in via <sys/stat.h>).

  • This TU XY_IMPLs attr_stat from <nd/attr.h>, so it defines

ATTR_IMPL before including it.

  • fighter_wt deliberately returns only the racial weight with no

nd_last() term β€” an open call, not an omission.

  • The link line is libxylem alone. NEEDED is libxylem.so and libc.so.6.

License

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

Maintained by:tty-pt