Skip to content

Repository files navigation

License: MIT ci CodeQL codecov

rollnw

rollnw is an homage to Neverwinter Nights (NWN) in C++. It started as reusable NWN infrastructure and is broadening toward support for a modern authored RPG toolset/game: content formats, rules, scripting, rendering validation, networking foundations, and the runtime services needed to make those pieces authorable and playable. See the docs and tests for more info. Opening an IDE is going to get the most current view.

Transition warning: rollnw is in active transition. Older docs and APIs may show a narrower NWN-library cross section of the project. Repository snapshots use date tags, while independently shipped packages keep their own versions. Assume APIs and subsystem boundaries can move between snapshots.

Goals

  • aims to implement the reusable RPG, toolset, resource, rendering, networking, and runtime foundations for a modern authored game inspired by NWN, with current effort on the practical pieces (rules, content formats, renderer validation, authoring workflows) a playable toolset/game will need.
  • focuses on authoring and usage, instead of doing things the Aurora Engine Way.
  • follows utf8 everywhere.
  • hews as close to C++ Core Guidelines as possible.
  • aims to be as easily bindable as possible to other languages. I.e. only library specific or STL types at API boundaries.

Features

  • nw::smalls is a statically-typed scripting language designed for RPG tooling. It is the active rules/script authoring path and explores replacing NWScript-style workflows with modern features (modules, generics, first-class arrays/maps) while staying small enough to embed in rollnw-based tools. See the docs for a language spec.
  • The beginnings of a novel rules system and combat engine built on Smalls.
  • nw::gfx, a thin Vulkan-focused rendering layer intended to support renderer experiments, headless graphics validation, and eventual authored-toolset/game viewports.
  • nw::render, the 3D renderer built on nw::gfx: Forward+ lighting, common model instances for glTF and NWN-derived assets, skinned animation through ozz, particles/VFX, shadows, screenshots, and focused parity tests for moving legacy content toward a modern PBR path.
  • Objects (i.e. Creatures, Waypoints, etc) are implemented at a toolset level. In other words, their features cover blueprints and area instances, with support for effects and item properties. Loading objects from resman or the filesystem is transparent whether the source is GFF or JSON. See the legacy object notes for runtime handle/loading context.

Tools

  • rollnw | client, the local module viewer and authoring workbench, installed as rollnw-client. It imports modules into editable projects, browses areas and resources, renders areas and blueprints, inspects placed objects, and provides focused editors for the object data paths implemented today. It is intentionally viewer-first rather than a claim of complete NWToolset parity.
  • mudl, a renderer-backed NWN model/spell/VFX viewer and headless capture tool used to validate creature assembly, particle and programmable FX playback, glTF/PBR rendering, and the asset paths a future toolset needs to trust. Renderer design notes live under the renderer docs, including the particle system overview.

Legacy

  • Implementations of pretty much every NWN file format (gff, Bioware DDS, etc) and container (erf, key/bif).
  • An implementation of NWN's localization system focused on utf8 everywhere.
  • A recursive descent NWScript Parser. This remains useful for NWN compatibility, but new rules and scripting experiments are moving toward Smalls.

Out of scope: NWN:Enhanced Edition-specific infrastructure that does not generalize beyond that runtime, such as NWSync; ad hoc workarounds for runtime limitations, such as ruleset.2da; and JSON schemas that expose legacy GFF field layouts as a stable public contract. These are examples of the type of features that will not be supported.

Building / Installing

The library uses CMakePresets.json as its build system. The naming convention for non-ci presets is {platform}[-renderer][-{build tool}]-dev[-debug]. Renderer presets build the platform's supported graphics tools. Renderer and mudl builds are supported on Linux and Windows only; macOS is not supported for the renderer because MoltenVK is not wired up yet. In debug presets, build files are written to a debug build directory. On macOS and Linux, Ninja is the build tool of choice so it is omitted. On Windows the default build tool is Visual Studio 2022.

Examples:

$ cmake --preset=linux-dev
$ cmake --preset=linux-renderer-dev
$ cmake --preset=macos-dev-debug
$ cmake --preset=windows-vs2019-dev-debug
$ cmake --preset=windows-renderer-dev
$ cmake --preset=windows-dev

Once your configuration is done, everything is the same between platforms. To build:

$ cmake --build --preset=default
$ cmake --build --preset=debug

To install all binaries and test data to local bin dir (build or build-debug):

$ cmake --install build --prefix=.
$ cd bin
$ ./rollnw_benchmark

To run ctest:

$ ctest --preset=default

Import and open a module project

Renderer presets build rollnw-client on Linux and Windows. JSON import needs an NWN:EE installation discoverable through the normal install probe or NWN_ROOT and NWN_HOME.

cmake --preset=linux-renderer-dev
cmake --build --preset=default --target rollnw-client
./build/tools/client/rollnw-client import --json \
    "$HOME/.local/share/Neverwinter Nights/modules/example.mod" \
    ./example-project
./build/tools/client/rollnw-client

The application opens recent projects from its Home workspace. Import is a separate, explicit transform so normal viewer startup does not repeatedly deserialize or rewrite the source module.

History

A lot of what's here was written in the 2011-2015 range as part of personal minimalist toolset, modernized and with new EE stuff added. In some sense, it's a work of historical fiction -- it's what I'd have suggested at the start of NWN:EE: get the game and the community on the same set of libraries. Similarly to an older project that asked what if Bioware had stuck with Lua? The answer to that was pretty positive: a decade ahead, at least, of nwscript.

Credits

About

rollNW is an homage to Neverwinter Nights in C++. Very much a WIP.

Topics

Resources

Stars

10 stars

Watchers

5 watching

Forks

Releases

Used by

Contributors

Languages