4 releases (2 breaking)

Uses new Rust 2024

0.4.0 Oct 12, 2025
0.3.0 Jun 20, 2025
0.2.2 Mar 10, 2025
0.2.1 Mar 10, 2025

#3 in #floor

47 downloads per month

MPL-2.0 license

67KB
984 lines

dcss-scenario-builder

dcss-scenario-builder creates scenarios in Dungeon Crawl Stone Soup's (DCSS) Webtile using dcss-api in wizmode from a yaml file. It can create any floor layout, from any feature, and add any item or monster. The yaml generally works with the Vault Design Reference Guide.

Example

This example will create a two floor dungeon (D:1 and D:2), with a scroll and sword on the first floor (second room, past the door) and with a Kobold on the second floor.

options:
  default_feature: "floor"

levels:
  - level:
      name: D:1
      features:
        - '< = exit_dungeon'
        - '> = stone_stairs_down_i'
        - '# = rock_wall'
        - '. = floor'
        - '+ = closed_door'
      items:
        - 'x = Scroll of identify'
      map: |-
          #########
          #...#...#
          #.<.#.x.#
          #...#...#
          #.@.+...#
          #...#...#
          #...#.>.#
          #...#...#
          #########

  - level:
      name: D:2
      features:
        - '< = stone_stairs_up_i'
        - '# = rock_wall'
        - '. = floor'
      monsters:
        - 'k = Kobold'
      map: |-
          #########
          #.......#
          #.<.....#
          #.......#
          #.......#
          #.......#
          #.....k.#
          #.......#
          #########

start_game_with_scenario, in combination with the Webtile from dcss-api is used to build the scenario in Rust.

// Connect to DCSS Webtile
let mut webtile = Webtile::connect("ws://localhost:8080/socket", 0)?;

// Empty message queue;
while webtile.get_message().is_some() {}

// Log in (to a user called "Username", with a password "Password")
let _gameid = webtile.login_with_credentials("Username", "Password")?;

// Create scenario
start_game_with_scenario(
    &mut webtile,
    "dcss-0.33",
    "b",
    "i",
    "c",
    "./scenarios/docs/readme.yaml",
)?;

// Empty message queue;
while webtile.get_message().is_some() {}

webtile.disconnect().expect("Failed");

Dependencies

~5–11MB
~233K SLoC