Revision 366
minor change
report.tex | ||
---|---|---|
4 | 4 |
% Margins |
5 | 5 |
\usepackage[top=35mm,bottom=35mm,left=25mm,right=25mm]{geometry} |
6 | 6 |
% Graphics and images |
7 |
\usepackage{graphicx} |
|
8 |
\graphicspath{{./images/}} |
|
7 |
\usepackage{graphicx} \graphicspath{{./images/}} |
|
8 |
\usepackage{subcaption} |
|
9 |
\usepackage{float} |
|
9 | 10 |
% Encodings (to render letters with diacritics and special characters) |
10 | 11 |
\usepackage[utf8]{inputenc} |
11 | 12 |
% Language |
... | ... | |
99 | 100 |
\tableofcontents |
100 | 101 |
%\endgroup |
101 | 102 |
\section{User instructions} |
103 |
\subsection{How to play} |
|
104 |
In all game modes, the controls are the same: |
|
105 |
\begin{itemize} |
|
106 |
\item \textbf{WASD} to move North, East, South and West respectively. |
|
107 |
\item \textbf{Mouse left-click} to fire a bullet. |
|
108 |
\item \textbf{Ctrl+'+'} and \textbf{Ctrl+'-'} to zoom in and out. |
|
109 |
\item \textbf{ESC} to escape game mode (go back). |
|
110 |
\end{itemize} |
|
102 | 111 |
\subsection{Main menu} |
103 | 112 |
On startup, users are greeted by a \texttt{Loading...} message, briefly followed by the main screen. |
104 |
\begin{center} \includegraphics[scale=0.45]{main_menu} \end{center} |
|
105 |
|
|
113 |
\begin{figure}[H] \centering |
|
114 |
\includegraphics[scale=0.45]{main_menu} |
|
115 |
\caption{Main menu} |
|
116 |
\end{figure} |
|
117 |
Using the mouse movement and clicks, the user can select one of the avaliable options: |
|
118 |
\begin{itemize} |
|
119 |
\item \textbf{Single player}: Go to single player selection menu, to select one of the single player game modes. |
|
120 |
\item \textbf{Multiplayer}: Go to multiplayer mode, allowing to select more options. |
|
121 |
\item \textbf{Chat}: Exchange text messages with another connected computer. |
|
122 |
\item \textbf{Exit}: Exit the game |
|
123 |
\end{itemize} |
|
124 |
The user can also exit the game by presing \textbf{ESC}. |
|
125 |
\pagebreak |
|
126 |
\subsection{Single player} |
|
127 |
Upon entering into single player mode, the user is presented with a menu from which he can choose one of the options. \par |
|
128 |
\begin{figure}[H] \centering |
|
129 |
\includegraphics[scale=0.45]{singleplayer01} |
|
130 |
\caption{Single player menu} |
|
131 |
\end{figure} |
|
132 |
\begin{itemize} |
|
133 |
\item \textbf{Campaign}: campaign mode; kill all autonomous opponents. |
|
134 |
\item \textbf{Zombies}: zombies mode; kill as many zombies and survive as much time as possible. |
|
135 |
\item \textbf{Back}: go back to main menu. |
|
136 |
\end{itemize} |
|
137 |
The user can also go back to main menu by pressing \textbf{ESC}. |
|
138 |
\pagebreak |
|
139 |
\subsubsection{Campaign} |
|
140 |
In campaign mode the goal is to kill all the opponents in the map as fast as possible, while sustaining as little damage as possible. |
|
141 |
\begin{figure}[H] \centering |
|
142 |
\includegraphics[scale=0.45]{campaign01} |
|
143 |
\caption{Campaign mode} |
|
144 |
\end{figure} |
|
145 |
\pagebreak |
|
146 |
\subsubsection{Zombies} |
|
147 |
In zombie mode the goal is to kill as many zombies and survive as much time as possible. Zombies slowly follow the player and attack the player when in short range.\par |
|
148 |
Once the player kills a zombie, a new zombie spawns in a random part of the map, with more life than all previous zombies. |
|
149 |
\begin{figure}[H] \centering |
|
150 |
\includegraphics[scale=0.45]{zombies01} |
|
151 |
\caption{Zombies mode} |
|
152 |
\end{figure} |
|
153 |
\pagebreak |
|
154 |
\subsection{Multiplayer} |
|
155 |
In multiplayer mode, |
|
156 |
\pagebreak |
|
106 | 157 |
\subsection{Chat} |
107 | 158 |
This chat tool was initially designed as a simple, text mode, test communication between different machines. We have however decided to include it as a functionality in the project for a number of reasons: |
108 | 159 |
\begin{enumerate} |
... | ... | |
111 | 162 |
\item It served as a minimal insurance that our project would integrate the communication modules, in case we could not implement multiplayer mode. |
112 | 163 |
\item It is a useful feature. |
113 | 164 |
\end{enumerate} |
165 |
\begin{figure}[H] \centering |
|
166 |
\includegraphics[scale=0.45]{chat01} |
|
167 |
\caption{Chat environment} |
|
168 |
\end{figure} |
|
169 |
The chat can be used for exchanging messages of up to 75 characters directy writable with the keyboard. The character limit was imposed to prevent strings from rendering as wider than the input box, and the fact they should be directy writable with the keyboard simplifies the process of capturing scancodes, having as downside not allowing to write characters that require more than one key press (like exclamation or question marks in a Portuguese keyboard). \par |
|
170 |
\begin{figure}[H] \centering |
|
171 |
\begin{subfigure}[b]{0.48\linewidth} |
|
172 |
\includegraphics[width=\linewidth]{chat02_01} |
|
173 |
\caption{Computer 1 chat} |
|
174 |
\end{subfigure} |
|
175 |
\begin{subfigure}[b]{0.48\linewidth} |
|
176 |
\includegraphics[width=\linewidth]{chat02_02} |
|
177 |
\caption{Computer 2 chat} |
|
178 |
\end{subfigure} |
|
179 |
\caption{Two users interacting via chat} |
|
180 |
\end{figure} |
|
181 |
The user can exit the chat mode by pressing \textbf{ESC}. |
|
182 |
\section{Project status} |
|
183 |
All functionalities previously presented were fully implemented, with the exception of: |
|
184 |
\begin{itemize} |
|
185 |
\item \textbf{Campaign}: autonomous opponents were supposed to follow a pre-programmed path and shoot on sight at the player. Currently, they don't do either of those. |
|
186 |
\item \textbf{Multiplayer}: still working on it. |
|
187 |
\end{itemize} |
|
188 |
The I/O devices used in the project are presented in the following table. |
|
189 |
\begin{center} \begin{tabular}{c || l | c} |
|
190 |
\textbf{Device} & \textbf{What for} & Method \\ \hline |
|
191 |
Timer & Frame rate, time since beginning of game & Interrupts \\ |
|
192 |
Keyboard & Player movement, writing chat messages & Interrupts \\ |
|
193 |
Mouse & Player orientation, shooting, selecting options in menus & Interrupts \\ |
|
194 |
Video card & In-game drawing, menus & None \\ |
|
195 |
RTC & Scoreboards & Polling \\ |
|
196 |
Serial port & Chat communication, multiplayer modes & Interrupts |
|
197 |
\end{tabular} \end{center} |
|
198 |
To manage all interrupt subscriptions, the general function \texttt{unsubscribe\_interrupt} was implemented and used. |
|
199 |
\subsection{Timer} |
|
200 |
Timer 0 is used to generate periodic interrupts at a rate of 60Hz, essentially controlling a large part of what the program does.\par |
|
201 |
Timer interrupts regulate screen refreshing, which happens at a rate of 60Hz. In all game modes, timer interrupts serve not only the purpose of refreshing the screen, but also to process all the game data: collisions, movement, path-finding algorithms, etc. \par |
|
202 |
To manage timer interrupt subscriptions, functions \texttt{subscribe\_timer\_interrupt}, \texttt{timer\_int\_handler} and \texttt{timer\_get\_no\_interrupts} were implemented and used. |
|
203 |
\subsection{Keyboard} |
|
204 |
The keyboard was configured to issue interrupts on key presses and releases. |
|
114 | 205 |
|
115 |
\section{Project status} |
|
116 |
Hey |
|
206 |
To manage keyboard interrupt subscription, function \texttt{subscribe\_kbc\_interrupt, } was implemented. To manage keyboard interrupts, functions \texttt{kbc\_ih}, \texttt{keyboard\_get\_scancode} were implemented and used. |
|
207 |
|
|
208 |
\func{Keyboard in interrupt mode.} |
|
209 |
\subsection{Mouse} |
|
210 |
\func{Mouse buttons and movement in interrupt mode.} |
|
211 |
\subsection{Video card} |
|
212 |
\func{Video Card in graphic mode with direct color encoding, dynamic updating of VRAM/screen.} |
|
213 |
\subsection{Real-Time Clock (RTC)} |
|
214 |
\func{Use of the RTC functionalities needed to implement the requirements stated in the role of the device.} |
|
215 |
\subsection{Serial port} |
|
216 |
\func{Point-to-point communication between two computers.} |
|
217 |
\pagebreak |
|
117 | 218 |
\section{Code organization/structure} |
118 | 219 |
Hey |
119 | 220 |
\section{Implementation details} |
Also available in: Unified diff