doc/kishna.tex
author terom
Mon, 08 Dec 2008 00:16:43 +0000
changeset 274 c35307e8645c
parent 269 9024e805b4e2
child 278 2b856bc88e6d
permissions -rw-r--r--
add comments, move addPlayer/removePlayer to Player.cc, and refactor Network code to inherit from NetworkObject
238
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
     1
\documentclass[a4papre,12pt]{article}
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
     2
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
     3
\usepackage[utf8]{inputenc}
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
     4
\usepackage[english]{babel}
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
     5
\usepackage{listings} % For listing code
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
     6
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
     7
% Fancy headers
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
     8
\usepackage{fancyhdr}
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
     9
\fancypagestyle{plain} {
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    10
    \fancyhf{}
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    11
    \renewcommand{\headrulewidth}{0.4pt}
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    12
    \lhead{\textbf{Group 66}}
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    13
    \chead{\textbf{Kishna Glista - liero clone}}
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    14
    \rhead{\textsl{AS-0.1102}}
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    15
    \cfoot{\thepage}
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    16
}
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    17
\pagestyle{plain}
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    18
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    19
% Paragraph formatting
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    20
\frenchspacing
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    21
\setlength{\parindent}{0pt} 
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    22
\setlength{\parskip}{1ex plus 0.5ex minus 0.2ex}
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    23
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    24
% Title information
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    25
\title{Kishna Glista - Liero Clone}
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    26
\author{\normalsize{\begin{tabular}{lll}
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    27
Atle Kivelä & 79171V & atle.kivela@tkk.fi \\
269
9024e805b4e2 Some algorithms.
ekku
parents: 238
diff changeset
    28
Eric Malmi & 80351A & eric.malmi@tkk.fi \\
238
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    29
Tero Marttila & & \\
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    30
Marko Rasa & & \\
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    31
\end{tabular}}}
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    32
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    33
% The document begins
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    34
\begin{document}
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    35
\maketitle
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    36
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    37
\section{Instructions for compiling and use}
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    38
These should be pretty straightforward.
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    39
\subsection{Basic usage}
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    40
Starting. Default Keys. Starting the server. Connecting. etc.
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    41
\subsection{Configuration}
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    42
How to make configuration changes.
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    43
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    44
\section{Program architecture}
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    45
A brief description of the program architecture.
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    46
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    47
\section{Data structures and algorithms}
269
9024e805b4e2 Some algorithms.
ekku
parents: 238
diff changeset
    48
9024e805b4e2 Some algorithms.
ekku
parents: 238
diff changeset
    49
\subsection{World and Objects}
9024e805b4e2 Some algorithms.
ekku
parents: 238
diff changeset
    50
9024e805b4e2 Some algorithms.
ekku
parents: 238
diff changeset
    51
Usually, in side view 2D-games, the terrain is representated as a polygon. This allows us to implement collision detection and bouncing rather easily, and it is also a very compact way of storing the map. In our opinion Liero, however, is fundamentally a pixel based game and therefore we represent the terrain as a large array of pixels. These pixels are, however, abstract pixels, i.e. they are not necessarily in the same scale than the physical resolution. In other words, the server has an abstract resolution, which is the same for all clients, and the clients can visualize this abstract array of pixels in any resolution they wish.
9024e805b4e2 Some algorithms.
ekku
parents: 238
diff changeset
    52
9024e805b4e2 Some algorithms.
ekku
parents: 238
diff changeset
    53
On top of the terrain, the world also includes a list of all objects in it (players, projectiles and ropes). The objects have a polygon shape which is used in the collision detection between the objects and the terrain and the objects with each other.
9024e805b4e2 Some algorithms.
ekku
parents: 238
diff changeset
    54
9024e805b4e2 Some algorithms.
ekku
parents: 238
diff changeset
    55
\subsection{Collision Detection}
9024e805b4e2 Some algorithms.
ekku
parents: 238
diff changeset
    56
9024e805b4e2 Some algorithms.
ekku
parents: 238
diff changeset
    57
Collision detection takes care of the objects not moving inside the terrain nor inside each other. These two types of collision are different since the data structures are not the same. In the terrain-object collision the collision part is rather easy. When a object is about to move point A to point B we draw a line between those points. Then we iterate over that line and check that none of the vertices of the object's shape are inside the terrain. However, we have to be able to bounce the object from the terrain and in order to do that, a normal for the collision point needs to be calculated. For a polygon this would easy, but for a discrete array of pixels it's little bit different.
9024e805b4e2 Some algorithms.
ekku
parents: 238
diff changeset
    58
9024e805b4e2 Some algorithms.
ekku
parents: 238
diff changeset
    59
We come up with the following algorithm for calculating an approximation for the normal. Take the collision point and the point before the collision and consider a 3x3 array of pixels which has the collision point in the middle of it. Then, do sort of an bredth-first search from the previous point to get all the empty pixels. Take the vectors from the collision point to the empty point and sum these vectors. The resulting vector will point approximately along the normal. Picture explains this a lot.
9024e805b4e2 Some algorithms.
ekku
parents: 238
diff changeset
    60
9024e805b4e2 Some algorithms.
ekku
parents: 238
diff changeset
    61
\subsection{Physics}
9024e805b4e2 Some algorithms.
ekku
parents: 238
diff changeset
    62
238
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    63
Vectors, lists, collision detection, runge kutta, something network related?
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    64
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    65
\section{Known bugs}
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    66
A lots of them (or maybe not).
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    67
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    68
\section{Tasks sharing and schedule}
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    69
Hectic ass hell. Communication worked pretty well but we weren't as systematic
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    70
as we should have been.
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    71
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    72
\section{Differences to the original plan}
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    73
The plan was loose enough to let us make decisions during development. 
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    74
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    75
% References
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    76
\begin{thebibliography}{99}
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    77
\bibitem{foo} Foo reference
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    78
\end{thebibliography}
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    79
15193c2bbe2f Added documentation draft. It is done in tex. Hopefully everyone is okay with that.
saiam
parents:
diff changeset
    80
\end{document}