Rifles in the Ardennes/Pacific | Mission Generator
Version?.?
Loading...
This page requires a HTML5-capable web browser. If you are
seeing this message for more than an instant after loading
the page, it's because initialization of the application
is not finished, which means that either this app is not
compatible with your browser or initialization is taking
unusually long. More information about the error may (or
may not) be available in your browser's so-called
"development tools". In compatible browsers, however, it's
likely that this message disappeared long before you could
read to the end of this paragraph.
Select the desired configuration options then use
the [Generate Mission] button to create
a PDF with the mission details. It will be shown in
the Mission tab, where it can previewed before downloading
it.
Use the buttons at the top of the page to switch between
tabs/views: Docs, Mission, About.
New options appear once a mission has been generated:
The [Toggle preview mode] button
toggles between plain text, JSON, and PDF preview.
Not all browsers support embedded PDF previews.
The [Rebuild PDF] button feeds the same
mission data through the PDF generator, and is useful when
you want to change the font size without generating a new
mission.
The generated mission can be previewed and downloaded
from the Mission tab. The filename
can be customized using the filename configuration
field in that tab:
MM and DD get replaced by the current month and day.
YY and YYYY get replaced by the current year with 2
or 4 digits, respectively.
## gets replaced by a random 5-digit number.
The following placeholders correspond to mission
configuration options:
%D = mission difficulty
%M = mission type
%T = mission terrain
The JSON Editor can be used to edit the specifics of
a mission. See the JSON Docs tab for a description
of the various JSON properties.
This mission generator is made available as a service to Rifles
players, but without any warranty or guarantees of future availability or
usability.
Mission generator TODOs include, in no particular order...
Pre-mission events.
Theater-specific enemy/event lists.
JSON export/import. Most of the bits for this are in place.
"Responsive" HTML layout (mobile-friendly).
Potentially a mini-map view. This first requires that we come up
with a syntax for explaining mission details, including random factors,
in a way the computer can understand (as opposed to natural text).
Export to epub might be interesting, but is low-priority.
...
TODO: help text and a button to toggle it on and off.
This section provides a description of the JSON format used by this mission generator/editor
tool. It assumes some knowledge of JSON and does not describe the specifics of JSON in general,
only the data elements used by this tool and the semantics it applies to them.
A mission is made up of a single top-level Object with many or all of the properties
described in the following sections. The easiest way to see these in action is to use
the "Generate Mission" feature, then toggle the preview mode to "JSON". Once a mission
is generated, it can also be imported into the JSON Editor and browsed or manipulated
from there.
The String & Numeric Fields
The following list describes the "basic" mission properties: those
defined as a single string or numeric value.
missionSchemaVersion
(integer, required): this describes the version number
of the mission JSON format. It must currently be set to
1. If/when the format changes this number will be
incremented. A mission without this field is not a valid
mission object and the app may refuse to import it
via the JSON editor.
name (string, required):
the brief name of the mission (e.g. "Attack on Blueberry Hill").
objective (string, required): a
description of the mission's objective. May be arbitrarily
long.
setup (string, required): a
description of the mission's setup instructions. May be
arbitrarily long.
turnLimit (integer,
optional): the number of turns permitted by the
scenario.
specialRules (string,
optional): description of mission-specific rules.
specialEquipment (string,
optional): description of any mission-specific
equipment.
support (string, optional):
description of any friendly support, e.g. off-board
artillery or reinforcements.
supportLabel (string,
optional): a brief, descriptive label for
the support, e.g. "Platoon
Support" or "Friendly Forces". If not set, but
support is, then a generic
default is used.
terrainRules (string,
optional): description of mission-specific terrain
rules.
difficulty (string,
optional): this is used by the app to modify generated
missions, but is not required for hand-written
scenarios. Values: EASY, NORMAL, HARD.
missionType (string,
optional): a single-word description of the mission
type. This is primarily used by automated mission
generators, and is not required for hand-written
missions. In technical terms, if provided, this value
should (must?) correspond to one of
the RiTA.missionGenerators entries (which
can be installed via RiTA.installMission().
terrainType (string,
optional): a single-word description of the mission's
overall terrain tendency. This is primarily used by
automated mission generators and is not strictly
required by hand-written missions. Currenly used
values include (but may not be limited to): URBAN,
COUNTRY, BEACH.
theater (string, optional
(mostly)): a one-word string describing the theater of
operations. This must be "PTO" for the Pacific theater
and "ETO" for the European theater. This is used by
mission generators to tweak terrain tables but is not
needed for hand-written missions.
author (string, optional):
an optional string containing the author's information
(whatever the author cares to include). It should be
kept brief, e.g. a name and URL, but not a paragraph.
This field, if set to a truthy value, is used as
the Author property of the mission's
generated PDF, and any given PDF view may or may not
limit the visible length of the value.
lastUpdated (date string, optional):
An ISO-8601-format
date string in any of these formats: YYYY-MM-DD,
YYYY-MM-DD HH:MM, YYYY-MM-DD
HH:MM:SS. It may optionally have a timezone
offset, but timestamps for this application are not
considered significant enough to warrant that level of
detail: YYYY-MM-DD will suffice for almost
all cases. It is up to the person editing the JSON to
set this because the Rita JSON editor component cannot
truly distinguish when a mission's data has "really"
been modified.
Event Table
The events list has a unique
structure in the mission data. It is an array of strings
describing the mission's Event tokens, but has one
unconventional atttribute: the first element in the array
(i.e. at index zero) is not used. The reason for
this is so that the game's event numbers match up with the
array index holding them, which reduces cognitive
dissonance while hand-coding mission generator
functions. It remains to be seen whether it will cause
more confusion than it saves in the JSON format ;). Any
element in the first array position (zero'th index) is
ignored by the mission generator app, so index 0 can
hypothetically be used to store anything the mission
creator likes. Any elements in indexes after the 0th which
are set to a "falsy" value (false, null, undefined, empty
string, or zero) are rendered as "Nothing" (or something
semantically equivalent) in the generated document.
Here's an example event table:
[
null, /* the 0th element is IGNORED so that Event numbers correspond to their array index! */
"Place the |Objective| in Stripe #1. Place the Defending Units as a single Group in Stripe #1",
"Place the |Objective| in Stripe #1. Place the Defending Units as a single Group in Stripe #1",
"Place the |Objective| in Stripe #2. Place the Defending Units as a single Group in Stripe #2",
null, /* null (any "falsy" value) renders as "Nothing" (or similar) */
null,
"Roll on [Patrol Table] on the Army Sheet",
"Roll on [Patrol Table] on the Army Sheet",
"Enemy: two Rifles on {Tree}"
]
RitaTables
Much of the information for a Rita mission is presented in the form of tables, and most
of these use an identical JSON structure, internally called "RitaTable":
{
header: "header text",
lines: [
"list",
"of",
"strings (one per line of the table)"
]
}
All of the mission elements described below use this structure. The
lines array property has a few formatting
options which apply to most of the tables:
Lines starting with a ! are output in bold.
Lines starting with a single space are output indented
a standardized amount. To simplify editing, most of the
standard tables get indented automatically, regardless
of this space! In particular, customTables
entries require this formatting option if they should be
indented.
Use a starting ! followed by a space to
get an indented bold line. (Exception: the
standard terrainTable field
uses its own bolding rules, described below.)
The following is a list of all RitaTable fields, none of which
are required (and all of which are demonstrated in detail in the
app's automatically-generated missions)...
enemyPresenceTable: Each
line lists a die roll result or range and the enemy
unit(s) which appear(s) for that result. This table's
lines are automatically indented.
enemyActivationTable: Each
line lists a die roll result or range and a description
of how the enemy unit(s) react for that result. This
table's lines are automatically indented.
enemyForcesTable: Each line
lists a die roll result or range and the enemy unit(s)
which appear(s) as a result. This table's lines are
automatically indented.
targetTable: this free-form
table typically has a top section describing which group
of the player's units will be targeted and a second
second describing which unit(s) in that group will be
targeted. This table is not automatically indented -
use the RitaTable formatting conventions to format it.
terrainTable: this table lists which terrain
goes into which Stripes and conventionally follows the following pattern:
{
"header": "My Terrain",
"lines": [
"Stripes #1 and #2: (1-2) Open (3-5) Woods (6) Fields)",
"Stripe #3: (1-4) Open with {Hill} (5-6) Woods with {Hill}",
"Stripe #4: (1-2) Open (3-5) {Trees} (6) {Building}",
"Stripes #5 and #6: (1-2) Open (3-4) Woods (5-6) {Building}"
]
}
(The numbers in parenthesis refer to die roll results.)
This table has the following peculiarities vis-a-vis the other tables:
The text of each line up to and including the first
colon gets bolded, but everything after that is not
bold. The ! formatting flag (bold)
is ignored for this table.
As a general rule (but this really depends on the
context), if this table is not set on a mission which
is passed through the mission generator then a terrain
table with certain random elements will be
automatically injected into it. (That does not apply
when a mission is its own mission generator nor when a
mission is fed directly from the editor to the
document renderer (both topics out of scope here for
the time being).) To suppress automatic generation of
such a table entirely, set its value
to false.
customTables: this is an
array of RitaTables containing any mission-specific
tabular information the creator desires. They are output to the
generated document in the order they appear in the
array. They are not automatically indented - use the
RitaTable formatting conventions to format them.
That about covers it! The easiest way to become familiar
with the data is to allow the app to generate a mission,
then peruse its JSON data via the JSON preview mode or the
JSON editor tab.