Newer
Older
\subtitle{\textbf{Lab} - Game Design Hack}
\date{Monday (PM), 14 May 2018}
\begin{document}
\begin{frame}
\titlepage
\end{frame}
\section{Intro}
\item Remember we mentioned that we built you a game engine...
\item well, here it is.
\note{\begin{itemize}}
\item Games take place on a hex grid
\item Games are turn-based
\item No randomness \note{\item In fairness, it is the UI and AI that do not support it}
\uncover<4>{We originally designed it for Civilization style games, but it's much more general than that.}
\note{\end{itemize}}
\item A game has \keyterm{Entity Types}, \keyterm{Resources}, and \keyterm{Terrain}
\item Entity types have actions, costs and properties
\item Resources and Terrain make up the maps
\item Victory conditions tell you how to win (or lose)
\end{itemize}
\end{frame}
\begin{frame}{Entity Types}
\item Used to \textbf{define} an \keyterm{Entity}
\item \textbf{Every} entity has a type
\item Entity Types can \textbf{extend} other types
\item Defines:
\begin{itemize}
\item Graphics
\item \keyterm{Actions}
\item \keyterm{Properties}
\end{itemize}
\begin{frame}[fragile]{Example: EntityType}
\begin{minted}[breaklines,tabsize=4]{javascript}
{
"name": "abstract_civilian",
"properties": {
"movement": 1,
"health": 5,
"attackRange": 1,
"atkMelee": 1,
"ter-grass": 1
},
"cost": {
"food": 10
},
\end{minted}
\end{frame}
\begin{frame}[fragile]{Example: EntityType}
\begin{minted}[breaklines,tabsize=4]{javascript}
"_actions": [
"Move",
"MeleeAttackAction",
"Build[farm]",
"BuildOnResource[lumber_mill:wood]",
"BuildOnResource[gold_mine:gold]",
"Build[marketplace]"
]
},
\end{minted}
\end{frame}
\item Have an Entity Type
\item Has \keyterm{properties}
\item Can perform 1 \keyterm{Action} per turn
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
\begin{frame}{Actions}
\begin{block}{Actions}
\textbf{What} an Entity can do
\end{block}
\begin{itemize}[<+->]
\item 0 or more
\item Parameterisable
\item Inherited
\end{itemize}
\end{frame}
\begin{frame}{Orders}
\begin{block}{Order}
An order is \textbf{generated} when an Action is used on a \textbf{particular} location
\end{block}
\begin{itemize}[<+->]
\item What an Entity actually does in its turn
\item Used to \textbf{update} the game state
\item Move Action $\rightarrow$ \textbf{multiple} possible Move Orders
\end{itemize}
\end{frame}
\begin{frame}{Properties}
\begin{itemize}[<+->]
\item String $\rightarrow$ Integer mapping
\item Used by default actions as well as custom ones
\item Two sets per Entity
\item Inherited
\end{itemize}
\end{frame}
\begin{frame}{Extensions}
\begin{itemize}[<+->]
\item The game is \textbf{extendible}
\item You can \textbf{change} the json files \textbf{defining} the game
\item You can \textbf{add} your own code
\begin{itemize}
\item It will be detected on the classpath
\item Use the same as the built in items
\end{itemize}
\item You can add \textbf{new}:
\begin{itemize}
\item Actions
\item Orders
\item AI
\item Victory Conditions
\end{itemize}
\end{itemize}
\end{frame}
\section{Example - Hexxagon}
\begin{frame}{Hexxagon}
\only<1>{\includegraphics[width=0.8\linewidth]{images/gd_hexxagon}\\}
\uncover<2->{\includegraphics[width=0.7\linewidth]{images/gd_hexxagon}\\}
\only<2>{Entity types: piece, piece-p1, piece-p2}
\only<3>{Terrain types: board}
\only<4>{Actions: jump and clone}
\only<5>{Resources: ticks (used to permit moving only one piece)}
\only<6>{Victory conditions: LastManStanding, MostPiecesLock}
"name": "piece", // it's called 'piece'
"ter-playzone": 1, // it can 'walk' on playzone tiles
"health": 1 // it has 1 health (things with no health die)
"Jump[tick]", // Jump Action (defined in Java)
"Clone[tick]" // Clone action (defined in Java)
\section{Design Patterns}
\begin{frame}{Design Patterns}
\begin{itemize}[<+->]
\item Like programming patterns
\item Many teams may have similar tasks to solve
\item Some helpful patterns shown here
\end{itemize}
\end{frame}
\begin{frame}{Movement Lock}
Allow the player to only move one piece on their go
\item Resource: time
\item Only allow a move if the resource < current tick
\item After a move is made, update the resource to tick + 1
\end{itemize}
\begin{frame}{Timers}
You can define a timer by doing the following:
\item Create an automatic action that performs the effect that you'd like to achieve.
\item Set requirements to be ``timeProperty $\geq$ timeRequired''
\item Create an automatic action that generates 1 timeProperty
\item Define the automatic actions as [generateAction, doneAction]
\end{itemize}