Releases: piecepackr/ppgames
ppgames v0.8.1
New features
-
New function
save_pocketmod()
which is an alternative tosave_ruleset()
that saves the ruleset as a "pocketmod" booklet (#110). -
New function
names_rulesets()
lists the games we can generate rulesets for (#144). -
save_ruleset()
/save_rulebook()
can now export to non-pdf formats usingpandoc
(#76).
We can customizepandoc
output using the newcmd_options
argument, by default
we try to pick reasonable defaults based on the file extension and whether its a book or ruleset.
Quality varies for the various output formats buthtml
,epub
, anddocx
export looked "okay". -
save_ruleset()
/save_pamphlet()
/save_pocketmod()
support new argumentsgame_info
,game_files
,
andsave_promo_fn
(#115).
This allows users to generate rulesets using files not located within the{ppgames}
package. -
save_ruleset()
/save_pamphlet()
/save_pocketmod()
can now embed XMP metadata including
Creative Commons license info into pdf output (#71).
Requires suggested package{xmpdf}
and the command-line toolexiftool
. -
We now export
normalize_name()
which normalizes game names into a standard format
for use in R/LaTeX variable names and for use in filenames. -
We now export
save_promo_image()
which saves promo images for games.
Default argument for thesave_promo_fn
argument insave_pamphlet()
/save_pocketmod()
. -
New starting board generators for specific games:
df_black_pawn_trucking()
df_brain_burn()
df_burbuja()
df_cardinals_guards()
df_change_change()
df_chariots()
df_climbing_man()
df_cribbage()
is a new alias fordf_cribbage_board()
df_crocodile_hop()
df_galaxy_express()
df_lab_rats()
df_ludo()
(#119)df_minishogi()
df_one_man_thrag()
df_piecepack_halma()
is a new alias fordf_chinese_checkers()
df_sarcophagus()
df_shopping_mall()
df_speedy_towers()
(currently supports two players only)df_steppin_stones()
df_the_penguin_game()
df_tracers()
df_tula()
now supports argumentvariant
and Tim Schutz's variants 1-4
-
save_ruleset()
/save_pamphlet()
/save_pocketmod()
now supports ruleset generation for:- "ludo" (#119)
- "speedy towers"
-
Improved rulesets for:
ppgames v0.7.0
New features
-
There is now a Shiny PPN viewer which can be
launched viaview_game(game, shiny=TRUE)
or
shiny::runApp(system.file("shiny/ppn_viewer", package = "ppgames"))
(#27) -
cat_piece()
'scolor
argument now supports the value"html"
which will colorize
the output for HTML usingfansi::sgr_to_html()
. -
cat_piece()
,plot_move()
, andanimate_game()
now support the new argumentannotation_scale
which stretches (or contracts) the placement of the annotated coordinates.
By default it uses thescale_factor
attribute of thedf
argument if present else 1 (#105). -
cat_piece()
supports new "style" argument which alters which
Unicode characters are used in the diagram. -
New starting board generators for specific games:
df_brandubh()
Bug fixes and minor improvements
-
The "white" background color produced by
cat_piece()
ifcolor != FALSE
is now less grey. -
cat_piece()
will no longer override an explicitly setcolor=TRUE
toFALSE
when writing to files. -
cat_piece()
now returns an invisible""
instead ofNULL
when passed zero-row input. -
The (invisible) character vector returned by
cat_piece()
is now length one. -
cat_move()
no longer throws an error for moves that result with zero pieces on the board (#96) -
The
annotate
argument incat_piece()
,plot_move()
,animate_game()
now supports using "none" as an alias toFALSE
and "algebraic" as an alias toTRUE
(#97) -
plot_move()
now invisibly returns a list with the dimensions of the resulting image. -
In game starting functions with argument
seed
we now usewithr::local_seed()
instead ofset.seed()
and ifseed = NULL
we don't try to set any seed at all (#112). -
There are now more informative error messages being raised by
rlang::abort()
(#109, #111). -
Set/tweaked suits/ranks in following board generators to guarantee each piecepack piece is completely unique:
df_international_chess()
akadf_chess()
df_the_in_crowd()
df_xiangqi()
-
Spread out tile groups further in:
df_backgammon()
-
Fixes a bug in setting coin ranks in
df_triactor()
.
v0.6.1
New features
-
Portable Piecepack Notation enhancements:
-
There is now support for "relative" locations (#56):
-
<x,y>
meansx
units to the right andy
units up from the pieces' current location(s) -
<x,y>|Location
meansx
units to the right andy
units up fromLocation
-
<x,y>$PieceId
is a shortcut for<x,y>|&PieceId
-
nDirection
means movingn
units in theDirection
direction -
from the pieces's current location(s)
-
nDirection|Location
means movingn
units in theDirection
direction fromLocation
-
nDirection$PieceId
is a shortcut fornDirection|&PieceId
-
These are the supported direction (where "North" is considered "Up"):
- N, E, S, W, U, R, D, L are orthogonal moves for a rectangular board or a hexagonal board
- NE, SE, SW, NW, UR, DR, DL, UL are diagonal moves for a rectangular board
- NNE, ENE, ESE, SSE, SSW, WSW, WNW, NNW,
UUR, RUR, RDR, DDR, DDL, LDL, LUL, UUL are diagonal moves for a hexagonal board
-
-
N?PieceSpec
is now a shortcut forN&?PieceSpec
-
!PieceId
is now a shortcut forPieceId-<0,0>
-
An empty PieceId now refers to the "last active" piece(s)
-
An empty Location now refers to the location of the "last active" piece(s) (#90)
-
Brace expansions are now expanded before semi-colons are
-
There is now support for rotating pieces around a reference location/pieces (#86):
PieceId@>Angle|Location
means rotatingPieceId
piecesAngle
angle aroundLocation
locationPieceId1@>Angle$PieceId2
is a shortcut forPieceId1@>Angle|&PieceId2
PieceId$>Angle
is a shortcut forPieceId@>Angle$PieceId
-
The
+
move token "flips" pieces (#87)- If "pyramid_top" flips to "pyramid_face"
- Other pyramid sides flip to "pyramid_top"
- "die_face" flips to "die_face" but with a new rank plus three mod 6
- Other pieces flip back and forth from "back" <-> "face", "top" <-> "base", "left" <-> "right"
-
-
New function
view_game()
provides a simple command-line PPN viewer/editor. -
New function
cat_game()
renders a plaintext animation of a game within the terminal. -
New function
write_ppn()
takes a list of parsed PPN files and writes it to a file. -
New starting board generators for specific games:
df_chinese_checkers()
withdf_mini_halma()
as an aliasdf_coin_collectors()
df_easy_slider()
df_evade()
df_iceberg()
df_grasshopper()
df_jul_gono()
df_landlocked()
df_mathrix()
df_quatri()
df_pass_the_food()
df_piece_gaps()
df_piece_packing_pirates()
df_piecepack_klondike()
df_skyscrapers()
df_slides_of_action()
df_the_magic_bag()
df_tower_of_babel()
-
save_ruleset()
/save_pamphlet()
now supports ruleset generation for:- "pass the food"
-
save_pamphlet()
now supports the argumentduplex_edge
(desired two-sided printing edge)
that controls how the second page is oriented.
If "short" it is flipped up (the new default, easier to preview on computer)
and if "long" it is flipped down (common two-sided printer setting) (#74). -
cat_piece()
now supports the argumentreorient
which allows it to first reorient all pieces or just the rank/suit symbols:- The default "none" (or
FALSE
) means don't reorient any pieces/symbols. - "all" (or
TRUE
) means setting the angle to zero for all pieces. - "symbols" means just re-orient suit/rank symbols but not the orientation of the piece itself.
In particular, in contrast with "all" this preserves the location of the upper-left "corner" of piecepack tile faces.
- The default "none" (or
-
cat_piece()
now supports the argumentannotate
which allows one to add coordinate information to plaintext diagrams.
It is a bit more limited than the support inplot_move()
/animate_game()
.
Bug fixes and minor improvements
-
animate_game()
transitions have been improved:- Situations where the board is completely empty of pieces should now be handled correctly
- "Deleted" pieces now should no longer (automatically) be "on top" (#92)
-
cat_piece()
now returns the text diagram as a character vector invisibly. -
Now if
cat_piece()
's argumentfile
isNULL
we don't callcat()
(and return the text diagram as a character vector). -
cat_piece()
now has very basic support for non-icehouse pyramids (#81) -
The tiles in
df_ice_floe()
have been shifted slightly. -
Checkers set-up is now "mirrored" (pieces on bottom-left instead of bottom-right)
to match traditional checkers set-up.
Breaking Changes
-
The following rectangular board utility functions have been removed and marked Defunct:
grid.board_rect_cells()
, use the "board" pieces frompiecepackr::game_systems()$checkers1
withpiecepackr::grid.piece()
insteadgrid.board_rect_points()
, use the "board" picees frompiecepackr::game_systems()$go
withpiecepackr::grid.piece()
insteadgrid.board_rect_tiles()
, usepiecepackr::pmap_piece(df_rect_board_tiles())
instead
-
Interpretation of the
game
/book
argument insave_ruleset
,save_pamphlet
,save_rulebook
now
follows similar rules as theGameType
argument in PPN,
in particular now use arguments like"American Checkers"
instead of"american-checkers"
. -
By default
save_pamphlet()
now orients the second page up instead of down.
To restore prior behaviour (second page flipped down) manually set the argumentduplex_edge
to "long". -
The id column in the data frames returned by
read_ppn()
is now different (#94):- It is now a character vector instead of integer vector
- New pieces are a single number (like before) which they keep during simple moves (i.e. no 3D rotations or replacements)
- When pieces are 3D rotated we increment a number after a single
.
(introducing it if not there) - When pieces are "replaced" with different pieces we increment a number after a double
..
(introducing it if not there)
These changes allow for more fine-tuned animation possibilities.
v0.5.1-preview
New features
-
New starting board generators for specific games:
df_alquerque()
df_awithlaknannai_mosona()
df_japan()
df_tula()
-
Portable Piecepack Notation enhancements:
-
Can now identify pieces within a stack of pieces with square brackets e.g.
*b4[2:3]
(#18) -
Can now "drop" pieces beneath other pieces with backslash e.g.
S\b2
(#53) -
Can now "move" pieces beneath other pieces with underscore or combining double breve below e.g.
b2_b4
(#53) -
Can now restrict where in the piece order a piece will be after a drop/move with percent sign
to indicate the piece it should go before (or after) in the internal piece ordering e.g.
b2@b3%e4[2]
(#53) -
There are also new shortcut tokens
@%
,\%
,-%
,_%
for the common case
where you want to move/drop above/beneath a specific piece e.g.b4@%b5[2]
is equivalent toS@&b5[2]%b5[2]
which is equivalent toS@b5%b5[2]
(#53) -
Can now identify pieces with a "non-greedy" search
?
(#55) or a "greedy" search/
. -
Can now partially update specification of a piece with
~
(#57) -
;
can now be used to indicate the insertion of the minimal move number.
which
has been interpreted to mean the previous move number with an extra.
tacked to the end. -
Can now have identical
MoveNumbers
but will emit a warning if identicalMoveNumbers
are found. -
Can now directly set piece attributes for suit, rank, angle, and configuration (#35)
-
Can now specify the following additional game systems (#59):
- standard six-sided dice (in six colors)
- (French) Tarot playing cards (plus 3 types of Jokers),
this is a superset of the standard deck of playing cards - (double-6) dominoes ('standard' set plus sets in six colors)
- checkers (for 1" and 2" cell sizes, in six colors)
- chess (for 1" and 2" cell sizes, in six colors)
- go (with stones in six colors)
- meeples (in six colors)
- piecepack dice cards
-
Can now define and use macros (#60)
-
Bug fixes and minor improvements
-
plot_move()
andanimate_game()
improvements:- The
annotate
option can now also be set to"cartesian"
. - Both
plot_move()
andanimate_game()
will now automatically adjust dimensions and coordinates
if (parts of) pieces would otherwise be drawn too close (or past) zero on either the
x or y axes. - If
file == NULL
thenanimate_game()
will setdevAskNewPage(TRUE)
and then will plot each move of the game in a new graphics device (ifnew_device=TRUE
) or
the current graphics device asking user to press enter before drawing the next move (#41). - If
file
ends in.html
thenanimate_game()
will useanimation::saveHTML()
. - If
file
ends in an file format that isn't.gif
or.html
(such as.mp4
)
thenanimate_game()
will useanimation::saveMovie()
. - Pixel dimensions of
animate_game()
are now always adjusted to be an even number
(a requirement of.mp4
animations). - Can now manually set
width
,height
, andppi
arguments. - New argument
.f
that allows different graphic functions to be used
(in particularpiecepackr::piece3d()
andpiecepackr::piece()
(#54).
- The
-
Tiles are now spread out more in
df_desfases()
and its "scale factor" attribute has been set to 3. -
save_ruleset() / save_pamphlet()
can now set PDF metadata (Title, Author, Subject, Keywords, Creator) (#69) -
save_ruleset
supports ruleset generation for:- alquerque
Breaking Changes
res
argument inplot_move()
renamed toppi
(to avoid possible clash withres
argument inpiece3d
orpiece
).△
(U+25b3) no longer part of PPN.
Instead use▲
(U+25b2) or/\
plus a color "suit" (RKGBYW) to indicate Icehouse pyramids.
v0.4.1-preview
animate_game
now hasn_transitions
argument that usestweenr
to try to interpolate transition frames (#32).- New starting board generators for specific games:
df_breakthrough
df_crossings
df_froggy_bottom
df_ley_lines
df_lines_of_action
df_piecepackman
df_turkish_draughts
- Portable Piecepack Notation enhancements:
- Can now (re)move a stack of pieces i.e.
2b2-d4
,*3d5
,b4:2d5
. - Default parser now uses both
GameType
andSetUp
to create starting setup (#49). - Can now specify alternate movetext parsers with
MovetextParser
(#50). - Can now specify game
System
inGameType
/SetUp
fields. - Can now specify
SetUp: None
(orGameType: None
). - Can now specify
ScalingFactor
in the default movetext parser or as
anattribute
of the starting data frame (#52). PieceId
can now refer to piece at beginning of the move with^
.Location
can now be&PieceId
.- Can now rotate pieces with
@>
move token. - Can now "swap" pieces with
#
move token.
- Can now (re)move a stack of pieces i.e.
Bug fixes and minor improvements
cat_piece
now has basic support for the followinggame_systems
:bit
andboard
components fromcheckers1
andcheckers2
tile
component fromdominoes
,dominoes_black
,dominoes_blue
dominoes_green
,dominoes_red
,dominoes_white
,dominoes_yellow
.
Only supports double-6 domino ranks (and not the remaining double-12 domino ranks).die
component fromdice
pyramid
component fromicehouse_pieces
tile
component fromsubpack
cat_piece
now also has basic support for (piecepack) matchsticks.
Breaking changes
- In PPN simplified piece notation
1
,2
,3
corresponds to icehouse pieces rank 1, 2, 3 in contrast to piecepack rank 2, 3, and 4 i.e. zero-pip icehouse pyramids have been removed.
v0.3.1-preview
New features
df_alice_chess
,df_chaturaji
,df_fide_chess
,df_four_seasons_chess
,
df_shogi
,df_ultima
,df_xiangqi
now have a new argument
has_subpack
which ifTRUE
will provide alternative piecepack "stackpack" diagrams.- New starting board generators for specific games:
- Aliases added for some existing starting board generators:
df_checkers
anddf_english_draughts
fordf_american_checkers
df_chess
fordf_international_chess
- Portable Piecepack Notation enhancements:
- New function
save_pamphlet
which is an alternative tosave_ruleset
that saves the ruleset as a trifold pamphlet.
Breaking changes
- Arguments for starting board generators have been changed.
In particular functions no longer takes piecepackr configuration list objects as arguments but
instead uses arguments likehas_matchsticks
to determine how to customize output. - Instead of an
output_dir
argument bothsave_ruleset
andsave_rulebook
now use
anoutput
file argument. df_fide_chess
renameddf_international_chess
, corresponding ruleset was renamed
international-chess.
Bug fixes and minor improvements
- Fixes bug in starting Ultima diagram generated by
df_ultima
. - Fixes bug in color of coin faces in Unicode plaintext diagrams
if placed above previously colored piece. cat_piece
andcat_move
now has limited support for a "cfg" column
"playing_cards_expansion" and "dual_piecepacks_expansion".- Minor improvements to
save_ruleset
/save_rulebook
output.
In particular in addition to the default "letter" paper size can now specify "A4" output. - Improved rulesets for "american-checkers".
v0.2.1-preview
New features
- Added Unicode plaintext piecepack diagram generating function
cat_piece
.
Thanks James Vipond for some Unicode character suggestions. - Added prototype "Portable Piecepack Notation utilities"
read_ppn
,animate_game
,
plot_move
, andcat_move
(#11). - Starting board generators for specific games:
df_cell_management
df_everest
df_fujisan
(#24)df_twelve_mens_morris
- Fuji-san solver
solve_fujisan
(#22).
Breaking changes
df_ultima_chess
renameddf_ultima
,df_baroque_chess
added as an alias
v0.1.0-preview
- Initial release of R package version.
- Flexible rectangular starting board generators:
df_rect_board_tiles
andgrid.board_rect_tiles
grid.board_rect_cells
andgrid.board_rect_points
- Starting board generators for specific games:
df_four_field_kono
df_nine_mens_morris
df_american_checkers
df_backgammon
df_chaturaji
df_cribbage_board
andtextGrob_cribbage_board
for textual annotationdf_alice_chess
df_fide_chess
df_four_seasons_chess
df_ultima_chess
df_shogi
df_tablut
df_xiangqi
- Preliminary work on an GameKit class
game_kit
- Prototype ruleset/rulebook generators
save_ruleset
andsave_rulebook