Table of Contents:
This page describes, more or less, how to use the Dark Venture card tools. In short, these tools exist to allow creation of custom content for the Dark Venture line of tabletop games. As of this writing, it is limited to Heroic Quest and Side Quest cards.
This document assumes some knowledge of HTML, CSS, JSON, and a little bit of JavaScript. HTML and CSS are the core-most aspects of these tools, with JSON and JavaScript being used to simplify creation of HTML/CSS-based cards.
The source code for this page and its tools can be found at fossil.wanderinghorse.net/r/darkventure.
License and Permission: all of the graphics used by these tools (card backgrounds, faction logos, and character attribute glyphs) are ©2020 Gilded Skull Games, all rights reserved, used and redistributed here with express permission. Users of these tools are permitted to redistribute them for use with these tools (or a derivative of these tools), and to freely redistribute cards created with these tools, with the limitation that these graphical assets may not be legally distributed in conjunction with commercial works without prior express permission from Rob Lemon (https://boardgamegeek.com/user/gildedskull).
Contrariwise, the source code related to these tools (HTML, CSS, and JavaScript) may be distributed, derived, and redistributed for any purposes, subject to the MIT License (https://opensource.org/licenses/MIT), with Stephan Beal (https://wanderinghorse.net/home/stephan/) being the copyright holder for purposes of the MIT license.
A picture is worth a thousand words, so...
It is important to keep the following in mind:
Both Heroic Quests and Side Quests have identical DOM structures. They differ mainly in their CSS classes and how CSS lays out those structures. This section describes that layout and the corresponding CSS classes.
General notes:
Quest cards can be (and are intended to be) implemented using a simple JSON-format data structure, which is much simpler for users to deal with than hand-writing their DOM-based counterparts. Each card, whether it's a Side Quest or Heroic Quest, can be represented as a JSON object with the following properties:
Future versions of these tools may add additional fields, e.g. metadata required by an editor application. No such hypothetical fields are expected to be visible to end users of the cards, so they will not affect the layout.
Examples, with their JSON on the right and rendered forms on the left: (ACHTUNG: current (as of late 2024) Firefox versions mis-calculate the line-height of cards and may render text way out of bounds. Chromium-based browsers do not misbehave that way.)
Note that the boxed areas in the cards are baked in to the background graphics and will not resize to fit larger text. Side Quests, in particular, must be kept brief.
In order to prevent that game card text can contain arbitrary HTML (which would pose a potential security risk for those who view the cards), these tools offer a custom markup format, processed by JavaScript, which provides "most of what one needs" to decorate card text with things like *italics*, **bold**, {{u}}underlining{{/u}}, and various game-specific glyphs (namely attribute and faction icons like {::MIND::} and {::F_CONSTRUCT::}).
General notes and limitations include:
Markup | Effect |
---|---|
*italic* | *italic* |
{{i}}italic{{/i}} | {{i}}italic{{/i}} |
**bold** | **bold** |
{{b}}bold{{/b}} | {{b}}bold{{/b}} |
***bold italic*** | ***bold italic*** |
{{bi}}bold italic{{/bi}} | {{bi}}bold italic{{/bi}} |
{{asterisk}} | {{asterisk}} (a literal asterisk) |
{{u}}underlined{{/u}} | {{u}}underlined{{/u}} |
--- | Horizontal separator (thin) |
=== | Horizontal separator (thick) |
{{br}} | Forced line break. |
"For historical reasons," the markup has two general styles of markup for keywords and game-specific glyphs (icons). Tags in the form {:XYZ:} and {::XYZ::} represent game-specific glyphs and keywords. The form with a single colon on either side resolves to a glyph with (if available) its capitalized keyword to the left. The form with two colons resolves to only a glyph. (Again, this distinction is historical: the game for which this was originally written always writes keywords with their associated icon.) The following table demonstrates the available keyword/glyph tags and how they appear when resolved...
Tag Word | {::TAGWORD::} | {:TAGWORD:} |
---|---|---|
Attributes | ||
MIND | {::MIND::} | {:MIND:} |
POWER | {::POWER::} | {:POWER:} |
SPEED | {::SPEED::} | {:SPEED:} |
LUCK | {::LUCK::} | {:LUCK:} |
Health | ||
HEALTH | {::HEALTH::} | {:HEALTH:} |
HEALTH_BASE | {::HEALTH_BASE::} | {:HEALTH_BASE:} |
Factions | ||
F_ARISTOCRACY | {::F_ARISTOCRACY::} | {:F_ARISTOCRACY:} |
F_BEAST | {::F_BEAST::} | {:F_BEAST:} |
F_BLOODSMAN | {::F_BLOODSMAN::} | {:F_BLOODSMAN:} |
F_CELESTITE | {::F_CELESTITE::} | {:F_CELESTITE:} |
F_CONSTRUCT | {::F_CONSTRUCT::} | {:F_CONSTRUCT:} |
F_DIAMOND | {::F_DIAMOND::} | {:F_DIAMOND:} |
F_GHOST | {::F_GHOST::} | {:F_GHOST:} |
F_HUNTSMAN | {::F_HUNTSMAN::} | {:F_HUNTSMAN:} |
F_ORPAL | {::F_ORPAL::} | {:F_ORPAL:} |
F_OVOID | {::F_OVOID::} | {:F_OVOID:} |
F_PLANT | {::F_PLANT::} | {:F_PLANT:} |
F_VARPEN | {::F_VARPEN::} | {:F_VARPEN:} |
F_WARLOCK | {::F_WARLOCK::} | {:F_WARLOCK:} |
Dice Faces (have no keywords) | ||
1 | {::1::} | {:1:} |
2 | {::2::} | {:2:} |
3 | {::3::} | {:3:} |
4 | {::4::} | {:4:} |
5 | {::5::} | {:5:} |
6 | {::6::} | {:6:} |
Note that the images are sized (via CSS) to fit their surrounding text, so a larger font size will result in correspondingly larger glyphs.
To create your own cards, edit these files, included in the same distribution as this file:
Add, edit, and/or remove cards to suit, then print out the page, being sure to note the caveats and limitations of card printing.
To create several independent sets of cards: copy one of those HTML files, and optionally its like-named JavaScript file, to a new file and rename, if needed, the JavaScript file reference at the bottom of the new HTML file to point to the renamed JavaScript file. It is possible to mix card types within a single file, as scratchpad.* demonstrates, but print results are generally better if each file contains only a single type of card (as sidequest.* and heroicquest.* do).
Note that the above files, as well as any copies made of them, need to live in the same directory as this file so that they can find the various resources (images, fonts, and CSS) used by the card tools.
Cards created with these tools can be printed directly from one's browser, either to a printer or to a PDF. There are, however, caveats and things to be aware of...
Multi-page printing: When printing cards from any pages in this collection, the only reliable way to get major browsers to wrap cards at page boundaries, rather than truncate them when spanning pages, is to ensure that all cards being printed are placed directly in the page's BODY element, not wrapped in a sub-element. For example, using a table to line them up or a DIV to group them will lead to truncation. That's an unfortate quirk which affects all known browsers and for which there is no known workaround. Thus, when creating HTML files of cards, make sure the cards are all direct children of the page's BODY element. When using the provided page templates for creating cards, that's already taken care of.
Background colors and images: Browsers may choose not to print background images and colors, and might (depending on the environment) need to be explicitly told to do so. The included CSS provides a hint to the browser that it should print such things, but if your printouts do not include background colors or images (e.g. the card backgrounds), make sure they're enabled in your platform's print job configuration dialog.
Resolution and Scaling: Modern browsers, when printing or generating a PDF, will transform the cards to vector-format graphics suitable for printing at effectively any resolution (with the limitation that the card background graphics are bitmaps, so have a limited resolution). Printing them at 100% scale will produce cards size-compatible with those which come with the game. Note, however, that there may be slight color differences from printer to printer, so do not expect a 100% perfect match against the originals!
Inconsistencies across browsers: Each browser has its own quirks with regards to the finer details of HTML and CSS layout. Two different browsers might even understand "use this font in 12pt size" to mean two slightly different things for "12pt". These tools are tested solely with some version of Chromium and Firefox, and it has been my not inconsiderable experience that Firefox, more often than not, does a slightlly better job of it. (Chromium, however, is the only one which can be fully automated to batch-print cards.) Thus if the cards don't look right to you on one browser, try another (noting that many browsers nowadays are internally based on Chromium's rendering engine).
Inconsistencies, part 2: Similarly to the above point, any given browser may lay out cards inconsistently. e.g. it may choose to print X cards on page 1 of a printout and X-3 or X+3 cards on every other page. They may also ignore explicit margin and similar layout fine-tuning, or may apply them inconsistently across pages or rows within a page, and there's nothing we can do about that. Though HTML and CSS give us a fairly good level of control over the layout, it does not provide the pixel-level precision of Postscript or PDF. (That's normally a good thing, as it allows us to delegate all layout to the browser, but it occasionally bites us.)
When the cards are printed to PDF, that PDF can then be imported into a vector graphics editor (e.g. Inkscape) to create SVG-format copies of the cards (noting that the card border/background images are bitmaps, not vector graphics). When importing to Inkscape, make sure to use the "poppler" import/conversion option (which is not the default!), as it will not only produce far better results than the default option, but will convert all text to "paths," which means that they are no longer editable as text but are 100% faithful conversions. Without that, the text will only look correct in Inkscape if Inkscape has the exact same font installed. It's been my experience that the default (non-poppler) import process produces fairly horrid results on just about any inputs, and should never be used when fidelity with the original is desired. Poppler conversion is relatively slow, but its results are unbeatable.
Why might one want to convert them to SVG? They can easily be laid out in one's graphical or desktop publishing software of choice for more precise printing than is possible with HTML. e.g. to include cut lines or place them side-by-side or front-to-back with card backs.