Releases: piecepackr/ppgames
Release list
ppgames v0.8.2
ppgames is superseded in favor of the newer ppcli, ppdf, ppgamer, ppn, and pprules spinoff packages:
- These can all be installed with
piecepackr::install_ppverse() - See <https://piecepackr.r-universe.dev/builds> for more info on
the various "ppverse" packages - Use
ppcli::cat_piece()forcat_piece() - Use similar functions from ppdf for the various
df_*()game setup functions - Use
ppgamer::solve_fujisan()forsolve_fujisan() - Use ppn for various
*_game(),*_ppn(), and*_move()PPN parsing and game visualization functions - Use pprules for various
save_*()piecepack ruleset generators
Bug fixes and minor improvements
read_ppn()now usesaffiner::as_coord2d()instead ofpiecepackr:::Point2D()$new()which was an internal function that was removed in the most recent version of{piecepackr}.
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 customizepandocoutput using the newcmd_optionsargument, 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, anddocxexport 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_fnargument 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 argumentvariantand 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()'scolorargument 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_factorattribute of thedfargument 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 != FALSEis now less grey. -
cat_piece()will no longer override an explicitly setcolor=TRUEtoFALSEwhen writing to files. -
cat_piece()now returns an invisible""instead ofNULLwhen 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
annotateargument incat_piece(),plot_move(),animate_game()now supports using "none" as an alias toFALSEand "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
seedwe now usewithr::local_seed()instead ofset.seed()
and ifseed = NULLwe 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>meansxunits to the right andyunits up from the pieces' current location(s) -
<x,y>|Locationmeansxunits to the right andyunits up fromLocation -
<x,y>$PieceIdis a shortcut for<x,y>|&PieceId -
nDirectionmeans movingnunits in theDirectiondirection -
from the pieces's current location(s)
-
nDirection|Locationmeans movingnunits in theDirectiondirection fromLocation -
nDirection$PieceIdis 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?PieceSpecis now a shortcut forN&?PieceSpec -
!PieceIdis 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|Locationmeans rotatingPieceIdpiecesAngleangle aroundLocationlocationPieceId1@>Angle$PieceId2is a shortcut forPieceId1@>Angle|&PieceId2PieceId$>Angleis 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 argumentreorientwhich 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 argumentannotatewhich 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 argumentfileisNULLwe 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()$checkers1withpiecepackr::grid.piece()insteadgrid.board_rect_points(), use the "board" picees frompiecepackr::game_systems()$gowithpiecepackr::grid.piece()insteadgrid.board_rect_tiles(), usepiecepackr::pmap_piece(df_rect_board_tiles())instead
-
Interpretation of the
game/bookargument insave_ruleset,save_pamphlet,save_rulebooknow
follows similar rules as theGameTypeargument 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_edgeto "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
MoveNumbersbut will emit a warning if identicalMoveNumbersare 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
annotateoption 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 == NULLthenanimate_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
fileends in.htmlthenanimate_game()will useanimation::saveHTML(). - If
fileends in an file format that isn't.gifor.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.mp4animations). - Can now manually set
width,height, andppiarguments. - New argument
.fthat 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_rulesetsupports ruleset generation for:- alquerque
Breaking Changes
resargument inplot_move()renamed toppi(to avoid possible clash withresargument inpiece3dorpiece).△(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_gamenow hasn_transitionsargument that usestweenr
to try to interpolate transition frames (#32).- New starting board generators for specific games:
df_breakthroughdf_crossingsdf_froggy_bottomdf_ley_linesdf_lines_of_actiondf_piecepackmandf_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
GameTypeandSetUpto create starting setup (#49). - Can now specify alternate movetext parsers with
MovetextParser(#50). - Can now specify game
SysteminGameType/SetUpfields. - Can now specify
SetUp: None(orGameType: None). - Can now specify
ScalingFactorin the default movetext parser or as
anattributeof the starting data frame (#52). PieceIdcan now refer to piece at beginning of the move with^.Locationcan 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_piecenow has basic support for the followinggame_systems:bitandboardcomponents fromcheckers1andcheckers2tilecomponent 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).diecomponent fromdicepyramidcomponent fromicehouse_piecestilecomponent fromsubpack
cat_piecenow also has basic support for (piecepack) matchsticks.
Breaking changes
- In PPN simplified piece notation
1,2,3corresponds 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_xiangqinow have a new argument
has_subpackwhich ifTRUEwill provide alternative piecepack "stackpack" diagrams.- New starting board generators for specific games:
- Aliases added for some existing starting board generators:
df_checkersanddf_english_draughtsfordf_american_checkersdf_chessfordf_international_chess
- Portable Piecepack Notation enhancements:
- New function
save_pamphletwhich 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_matchsticksto determine how to customize output. - Instead of an
output_dirargument bothsave_rulesetandsave_rulebooknow use
anoutputfile argument. df_fide_chessrenameddf_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_pieceandcat_movenow has limited support for a "cfg" column
"playing_cards_expansion" and "dual_piecepacks_expansion".- Minor improvements to
save_ruleset/save_rulebookoutput.
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_managementdf_everestdf_fujisan(#24)df_twelve_mens_morris
- Fuji-san solver
solve_fujisan(#22).
Breaking changes
df_ultima_chessrenameddf_ultima,df_baroque_chessadded as an alias
v0.1.0-preview
- Initial release of R package version.
- Flexible rectangular starting board generators:
df_rect_board_tilesandgrid.board_rect_tilesgrid.board_rect_cellsandgrid.board_rect_points
- Starting board generators for specific games:
df_four_field_konodf_nine_mens_morrisdf_american_checkersdf_backgammondf_chaturajidf_cribbage_boardandtextGrob_cribbage_boardfor textual annotationdf_alice_chessdf_fide_chessdf_four_seasons_chessdf_ultima_chessdf_shogidf_tablutdf_xiangqi
- Preliminary work on an GameKit class
game_kit - Prototype ruleset/rulebook generators
save_rulesetandsave_rulebook