Skip to content

donmccaughey/fiends_and_fortune

Repository files navigation

Fiends And Fortune

Fiends And Fortune is a translation of paper and pencil role playing rules into code. Like the games that inspired this project, these programs are old-school, command-line oriented and text based. The core code is C99; I grudgingly use C++14 for the TUI.

GitHub Actions Code Coverage

Modules

Fiends And Fortune has modules for generating characters, dungeons, magic items and treasure. Currently, the character generator is very nascent; the dungeon generator is the most mature but still has some missing features and odd behavior.

Executables

Fiends And Fortune contains two executables: fnf and fiends. The fnf executable is a command-line tool that generates output as human-readable text and JSON. fiends is a full-screen text UI with a familiar menu and windows interface.

fnf Options

fnf: no action given
Usage: fnf [OPTIONS] ACTION

  -d, --debug         print debugging information
  -h, --help          display this help message and exit
  -j, --jrand48=SEED  use the jrand48 random number generator
                        with the given 48-bit SEED
  ---format=FORMAT    output format where FORMAT is
                        `text' or `json' (default `text'
  -v, --verbose       print more details

Available actions:
  character [METHOD]  generate a character where METHOD is
                        `method1', `method2', `method3', `method4',
                        `generalnpc', `specialnpc' or `simple'
                        (default `simple')
  check [N]           run tests where N is the "constant"
                        random number (default 0)
  dungeon [TYPE]      generate a dungeon where TYPE is
                        `random' or `small' (default `random')
  each                generate one of each treasure
  magic [COUNT]       generate COUNT magic items (default 10)
  map                 generate one treasure map
  table               generate the treasure type table
  LETTER              generate the treasure type for LETTER (A-Z)

fiends Screen Shot

fiends Screen Shot

Building From Source

Fiends And Fortune is tested on macOS and Linux. Building it requires that your system have a C/C++ toolchain and CMake 3.13 or later. Building on Linux requires libbsd and libgpm.

git clone https://github.com/donmccaughey/fiends_and_fortune.git
cd fiends_and_fortune
cmake -S . -B tmp
cmake --build tmp --target all test

This repository contains a copy of the source code for cJSON 1.7.16 and tvision commit 9c9608e dated 2023-05-23.

Build System

Fiends And Fortune uses Cmake as a build system, GitHub Actions for continuous integration, and Codecov.io for code coverage reporting.

Build Options

To build with the AddressSanitizer enabled, set the ADDRESS_SANITIZER option to ON.

cmake -S . -B tmp -DADDRESS_SANITIZER=ON

Mac users note that the clang that ships with Xcode support the -fsanitize=address flag, but doesn't support LeakSanitizer on Apple Silicon.

% ASAN_OPTIONS=detect_leaks=1 tmp/src/fiends/fiends
==43188==AddressSanitizer: detect_leaks is not supported on this platform.
zsh: abort      ASAN_OPTIONS=detect_leaks=1 tmp/src/fiends/fiends

(Last checked on macOS Ventura 13.4, Xcode 14.3, Apple clang version 14.0.3.)

Set the COVERAGE option to ON to generate coverage files.

cmake -S . -B tmp -DCOVERAGE=ON

Set the WALL option to ON turns on additional warnings using the -Wall compiler flag and also treats warnings as errors. WALL is off by default but is recommended for development and integration builds.

cmake -S . -B tmp -DWALL=ON

Set the GRAPH_TARGETS option to ON to visualize the relationships between Cmake build targets. This will generate the files fnf_targets.dot and fnf_targets.png in the tmp directory. Graphviz must be installed to use this option.

cmake -S . -B tmp -DGRAPH_TARGETS=ON

License

Fiends And Fortune is available under a BSD-style license. See the LICENSE file for details. The cJSON library is available under an MIT license. The code in the tvision library is available under a variety of permissive licenses.

About

Old school paper-and-pencil fantasy role playing rules in code.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published