Skip to content
Snippets Groups Projects
hack.tex 9.36 KiB
Newer Older
\subtitle{\textbf{Lab} - Game Design Hack}
Joseph Walton-Rivers's avatar
Joseph Walton-Rivers committed
\date{Wednesday, 16 May 2018}

\begin{document}
	
	\begin{frame}
	\titlepage
	\end{frame}

	\section{Intro}
Joseph Walton-Rivers's avatar
Joseph Walton-Rivers committed
	
	\begin{frame}{CE810 game engine}
		\begin{itemize}[<+->]
Joseph Walton-Rivers's avatar
Joseph Walton-Rivers committed
			\item Remember we mentioned that we built you a game engine...
			\item well, here it is.
		\end{itemize}
	\end{frame}
	
Joseph Walton-Rivers's avatar
Joseph Walton-Rivers committed
	\begin{frame}{Limitations}
		\begin{itemize}[<+->]
Joseph Walton-Rivers's avatar
Joseph Walton-Rivers committed
			\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} 
Joseph Walton-Rivers's avatar
Joseph Walton-Rivers committed
		\end{itemize}

		\uncover<4>{We originally designed it for Civilization style games, but it's much more general than that.}
Joseph Walton-Rivers's avatar
Joseph Walton-Rivers committed
	\end{frame}

	\begin{frame}{Comparison}
		A number of you have \textbf{encountered} the \href{gvgai.net}{GVGAI} Framework.\vspace{1cm}
		\begin{tabularx}{\textwidth}{l l}
			\textbf{GVGAI Framework} & \textbf{Our System} \\
			\uncover<2->{Custom VGDL files & Json standard based files} \\
			\uncover<3->{No ability to extend features & Ability to extend features }\\
			\uncover<4->{Slows down with additional rules & No such speed issues }\\		
		\end{tabularx}
	\end{frame}
Joseph Walton-Rivers's avatar
Joseph Walton-Rivers committed
	\section{Game Engine}
Joseph Walton-Rivers's avatar
Joseph Walton-Rivers committed
	\begin{frame}{Key Parts}
		\begin{itemize}[<+->]
			\item A game has \keyterm{Entity Types}, \keyterm{Resources}, and \keyterm{Terrain}
Joseph Walton-Rivers's avatar
Joseph Walton-Rivers committed
			\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}
		\begin{itemize}[<+->]
			\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}
Joseph Walton-Rivers's avatar
Joseph Walton-Rivers committed
		\end{itemize}
	\end{frame}

\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]"
]
Joseph Walton-Rivers's avatar
Joseph Walton-Rivers committed
	\begin{frame}{Entities}
		\begin{itemize}[<+->]
			\item Have an Entity Type
			\item Have \keyterm{properties}
			\item Can perform 1 \keyterm{Action} per turn
Joseph Walton-Rivers's avatar
Joseph Walton-Rivers committed
		\end{itemize}
	\end{frame}

	\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 \textbf{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 \note{\item For example movement or attacking}
			\item \textbf{Two} sets per Entity \note{\item One from the Entity Type, another from the Entity itself that overrides it. EntityType properties can't be changed - only overwritten by lower level}
	\note{\end{itemize}}
	\end{frame}

	\begin{frame}{Terrain}
		\note{\begin{itemize}}
		Terrain defines the ground in the games
		\begin{description}
			\item[id] The name of this terrain type
			\item[image] The graphics path for drawing
			\item[requiredTags] Mapping of String $\rightarrow$ Integer.
			\note{\item Keys are the tags needed as an entity property with ```ter-''}
			\note{\item Values are how much the entity property needs to be to travel here}
		\end{description}
	\note{\end{itemize}}

	\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 \note{\item Built in items are detected the same }
				\item Use the same way as the built in items \note{\item First class citizens in the engine}
			\end{itemize}
			\item You can add \textbf{new}:
			\begin{itemize}
				\item Actions
				\item Orders
				\item AI
				\item Victory Conditions
			\end{itemize}
		\end{itemize}
Piers Williams's avatar
Piers Williams committed
	\section{Examples}
	
	\begin{frame}{Medieval TBS}
		\begin{center}
			\includegraphics[width=0.8\textwidth]{medieval}
		\end{center}
	\end{frame}

	\begin{frame}{Medieval TBS}
		\begin{columns}
			\begin{column}{0.5\textwidth}
				\includegraphics[width=\textwidth]{medieval}
			\end{column}
			\begin{column}{0.5\textwidth}
				\begin{itemize}[<+->]
					\item Fairly conventional
					\item Build on resources for turnly income
					\item Civilians, archers, and knights
				\end{itemize}
			\end{column}
		\end{columns}
	\end{frame}
	\begin{frame}{Transmission}
		\begin{center}
			\includegraphics[width=\textheight]{transmission}
		\end{center}
	\end{frame}

	\begin{frame}{Transmission}
		\begin{columns}
			\begin{column}{0.5\textwidth}
				\includegraphics[width=\textwidth]{transmission}
			\end{column}
			\begin{column}{0.5\textwidth}
				\begin{itemize}[<+->]
					\item Global Game Jam 2018 Entry
					\item Space based TBS
					\item Units must stay \textbf{within} transmission range
					\item Can be \textbf{extended} with satellites
					\item Satellites can be \textbf{destroyed}
				\end{itemize}
			\end{column}
		\end{columns}
	\end{frame}

Joseph Walton-Rivers's avatar
Joseph Walton-Rivers committed
	\begin{frame}{Hexxagon}
		\begin{center}
			\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}
		\end{center}
	\end{frame}
Piers Williams's avatar
Piers Williams committed
\begin{frame}[fragile]{Hexxagon Entity Definition}
\begin{minted}[breaklines]{javascript}
  "name": "piece", // it's called 'piece'
Joseph Walton-Rivers's avatar
Joseph Walton-Rivers committed
  "properties": {
    "ter-playzone": 1, // it can 'walk' on playzone tiles
    "health": 1 // it has 1 health (things with no health die)
Joseph Walton-Rivers's avatar
Joseph Walton-Rivers committed
  },
  "_actions":[
    "Jump[tick]", // Jump Action (defined in Java)
    "Clone[tick]" // Clone action (defined in Java)
\end{minted}
Piers Williams's avatar
Piers Williams committed
\end{frame}

\begin{frame}{Aliens Versus Predators}
	\begin{center}
		\includegraphics[width=0.7\linewidth]{avp}
	\end{center}
\end{frame}

\begin{frame}{Aliens Versus Predators}
	\begin{columns}
		\begin{column}{0.5\textwidth}
			\includegraphics[width=\textwidth]{avp}
		\end{column}
		\begin{column}{0.5\textwidth}
			\begin{itemize}[<+->]
				\item 3 Teams
				\item Aliens
				\begin{itemize}
					\item Queen Spawn Egg
					\item Egg $\rightarrow$ FaceHugger
					\item FaceHugger + Human $\rightarrow$ Incubator
					\item Incubator $\rightarrow$ Alien
				\end{itemize}
			\item Humans
			\item Predators
			\end{itemize}
		\end{column}
	\end{columns}
	\note{
		\begin{itemize}
			\item Needed custom actions to avoid using resources.
			\item Uses properties instead
			\item Humans and Predators quite mundane
		\end{itemize}
	}
Joseph Walton-Rivers's avatar
Joseph Walton-Rivers committed
\end{frame}
\begin{frame}{Your Turn}
	\begin{itemize}[<+->]
		\item This is what \textbf{we} did
		\item Demonstrates \textbf{some} of what can be achieved
		\item Your job is to make \textbf{interesting} games
		\begin{itemize}
			\item Push the \textbf{limits} of the engine
			\item Not a re-skinned TBS with \textbf{no} new mechanics
			\item That have a reasonable design space for tuning
		\end{itemize}
		\item Do not get hung up on graphics
		\begin{itemize}
			\item Medieval game used a \textbf{single} set of assets designed for hexagons
			\item Hexxagon and AVP used single colour tiles and basic images
			\item Rules and interesting play are more \textbf{important}
			\item Graphics serve to \textbf{distinguish} between different units
		\end{itemize}
	\end{itemize}
\end{frame}

	\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}
Joseph Walton-Rivers's avatar
Joseph Walton-Rivers committed
	\begin{frame}{Movement Lock}
		Allow the player to only move one piece on their go
		\begin{itemize}[<+->]
Joseph Walton-Rivers's avatar
Joseph Walton-Rivers committed
			\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}
Joseph Walton-Rivers's avatar
Joseph Walton-Rivers committed
	\begin{frame}{Timers}
		You can define a timer by doing the following:
		
		\begin{itemize}[<+->]
Joseph Walton-Rivers's avatar
Joseph Walton-Rivers committed
			\item Create an automatic action that performs the effect that you'd like to achieve.
			\item Set requirements to be ``timeProperty $\geq$ timeRequired''
Joseph Walton-Rivers's avatar
Joseph Walton-Rivers committed
			\item Create an automatic action that generates 1 timeProperty
			\item Define the automatic actions as [generateAction, doneAction]
		\end{itemize}
Piers Williams's avatar
Piers Williams committed
\end{document}