Debian Codegraph @

texmf-dist/doc/latex/wargame/tutorial/game.tex

raw
1 \documentclass[11pt,twoside]{ltxdoc}
2
3 \usepackage{game}
4 \usepackage[margin=1cm,bottom=2cm,top=2cm,a4paper]{geometry}
5 \newcommand\Tikz{Ti{\itshape k}Z/PGF}
6 \let\TikZ\Tikz
7 \setlength{\parskip}{.5ex}
8 \setlength{\parindent}{0em}
9 \newcommand\tightlist{\setlength{\itemsep}{3pt}
10 \setlength{\parskip}{0pt}}
11 \newcommand\copyleftnotice{{%
12 \footnotesize \copyright{} 2022, Christian Holm Christensen,
13 licensed under the CC-BY-SA 4.0}}
14 \makeatletter
15 \def\ps@game{%
16 \def\@oddfoot{\hfill\copyleftnotice\hfill}%
17 \def\@evenfoot{\hfill\copyleftnotice\hfill}%
18 \def\@oddhead{The \textsf{wargame} tutorial\hfill\thepage}%
19 \def\@evenhead{\thepage\hfill\rightmark}
20 \def\sectionmark##1{%
21 \markright{\ifnum\c@secnumdepth>\z@%
22 \thesection. \ \fi##1}}}
23 \makeatother
24 \pagestyle{game}
25
26 \title{The \LaTeX{} \textsf{wargame} package\\
27 {\large A tutorial}}
28 \author{Christian Holm Christensen}
29 \date{\today}
30
31 \def\MacroFont{%
32 \fontencoding{\encodingdefault}%
33 \fontfamily{\ttdefault}%
34 \fontseries{\mddefault}%
35 \fontshape{\shapedefault}%
36 \footnotesize}
37 \let\theCodelineNo\empty
38 \begin{document}
39 \thispagestyle{plain}
40 \twocolumn
41 \maketitle
42
43 \section{Introduction}
44
45 This is a short tutorial on how to use the \LaTeX{} \textsf{wargame}
46 package. We will walk through the definition materials for a game.
47 We will \emph{not} give actual rules for the game. That is a whole
48 different topic and I refer you to the literature, for example
49
50 \begin{description}\tightlist
51 \item[\href{https://www.bloomsbury.com/uk/simulating-war-9781472533913/}{\textit{Simulating war}}] by P.Sabin
52 \item[\href{https://www.professionalwargaming.co.uk/Complete-Wargames-Handbook-Dunnigan.pdf}{\textit{The
53 Complete Wargames Handbook}}] by J.F.Dunnigan
54 \item[\href{https://www.scribd.com/book/220336866/Designing-Wargames-Introduction}{Designing
55 Wargames: Introduction}] by G.Phillies (and associated
56 \href{https://www.youtube.com/playlist?list=PLjnA1DE9KX645eBC2gDWHkSlCPvpb4JAQ}{Youtube
57 lecture series})
58
59 \end{description}
60
61 \section{The game}
62
63 The game we will create is a small game with two factions (sides, or
64 players). The game is \emph{not} supposed to be play-able, and we'll
65 leave out a lot of details which we would need in a full game.
66
67 \DocInput{game.sty}
68
69 \section{Rules}
70
71 We will not write any rules for this demonstration game. The focus of
72 this tutorial is how to use the \textsf{wargame} package, not how to
73 design a game.
74
75 The \textsf{wargame} package does however have a number of tools that
76 helps the developer write the rules. We've already seen some of them
77 in action. For example, we saw how to add stacks of units to a board
78 in Section~\ref{sec:board:units} or how to make board clippings to
79 show a zoom of the map (Section~\ref{sec:board:clipped}).
80
81 Figure~\ref{fig:clipped-attack} showed how we can illustrate an attack,
82 for example. The package also provides means to indicate eliminated
83 units, movement, retreats, advances, and much more. The manual gives
84 a lot more information about this.
85
86 \DocInput{export.tex}
87
88 \section{The materials}
89
90 Next, we will make some materials for printing. The next few pages
91 will contain only the materials and no text, so we will summarise what
92 we do here.
93
94 The first thing we put out is the map. That is pretty simple. We do
95
96 \begin{verbatim}
97 \begin{board}
98 \end{board}
99 \end{verbatim}
100
101 Then comes the OOB. We simply use the \verb+\fulloob+ macro.
102
103 After that are the two tables put into one page.
104
105 \begin{verbatim}
106 \crt \tec
107 \end{verbatim}
108
109 And the final part are the counter sheets. We will take advantage of
110 the macros \verb+\alla+ and \verb+\allb+ yet again.
111
112 \begin{verbatim}
113 \doublechits{\allb}{4}{1.24}
114 \end{verbatim}
115
116 As a final bonus, we also make a board that includes our three charts:
117 The OOB, CRT, and TEC. We will not demonstrate the code here, but take
118 a look in the sources if you are curious.
119
120 \newcommand\fullboard[1][]{%
121 \begin{tikzpicture}[#1,rotate=90]%
122 \begin{scope}
123 \begin{innerboard}
124 \end{innerboard}
125 \end{scope}
126 \begin{scope}[shift={($(frame.north east)+(7,-2.5)$)}]
127 \inneroob
128 \end{scope}
129 %
130 \node[
131 anchor=south west,
132 minimum width=6.2cm,
133 minimum height=10.5cm,
134 line width=1pt,
135 sub title,
136 scale=.66,
137 draw,
138 align=center,
139 text depth=9.7cm,
140 fill=neutral,
141 transform shape,
142 above right=1pt of oob frame.south west
143 ] (charts)
144 {{\LARGE Charts}};
145 %
146 \node[above right=5mm and 4mm of charts.south west,
147 inner sep=0pt,
148 transform shape,scale=.75,anchor=south west] (crt) {\crt};
149 %
150 \node[above=5mm of crt.north west,anchor=south west,inner sep=0pt,
151 transform shape,scale=.9] (tec) {\tec};
152 %
153 % \end{scope}
154 \node[below=1mm of frame.south west,anchor=north west,
155 transform shape]{%
156 \copyleftnotice};
157 \end{tikzpicture}}
158
159 We put in \verb+\cleardoublepage+ between all this so that we can
160 print directly on a duplex printer.
161
162 \section{Epilogue}
163
164 I hope that this short tutorial has helped you. Suggestions,
165 corrections, and so on are very welcomed.
166
167 \begin{flushright}
168 \textit{Christian}
169 \end{flushright}
170 \onecolumn
171 \cleardoublepage
172
173 \begin{center}
174 \begin{board}
175 \end{board}
176 \end{center}
177 \cleardoublepage
178
179 \begin{center}
180 \fulloob
181 \end{center}
182 \cleardoublepage
183
184 \begin{center}
185 \crt\space\space\tec
186 \end{center}
187 \cleardoublepage
188
189 \begin{center}
190 \begin{tikzpicture}
191 \doublechits{\allb}{7}{1.24}
192 \end{tikzpicture}
193
194 \begin{tikzpicture}
195 \doublechits{\alla}{6}{1.24}
196 \end{tikzpicture}
197
198 \begin{tikzpicture}
199 \doublechits{{game turn chit}}{1}{1.24}
200 \end{tikzpicture}
201 \end{center}
202
203 \cleardoublepage
204 \newgeometry{margin=7mm}
205 \pagestyle{empty}
206 \fullboard
207
208 \end{document}
209 %% Local Variables:
210 %% mode: LaTeX
211 %% End: