Triactor (JCD Piecepack)

Jonathan C. Dietrich is a notable piecepack designer who has written several piecepack games, developed VASSAL's piecepack module, and designed the JCD piecepack. In this demo we'll be making a starting diagram for the game Triactor that he co-authored using a piecepackr configuration that directly uses his JCD piecepack images contained in VASSAL's piecepack module.

JCD piecepack configuration


I contacted Jonathon C. Dietrich and he wrote that it is fine to use the VASSAL piecepack module images in game diagrams but that attribution is required.

The strategy for our JCD piecepack configuration will be to extract the gif images from VASSAL's piecepack module (which is actually a zip file) and then use piecepackr's picturePieceGrobFn to make a grob function that directly uses those images. If you don't want checkered tile backs set checkered=FALSE.


if (!file.exists("")) {
z1 <- ""
z2 <- unzip(z1, "piecepack/piecepack.mod", exdir=tempdir())
unzip(z2, exdir=tempdir())
directory <- file.path(tempdir(), "images")

jcd_filename_fn <- function(directory, set="piecepack", checkered=TRUE) {
    suits <- switch(set,
                    piecepack = c("s", "m", "c", "a"),
                    playing_cards_expansion = c("h", "p", "b", "d"),
                    four_seasons_expansion = c("f", "w", "u", "n"))
    ranks <- as.character(0:5)
    fp <- function(prefix, suffix) {
        file.path(directory, paste0(prefix, "-", suffix, ".gif"))
    function(directory, piece_side, suit, rank) {
        s <- suits[suit]
        r <- ranks[rank]
        sr <- paste0(s, r)
               coin_back = fp("coin", s), coin_face = fp("coin", r),
               die_face = fp("die", sr),
               pawn_back = fp("pawn", paste0(s, "2")),
               pawn_face = fp("pawn", paste0(s, "1")),
               tile_back = fp("tile", ifelse(checkered, "back1", "back2")),
               tile_face = fp("tile", sr))

credit <- c("This piecepack uses JCD Piecepack images from the VASSAL piecepack module by Jonathan C. Dietrich",

piecepack <- list(grob_fn = picturePieceGrobFn(directory, jcd_filename_fn(directory)),
                  border_color="black", border_lex.tile=4,
                  border_lex.coin=4, depth.coin=0.125,
                  width.pawn=0.75, height.pawn=(52/55)*0.75,
                  shape.pawn="concave5", shape_r.pawn=0.22,
                  edge_color.tile="#c5945a", edge_color.coin="#c5945a", edge_color.pawn="black",

pce <- piecepack
pce$grob_fn <- picturePieceGrobFn(directory, jcd_filename_fn(directory, set="playing_cards_expansion"))

fse <- piecepack
fse$grob_fn <- picturePieceGrobFn(directory, jcd_filename_fn(directory, set="four_seasons_expansion"))

jcd <- list(piecepack = pp_cfg(piecepack),
            playing_cards_expansion = pp_cfg(pce),
            four_seasons_expansion = pp_cfg(fse))


Triactor: A Day at the Piecepack Downs is a game by Jonathan C. Dietrich, Julie Taylor, and Ken MacKeigan that won "Best Eye Candy" in the 6th piecepack game design competition "Group Projects". We'll make a starting diagram for Triactor including embedding the optional Print-and-Play playmat that comes with it.

## Linking to ImageMagick
## Enabled features: fontconfig, freetype, fftw, lcms, pango, webp, x11
## Disabled features: cairo, ghostscript, heic, raw, rsvg
## Using 8 threads
library("ppgames", warn.conflicts=FALSE)
if (!file.exists("Triactor.pdf")) {
if(!require("pdftools", quietly=TRUE)) {
    install.packages("pdftools") # dependency for 'image_read_pdf'
## Using poppler version 0.86.1
playmat <- rasterGrob(as.raster(image_read_pdf("Triactor.pdf", pages=8)))

png("../share/rules/triactor.png", width=21, height=13, units="in", res=72)
pushViewport(viewport(x=unit(10.8, "in"), y=unit(6.6, "in"), width=unit(8.5, "in"), height=unit(11.0, "in"), angle=90))
pmap_piece(df_triactor(), envir=jcd, default.units="in", op_scale=0.5, trans=op_transform)
Starting diagram for Triactor.  Uses "JCD piecepack" ( graphics contained in VASSAL's piecepack module ( by Jonathan C. Dietrich ( and the Triactor ( playmat by Jonathan C. Dietrich, Julie Taylor, and Ken MacKeigan / "CC BY-NC-SA 2.0" (

Starting diagram for Triactor. Uses JCD piecepack images contained in VASSAL's piecepack module by Jonathan C. Dietrich and the Triactor playmat by Jonathan C. Dietrich, Julie Taylor, and Ken MacKeigan / CC BY-NC-SA 2.0


There are no comments yet.

Add a Comment

You can use Markdown or restructuredText to format your comment.