Skip to content

theflyingape/dankdomain

Repository files navigation

🏰 Ɗaɳƙ Ɗoɱaiɳ :: the return of Hack & Slash


screenshot

Player's Manual

Read the Manual to play the online game

Ɗaɳƙ Ɗoɱaiɳ is the re-imagined classic Amiga bulletin board, Hack & Slash, built around a medieval role-playing atmosphere. Your character kills, steals, brawls, and jousts other PCs, NPCs, and BOTs to gain levels and fortune. Successful ventures into the deep dank dungeon are key to immortality.

Original Commodore Amiga Hack & Slash enthusiasts can visit Absinthe BBS by Anachronist.


[theflyingape@ddgame ~]$ sudo systemctl status dankdomain-portal
● dankdomain-portal.service - 🏰 Ɗaɳƙ Ɗoɱaiɳ portal service
   Loaded: loaded (/etc/systemd/system/dankdomain-portal.service; enabled; vendor preset: disabled)
   Active: active (running) since Sat 2023-07-08 08:30:20 EDT; 25min ago
 Main PID: 1029 (DDnet)
    Tasks: 11 (limit: 200)
   Memory: 71.8M
   CGroup: /system.slice/dankdomain-portal.service
           └─1029 DDnet

Jul 08 08:41:18 ddgame DDnet[1029]: Startup BOT #1 (IMA) from Old Timer's Tap → session 5668
Jul 08 08:41:18 ddgame DDnet[1029]: Classic Gate knock from remote host 119.77.138.76 → session 5666
Jul 08 08:52:26 ddgame DDnet[1029]: City Gates knocked from remote host: 100.40.9.157 (play.ddgame.us)

%%{init: {'theme':'dark'}}%%
stateDiagram-v2
  direction TB
  Local : 👤 Local Player
  Local --> main : npm run play
  Remote : 🌐 Remote Players
  Remote --> Firewall : telnet
  Remote --> Apache : https
  Firewall : 🛡️ Firewall
  Firewall --> tty : 1986
  state "🕸️ Apache (optional)" as Apache {
    state "SSL Proxy (localhost:1939)" as proxy {
      state "🖧 Ɗaɳƙ Ɗoɱaiɳ portal service (DDnet)" as DDnet {
        app --> tty : telnet-socket
        app --> bot : timer
        app --> websocket : http/ws
        app --> rest : express
        app --> static : express
        fork: node-pty
        tty --> fork
        bot --> fork
        websocket --> fork
        fork --> main : fork
      }
      --
      state static {
        state bundle.js {
          client --> animate.css
          client --> xterm.js
        }
        assets
        images
        sounds
      }
    }
  }

  state "🏰 Ɗaɳƙ Ɗoɱaiɳ (DDplay)" as DDplay {
    main --> lib
    lib --> items
    lib --> runtime
    lib --> xvt
    main --> sys
    main --> init
    init --> db
    init --> pc
    init --> npc
    init --> player
    state login <<choice>>
    init --> login : login id?
    login --> taxman : bot or user
    login --> newuser
    state newuser {
      email
      email --> nodemailer
      nodemailer --> 📧
    }
    state taxman {
      state "💰" as taxes
      taxes --> battle : refuse
      taxes --> menu : paid
      menu --> library
      menu --> sysop
      menu --> arena
      menu --> dungeon
      menu --> naval
      menu --> party
      menu --> tavern
      menu --> casino
      menu --> square
      arena --> battle
      dungeon --> battle
      naval --> battle
      party --> battle
      tavern --> battle
      casino --> taxes
      square --> taxes
      tavern --> taxes
      state "🏦" as bank
      casino --> bank : atm
      square --> bank : bank
    }
  }
Loading

NPM

Code Preview ... or just press dot (.) on your keyboard

npm version Libraries.io dependency status for latest release GitHub milestones

Installation

Project development on Chrome OS and Linux with the Node.js runtime. To run a local game copy, click the VS Code icon above or manually install:

# fetch this package source:
$ git clone https://github.com/theflyingape/dankdomain
# ... or via Node.js
$ npm install dankdomain

# cd into package source folder:
$ npm install

# 1) play it as standalone:
$ npm run play

# modify for your server networking preferences:
$ cp etc/network.json_inet etc/network.json
$ vim etc/network.json

# 2) run it as a local multiuser server:
$ npm run net &
$ npm run term
$ npm stop

# 3) other ways to play online:
$ npm run mame
$ npm run term play.ddgame.us
$ telnet play.ddgame.us
Connected to play.ddgame.us.
Escape character is '^]'.
CARRIER DETECTED
PC emulation enabled
            ...........|\...................../|................. Welcome to
             ........./  \..|\__  __/|......./  \............... Dank Domain
            ........./ /  \.\ _ \/ _ /....../    \.............
      _  .........../ / /  \.(-)\/(-)....../  / \ \.............
     (_)  ..........| | | / \\/(oo)\/...../  // |\ \.............
          ..........| | | |  \|v--v|\..../  / | || \|...........
        ............| | | | / \_^^_/ \../  / || || ||.............
           ......../ / /  | |   \/    \/  /| || || ||/\../\....
            /\..../ / /  / /  |______/   /| \ \ || ||  \/  \    /\        /\
 /\      /\/  \../ / /  / /  /\_____/  |/ /__\ \ \ \ \ /    \  /  \  /\  /  \
/  \/\  / /    \.| | | / /  /\______/    \   \__| \ \ \      \/    \/  \/    \
    \ \/        \| | | | | |\______       \_    \__|_| \     /      \  /
     \/          | | ____ /\______ ____     \_       \  |   /         /
      \          | |/    /\_____  /    \      \__     \ |
       \         |/ |   |\______ |      |        \___  \|
                    |   |\______ |      |            \_
            _   ___/|   |\______ |      |          /\  \   ___
           / \_/     \   \________\_    _\____/   /  \__\_|   \
       ___/ __     __/   /       __/   /__    \__/      __     \__
     _/    /  \   /  ___/       /  ___/   \            /  \       |__
    |     |      |/|/          |/|/        \__    \        \         |

Who dares to enter my dank domain <or NEW>?

NOTE: my "public" access packages are published on GitHub and it requires your Personal Access Token authentication to fetch/install them from this alternative npm registry. Read GitHub's Working with the npm registry to learn more details.

# setup local Node.js package
$ npm config set @theflyingape:registry https://npm.pkg.github.com
$ npm login --scope=@theflyingape
$ npm install @theflyingape/dankdomain

... or use Docker (convenient and uses the latest commits):

$ docker pull theflyingape/dankdomain
$ docker run --rm -it -p 1939:1939/tcp -p 1986:1986/tcp theflyingape/dankdomain

Dank Domain (DDnet) started on linux #661
cwd /usr/games/dankdomain/game → /usr/games/dankdomain/game/portal
initializing Deeds
initializing Online
initializing Rings (unique)
 + adding ⚛️ Atomic
 + adding ✝️ Faith
 + adding ♾️ Infinity
 + adding 🐍 Medusa's
 + adding 🕳️ Mystic Portal
 + adding 👹 Ogre
 + adding 🖤 Undying
 + adding ⚪ White Wizard
initializing Players
initializing Gangs
 + adding AB Original with BOT+NPC members
 + adding (the) Monster Mash
ENOENT: no such file or directory, open '/usr/games/dankdomain/game/etc/network.json'
→ listening on telnet 0.0.0.0:1986
→ listening on https://0.0.0.0:1939/
↔ WebSocket endpoints enabled

Supports running as a BBS door (as Amiga-only BBSes did for Hack & Slash in 1994) by allowing a passed user numeric ID paired with a compatible Mystic door.sys file format launched from its BBS node startup directory. Here is how to freshly unit-test that app startup mode:

[~/dankdomain]$ npm run clean
[~/dankdomain]$ cd game
[~/dankdomain/game]$ cp door-example.sys door.sys
[~/dankdomain/game]$ node main 0

For example, configure to call-out to a script with two (2) parameters: userId and the path with filename to door.sys

#!/bin/sh
pwd; [ -s "$2" ] || exit 1
cp "$2" /usr/local/games/dankdomain/door.sys
node /usr/local/games/dankdomain/main "$1"

FAQ

  • What does etc/sysop.json do? How do you assign sysop privileges?

This file simply regulates some of the game features loaded at runtime. The first Player (non-NPC) to register is automatically entitled as the Ruler off the last object entry in files/items/title.json which is packaged here as either the (M) King or (F) Queen access role. The Ruler alone is granted with minor "favor" over their domain, but aligned with the game play & spirit if not abused. Other roles can have sysop: true enabled to gain access to "@" and some overlapping favor with the Ruler as you'd expect from a minion.

NOTE: in users folder, edit a hidden (dot) export file to carefully modify any Player's record and save as save.json whereas a running DDnet app.js portal service (npm run net) will automatically consume and apply it to the dankdomain.sql Players table.

  • What's the best way to modify Player time limits and timeouts throughout the game?

Refer to files/items/title.json for player runtime values based on their access role -- assigned or achieved by reaching the next promote level. There are no soft-coded values for the timeouts assigned to the various prompts. Those have been specially tweaked to keep turn-play moving along -- appropriately. That said, try modifying vt.defaultTimeout seconds in main.js to your liking.

Files directory structure

For the Portal, consider downloading media packs: 📷 images and 🔉 sounds into the appropriate game/portal/static folder:

$ pwd
/usr/games/dankdomain
.vscode           Visual Studio Code: settings & debug profiles
game
  etc             sysop support files
  files           game, menu & player support files: ANSI and/or text formats
    arena         ASCII art & menu files
    casino        menu files
    dungeon       ASCII art
    items         game artifacts
    library       deeds & menu files
    main          about system & menu files
    naval         ASCII art & menu files
    party         instruction & menu files
    player        ASCII art
    square        menu files
    tavern        all player events logged for the day
    user          each player’s events logged since last visit
  pcs             user object type templates for BOTs, NPCs, and PCs
  play            game modules for each main menu item
    battle.js     support module for player engagements
    init.js       support module for initial login
    runtime.json  game play runtime values
    sysop.js      support module for the system operator - main menu "@" command
  portal
    static        UI html/css/js using bundle.js: client.js & xterm.js
      assets      app install, fonts, etc.
      images      visual media for artifacts, creatures, and players
      sounds      audio media for event notifications
    app.js        DDnet for optional web and/or telnet services to run DDplay remotely
  users           player runtime database & current game files
  db.js           net & play module for player runtime database & files
  email.js        support module for (optional) dispatching email notifications
  interfaces.js   TypeScript object types
  items.js        support module for loading item artifacts & coin
  lib.js          support module for common I/O functions
  main.js         DDplay client node
  npc.js          support classes for BOTs & NPCs with arena, dungeon, and naval denizens
  pc.js           support classes for PCs with Deeds
  player.js       support module for common PC functions
  runtime.js      global runtime variables to govern play
  sys.js          support module with discrete functions to dependencies
  telnet.js       telnet client using websocket and XT emulator handling
  types.js        TypeScript template literals
mame              player - MAME VT240 terminal + socat startup script
node_modules      Node.js support libraries
package.json      Node.js manifest

🇺🇸 ©️1991 - 2024 Robert Hurst

Gallery

Node.js dependency tree

DDnet portal

app

  • chokidar, dns, express, fs, http, https, net, node-pty, ws
  • sys: fs, got, path, romanize, sprintf-js, title-case
  • items: sys
  • db: better-sqlite3, items, sys
  • network service options
    • telnet: net-keepalive, telnet-socket
    • web: url

client

  • animate.css, browserify, xterm, xterm-addon-fit, xterm-addon-unicode11, xterm-addon-web-links, xterm-addon-webgl

DDplay game

main

  • sys: country-flag-emoji, fs, fast-geoip got, path, romanize, sprintf-js, title-case
  • lib: items, runtime, sys, xvt
    • items: sys
    • runtime: sys
  • init: db, items, lib, npc, pc, player, runtime, sys
    • db: better-sqlite3, items, sys
    • pc: db, items, lib, runtime, sys
    • npc: db, items, lib, pc, runtime, sys
    • player: db, items, lib, npc, pc, runtime, sys
    • email: db, items, lib, nodemailer, nodemailer-smtp-transport, pc, runtime, sys
    • newuser: db, email, init, items, lib, pc, runtime, sys
    • taxman: db, items, lib, pc, player, runtime, sys
      • battle: db, items, lib, npc, pc, player, runtime, sys
      • menu: battle, db, items, lib, npc, pc, player, runtime, sys
        • arena: battle, db, items, lib, npc, pc, player, runtime, sys
        • casino: db, items, lib, npc, pc, player, runtime, sys
        • dungeon: battle, db, items, lib, npc, pc, player, runtime, sys
        • library: db, items, lib, npc, pc, runtime, sys
        • naval: battle, db, items, lib, npc, pc, player, runtime, sys
        • party: battle, db, items, lib, npc, pc, player, runtime, sys
        • square: battle, db, items, lib, npc, pc, player, runtime, sys
        • sysop: battle, db, dungeon, email, lib, pc, player, runtime, sys
        • tavern: battle, db, items, lib, npc, pc, player, runtime, sys, taxman