Skip to main content

Development Guidelines

Creating a Project

Installing this package adds a command-line tool that can be called from the terminal, called draft. You should be able to use draft --help to get a list of commands available. The general workflow is as follows:

Create a new project directory and navigate to that directory in your terminal. Use the draft init command to initialize a new DungeonDraft project. If you follow all the default options, like so:

$ draft init
Please enter information for your config file. These can be changed later.
Author: Jacob Lee
Pack Name: Example-DungeonDraft-Pack
Do you want to generate a new pack id now? Y/n: y
Your pack id is: YqtFEhSN
Where do you want to put packed assets? Leave empty to use the default: /home/jacoblee/Projects/Dungeondraft-Asset-Packs/resources/asset-tool/test/example-project/packed-assets
Would you like to create a workspace in /home/jacoblee/Projects/Dungeondraft-Asset-Packs/resources/asset-tool/test/example-project/workspace for asset development? This is optional, but may be useful. Y/n: y
New project initialized

it will create a folder structure like the following:

.
├── .draft
│   └── config.ini
├── packed-assets
├── unpacked-asset-tree
│   ├── data
│   │   ├── tilesets
│   │   └── walls
│   └── textures
│       ├── caves
│       ├── lights
│       ├── materials
│       ├── objects
│       ├── paths
│       ├── roofs
│       ├── terrain
│       ├── tilesets
│       │   ├── simple
│       │   ├── smart
│       │   └── smart_double
│       └── walls
└── workspace
    ├── drafts
    │   ├── caves
    │   ├── lights
    │   ├── materials
    │   ├── objects
    │   ├── paths
    │   ├── portals
    │   ├── roofs
    │   ├── terrains
    │   ├── tilesets
    │   │   ├── simple
    │   │   ├── smart
    │   │   └── smart_double
    │   └── walls
    ├── notes
    └── resources

So what are these?

.draft directory

This is the directory where configuration and logs are written. The init command created a file called config.ini. In this example, that file would look like:

[PROJECT]
name = Example-DungeonDraft-Pack
id = YqtFEhSN
author = Jacob Lee
workspace = /home/jacoblee/Projects/Dungeondraft-Asset-Packs/resources/asset-tool/test/example-project/workspace
packed_assets_dir = /home/jacoblee/Projects/Dungeondraft-Asset-Packs/resources/asset-tool/test/example-project/packed-assets

which includes the name of your asset project, the asset pack ID, and author information. It also gives the full paths to two special directories, which we'll discuss next. Although the file can be manually edited, it is intended that the tool be used to manage this and other files.

Packed Assets Directory

This is the directory where .dungeondraft_pack files are written when you use the draft pack command. I don't recommend you change this (and I haven't tested it anywhere else). Copy files from here to anywhere you need them, or point DungeonDraft's asset directory here.

Unpacked Asset Tree Directory

This directory is where the unpacked asset goes. While you can edit, add, and remove these files directly, this tool is intended to make the management of an asset easier. There is no guarantee that things will work correctly if ad-hoc custom changes are made outside of use of the tool.

Workspace Directory

This directory is intended as the place for you to do all the messy creative stuff you do, keeping the unpacked asset tree clean. You don't have to use it, but it is intended to be a reasonable, if opinionated, way of organizing your workspace. The tool does not assume that this directory exists.

Managing a Project

Adding an asset

To add an asset to the project, you use the draft add command. It requires three arguments, the asset type, the asset-key-name you'd like to use, and the path to the asset. e.g.

draft add wall dank-stone workspace/drafts/walls/dank-stone-wall-version-3.0.1.png

Assuming (of course), that there is a matching dank-stone-wall-version-3.0.1_end.png file, this will add the following to the unpacked-asset-tree/textures/walls directory:

dank-stone.png
dank-stone_end.png

and create an appropriate corresponding data file unpacked_asset-tree/data/walls/dank-stone.dungeondraft_wall.

Removing an asset

To remove an asset, call draft remove command. This takes two arguments. The asset-type and the asset-key-name. To remove the dank-stone-wall asset, you'd use the command:

draft remove wall dank-stone

Listing your assets

Use the draft list command to see what assets are in the unpacked asset tree.

Creating thumbnails

When you are ready to pack, if you want to, you can use this tool to create thumbnails, currently implemented only for terrain and for tilesets. This will create larger, close-up, thumbnails that can be embedded in the packed asset. Note: the thumbnail filenames use the pack id. If you change the pack id, you will need to regenerate the thumbnails (because the filenames will change).

To create thumbnails, use the command:

draft thumbify

This will create a directory in the unpacked asset tree called thumbnails

Packing your asset

Packing your assets is easy. Simply use the command:

draft pack [version]

The rest of the information (name, author, etc.) are in the draft tool's config file.

e.g.

draft pack 1.0.1

will create a new pack file in the packed-assets directory.

Metadata

Release files for ddraft-cmd-tool 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ddraft-cmd-tool 0.1.1
File Size Uploaded Provenance Actions
ddraft_cmd_tool-0.1.1.tar.gz 17.8 kB Without provenance Details for ddraft_cmd_tool-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ddraft-cmd-tool 0.1.1
File Interpreter ABI Platform Actions
ddraft_cmd_tool-0.1.1-py3-none-any.whl Python 3 none any Details for ddraft_cmd_tool-0.1.1-py3-none-any.whl

Total release size: 37.3 kB

Release files / ddraft_cmd_tool-0.1.1.tar.gz

Download URL ddraft_cmd_tool-0.1.1.tar.gz
Size 17.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7c2fd178ccbb98b1912fdabc21b27e40fd16ca47af6647db8e558ee52786af06
BLAKE2b-256 checksum
How to use checksums
dd9089e12b5b9ea5338784fb26c6b97ae5be5afc22d17531b6de33ba744186da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.17

Release files / ddraft_cmd_tool-0.1.1-py3-none-any.whl

Download URL ddraft_cmd_tool-0.1.1-py3-none-any.whl
Size 19.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3934469fa566f7193a5f4b3e7dff27a276ac80b3db4f32fa997710e14b10bcbc
BLAKE2b-256 checksum
How to use checksums
18eb7588a4d40b6c1eca4a440f4bea5c0252c8e5346cbfc778a26e4a3ce3329e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.17

Security for ddraft-cmd-tool 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page