Fork me on GitHub

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

Note

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.

library("piecepackr")

if (!file.exists("Piecepack_v0_15_BUNDLE.zip")) {
    download.file("http://www.vassalengine.org/mediawiki/images/6/6a/Piecepack_v0_15_BUNDLE.zip")
}
z1 <- "Piecepack_v0_15_BUNDLE.zip"
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)
        switch(piece_side,
               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",
            "\thttp://www.piecepack.org/JCD.html",
            "\thttp://www.vassalengine.org/wiki/Module:Piecepack",
            "\thttps://www.ludism.org/ppwiki/JonathanDietrich",
            "\thttps://www.ludism.org/ppwiki/VassalModule")

piecepack <- list(grob_fn = picturePieceGrobFn(directory, jcd_filename_fn(directory)),
                  suit_color="#c54242,#8c8c7b,#bdb53a,#429cc5,black",
                  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",
                  credit=credit)

pce <- piecepack
pce$grob_fn <- picturePieceGrobFn(directory, jcd_filename_fn(directory, set="playing_cards_expansion"))
pce$suit_color="#c03a3a,#848473,#848473,#c03a3a,black"

fse <- piecepack
fse$grob_fn <- picturePieceGrobFn(directory, jcd_filename_fn(directory, set="four_seasons_expansion"))
fse$suit_color="#e9bf60,#eee0cd,#9ce0dc,#eb88c4,black"

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

Triactor

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.

library("grid")
library("magick")
## Linking to ImageMagick 6.9.10.23
## Enabled features: fontconfig, freetype, fftw, lcms, pango, webp, x11
## Disabled features: cairo, ghostscript, rsvg
## Using 8 threads
library("ppgames", warn.conflicts=FALSE)
if (!file.exists("Triactor.pdf")) {
    download.file("http://www.piecepack.org/rules/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))
grid.draw(playmat)
popViewport()
pmap_piece(df_triactor(), envir=jcd, default.units="in", op_scale=0.5, trans=op_transform)
invisible(dev.off())
Starting diagram for Triactor.  Uses "JCD piecepack" (http://www.piecepack.org/JCD.html) graphics contained in VASSAL's piecepack module (http://www.vassalengine.org/wiki/Module:Piecepack) by Jonathan C. Dietrich (https://www.ludism.org/ppwiki/JonathanDietrich) and the Triactor (http://www.piecepack.org/rules/Triactor.pdf) playmat by Jonathan C. Dietrich, Julie Taylor, and Ken MacKeigan / "CC BY-NC-SA 2.0" (http://creativecommons.org/licenses/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

Comments


There are no comments yet.

Add a Comment

You can use Markdown or restructuredText to format your comment.

links

social