summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/wargame/doc/tutorial/game.tex
blob: 6db72bff27bdc929d6c8e03b1daef8d9b16f5ca3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
\documentclass[11pt,twoside]{ltxdoc}

\usepackage{game}
\usepackage[margin=1cm,bottom=2cm,top=2cm,a4paper]{geometry}
\newcommand\Tikz{Ti{\itshape k}Z/PGF}
\setlength{\parskip}{.5ex}
\setlength{\parindent}{0em}
\newcommand\tightlist{\setlength{\itemsep}{3pt}
  \setlength{\parskip}{0pt}}
\newcommand\copyleftnotice{{%
  \footnotesize \copyright{} 2022, Christian Holm Christensen,
  licensed under the CC-BY-SA 4.0}}
\makeatletter
\def\ps@game{%
  \def\@oddfoot{\hfill\copyleftnotice\hfill}%
  \def\@evenfoot{\hfill\copyleftnotice\hfill}%
  \def\@oddhead{The \textsf{wargame} tutorial\hfill\thepage}%
  \def\@evenhead{\thepage\hfill\rightmark}
  \def\sectionmark##1{%
    \markright{\ifnum\c@secnumdepth>\z@%
      \thesection. \ \fi##1}}}
\makeatother
\pagestyle{game}

\title{The \LaTeX{} \textsf{wargame} package\\
  {\large A tutorial}}
\author{Christian Holm Christensen}
\date{\today}

\def\MacroFont{%
  \fontencoding{\encodingdefault}%
  \fontfamily{\ttdefault}%
  \fontseries{\mddefault}%
  \fontshape{\shapedefault}%
  \footnotesize}
\let\theCodelineNo\empty
\begin{document}
\thispagestyle{plain}
\twocolumn
\maketitle

\section{Introduction}

This is a short tutorial on how to use the \LaTeX{} \textsf{wargame}
package.  We will walk through the definition materials for a game.
We will \emph{not} give actual rules for the game.  That is a whole
different topic and I refer you to the literature, for example

\begin{description}\tightlist
\item[\href{https://www.bloomsbury.com/uk/simulating-war-9781472533913/}{\textit{Simulating war}}] by P.Sabin
\item[\href{https://www.professionalwargaming.co.uk/Complete-Wargames-Handbook-Dunnigan.pdf}{\textit{The
      Complete Wargames Handbook}}] by J.F.Dunnigan
\item[\href{https://www.scribd.com/book/220336866/Designing-Wargames-Introduction}{Designing
    Wargames: Introduction}]  by G.Phillies (and associated
  \href{https://www.youtube.com/playlist?list=PLjnA1DE9KX645eBC2gDWHkSlCPvpb4JAQ}{Youtube
    lecture series}) 
  
\end{description}

\section{The game}

The game we will create is a small game with two factions (sides, or
players).   The game is \emph{not} supposed to be play-able, and we'll
leave out a lot of details which we would need in a full game.

\DocInput{game.sty}

\section{Rules}

We will not write any rules for this demonstration game.  The focus of
this tutorial is how to use the \textsf{wargame} package, not how to
design a game.

The \textsf{wargame} package does however have a number of tools that
helps the developer write the rules.  We've already seen some of them
in action.   For example, we saw how to add stacks of units to a board
in Section~\ref{sec:board:units} or how to make board clippings to
show a zoom of the map (Section~\ref{sec:board:clipped}).

Figure~\ref{fig:clipped-attack} showed how we can illustrate an attack,
for example.  The package also provides means to indicate eliminated
units, movement, retreats, advances, and much more.  The manual gives
a lot more information about this.

\DocInput{export.tex}

\section{The materials}

Next, we will make some materials for printing.  The next few pages
will contain only the materials and no text, so we will summarise what
we do here.

The first thing we put out is the map.  That is pretty simple. We do

\begin{verbatim}
  \begin{board}
  \end{board}
\end{verbatim}

Then comes the OOB. We simply use the \verb+\fulloob+ macro.

After that are the two tables put into one page.

\begin{verbatim}
  \crt \tec
\end{verbatim}

And the final part are the counter sheets.  We will take advantage of
the macros \verb+\alla+ and \verb+\allb+ yet again.

\begin{verbatim}
  \doublechits{\allb}{4}{1.24}
\end{verbatim}

As a final bonus, we also make a board that includes our three charts:
The OOB, CRT, and TE. We will not demonstrate the code here, but take
a look in the sources if you are curious. 

\newcommand\fullboard[1][]{%
  \begin{tikzpicture}[#1,rotate=90]%
    \begin{scope}
      \begin{innerboard}
      \end{innerboard}
    \end{scope}
    \begin{scope}[shift={($(frame.north east)+(7,-2.5)$)}]
      \inneroob
    \end{scope}
    %
    \node[anchor=south west,minimum width=6.2cm,minimum height=10cm,
    line  width=1pt,sub title,scale=.66,draw,align=center,
    text depth=9.7cm,fill=neutral,transform shape]
    at (oob frame.south west)
    {{\LARGE Charts}};
    %
    \node[above right=5mm and 4mm of oob frame.south west,
    inner sep=0pt,
    transform shape,scale=.75,anchor=south west] (crt) {\crt};
    %
    \node[above=5mm of crt.north west,anchor=south west,inner sep=0pt,
    transform shape,scale=.9] (tec) {\tec};
    %
    % \end{scope}
    \node[below=1mm of frame.south west,anchor=north west,
    transform shape]{%
        \copyleftnotice};
  \end{tikzpicture}}
  
We put in \verb+\cleardoublepage+ between all this so that we can
print directly on a duplex printer.

\section{Epilogue}

I hope that this short tutorial has helped you. Suggestions,
corrections, and so on are very welcomed.

\begin{flushright}
  \textit{Christian}  
\end{flushright}
\onecolumn
\cleardoublepage

\begin{center}
  \begin{board}
  \end{board}
\end{center}
\cleardoublepage

\begin{center}
  \fulloob
\end{center}
\cleardoublepage

\begin{center}
  \crt\space\space\tec
\end{center}
\cleardoublepage

\begin{center}
  \begin{tikzpicture}
    \doublechits{\allb}{7}{1.24}
  \end{tikzpicture}

  \begin{tikzpicture}
    \doublechits{\alla}{6}{1.24}
  \end{tikzpicture}
  
  \begin{tikzpicture}
    \doublechits{{game turn}}{1}{1.24}
  \end{tikzpicture}
\end{center}

\cleardoublepage
\newgeometry{margin=7mm}
\pagestyle{empty}
\fullboard

\end{document}
%% Local Variables:
%% mode: LaTeX
%% End: