Small error changes!

This commit is contained in:
niklas 2011-04-12 12:05:47 +02:00
parent 0031285971
commit 71c4da0a47

View file

@ -292,7 +292,7 @@ The introduction aims to give the reader a good base to stand on when taking
on the rest of this thesis. on the rest of this thesis.
A background and motivation of why this topic is interesting is given, A background and motivation of why this topic is interesting is given,
and some basic terminoligy is defined and explained. and some basic terminoligy is defined and explained.
To understand many of the core issued in the GGS, some prior knowledge To understand many of the core issues in the GGS, some prior knowledge
of other topics is needed, the introduction aims to give this prior knowledge. of other topics is needed, the introduction aims to give this prior knowledge.
\end_layout \end_layout
@ -334,7 +334,7 @@ s is large.
Users will notice this in low uptime and many crashes. Users will notice this in low uptime and many crashes.
This is a problem that has existed and been resolved in other industries. This is a problem that has existed and been resolved in other industries.
One good example is the telecom industry which have managed to develop One good example is the telecom industry which have managed to develop
a solution to similar problems. solutions to similar problems.
\end_layout \end_layout
\begin_layout Standard \begin_layout Standard
@ -350,7 +350,7 @@ the nine nines
\begin_inset Formula $15ms$ \begin_inset Formula $15ms$
\end_inset \end_inset
in a year. downtime in a year.
The level of instability and bad fault tolerance seen in the game server The level of instability and bad fault tolerance seen in the game server
industry would not have been accepted in the telecoms industry. industry would not have been accepted in the telecoms industry.
This level of instability should not be accepted in the game server industry This level of instability should not be accepted in the game server industry
@ -492,7 +492,7 @@ Java Virtual Machine
TUXEDO TUXEDO
\emph default \emph default
application server, which can be used to run applications written in COBOL, application server, which can be used to run applications written in COBOL,
C++ and others. C++ and other languages.
\end_layout \end_layout
\begin_layout Standard \begin_layout Standard
@ -518,9 +518,9 @@ The word
\emph on \emph on
generic generic
\emph default \emph default
in GGS implies that the system is able to run a very broad range of different in the GGS implies that the system is able to run a very broad range of
code, for instance code written in different programming languages, in different code, for instance code written in different programming languages,
addition to a broad range of different game types. in addition to a broad range of different game types.
In order to support this, a virtual machine (VM) for each In order to support this, a virtual machine (VM) for each
\emph on \emph on
game development language game development language
@ -531,22 +531,22 @@ game development language
\begin_layout Standard \begin_layout Standard
No hard limit has been set on which languages can be used for game development No hard limit has been set on which languages can be used for game development
on GGS, but there are several factors which decide the feasibility of a on the GGS, but there are several factors which decide the feasibility
language; of a language;
\end_layout \end_layout
\begin_layout Itemize \begin_layout Itemize
How well it integrates with Erlang, which is used in the core GGS system How well it integrates with Erlang, which is used in the core the GGS system
\end_layout \end_layout
\begin_layout Itemize \begin_layout Itemize
How easy it is to send messages to the virtual machine of the GDL from GGS How easy it is to send messages to the virtual machine of the GDL from the
GGS
\end_layout \end_layout
\begin_layout Itemize \begin_layout Itemize
How easy it is to send messages from the GDL VM to GGS How easy it is to send messages from the GDL VM to the GGS
\begin_inset Note Note \begin_inset Note Note
status open status open
@ -560,9 +560,10 @@ Add more like threads, events, etc.
\end_layout \end_layout
\begin_layout Standard \begin_layout Standard
Internally, the GDL VM needs to interface with GGS to make use of the helpers Internally, the GDL VM needs to interface with the GGS to make use of the
and tools that GGS provides. helpers and tools that the GGS provides.
Thus an internal API has to be designed for use in interacting with GGS. Thus an internal API has to be designed for use in interacting with the
GGS.
This API is ideally completely independent of the GDL, and reusable for This API is ideally completely independent of the GDL, and reusable for
any GDL. any GDL.
\end_layout \end_layout
@ -578,7 +579,7 @@ The communication with gaming clients has to take place over a protocol.
\end_layout \end_layout
\begin_layout Standard \begin_layout Standard
A great deal of work is devoted to make GGS A great deal of work is devoted to make the GGS
\emph on \emph on
reliable reliable
\emph default \emph default
@ -586,7 +587,7 @@ reliable
This includes ensuring that the system scales well, and to make sure it This includes ensuring that the system scales well, and to make sure it
is fault tolerant. is fault tolerant.
In order to facilitate scalability, we need a storage platform which is In order to facilitate scalability, we need a storage platform which is
accessible and consistent among all of GGS, this is also investigated. accessible and consistent among all of the GGS, this is also investigated.
\end_layout \end_layout
\begin_layout Section \begin_layout Section
@ -637,7 +638,7 @@ World of Warcraft
\end_layout \end_layout
\begin_layout Standard \begin_layout Standard
In turn based games each player has to wait for her turn. In turn based games each player has to wait for their turn.
Latency is not a problem since the gameplay does not require fast interactions Latency is not a problem since the gameplay does not require fast interactions
between the players, long round trip times will not be noticed. between the players, long round trip times will not be noticed.
Examples of turn based games include board and card games, as well as multiplay Examples of turn based games include board and card games, as well as multiplay
@ -649,7 +650,6 @@ Jeopardy
Both game types have varying difficulties and needs when it comes to implementi Both game types have varying difficulties and needs when it comes to implementi
ng them, a Generic Game Server should address all of them and help the developer ng them, a Generic Game Server should address all of them and help the developer
to accomplish his goal. to accomplish his goal.
\end_layout \end_layout
\begin_layout Standard \begin_layout Standard
@ -663,7 +663,7 @@ The implementation of the GGS described in this thesis is only a small prototype
and tests will be performed on simple games like pong or chess, thus there and tests will be performed on simple games like pong or chess, thus there
are no need to implement more advanced features in the system. are no need to implement more advanced features in the system.
It is important to note that these limitations only apply for the prototype It is important to note that these limitations only apply for the prototype
of the project, and that further developments to GGS could be to implement of the project, and that further developments to the GGS could be to implement
these features. these features.
\end_layout \end_layout
@ -726,10 +726,23 @@ Performance
\begin_layout Standard \begin_layout Standard
How many players can we have on a server? Performance differences between How many players can we have on a server? Performance differences between
games? e.g can one game have thousands players on a server and another only games? e.g can one game have thousands players on a server and another only
have hundreds? Questions to be discussed here. have hundreds? Questions
\end_layout
\begin_layout Standard
In the current state game servers is coded for each game that needs it,
in many cases this seems like a bad solution.
Developers that want to make a network game need to understand network
programming.
A way to change this is a generic game server which give the game developers
a server which they implement their game towards.
This approach would not only make it easier to develop network games, it
would also allow games in different programming languages to be implemented
using the same server.
to be discussed here.
\begin_inset Note Note \begin_inset Note Note
status collapsed status open
\begin_layout Plain Layout \begin_layout Plain Layout
Create a game with several thousand players, see how our server scales, Create a game with several thousand players, see how our server scales,
@ -827,15 +840,15 @@ HTTP
\begin_layout Standard \begin_layout Standard
Since HTTP is so widely used on the Internet today in web servers, it is Since HTTP is so widely used on the Internet today in web servers, it is
available on most Internet connected devices. available on most Internet connected devices.
This means that if HTTP is used in GGS, firewalls will not pose problems, This means that if HTTP is used in the GGS, firewalls will not pose problems,
which is a great benefit. which is a great benefit.
However, due to the intended usage of HTTP in web servers, the protocol However, due to the intended usage of HTTP in web servers, the protocol
was designed to be stateless and client-initiated. was designed to be stateless and client-initiated.
In order to maintain a state during a game session using HTTP, some sort In order to maintain a state during a game session using HTTP, some sort
of token would have to be passed between client and server at all times, of token would have to be passed between client and server at all times,
much like how a web server works. much like how a web server works.
These facts combined makes HTTP unsuitable for our purposes, since GGS These facts combined makes HTTP unsuitable for our purposes, since the
requires a state to be maintained throughout a session, and also needs GGS requires a state to be maintained throughout a session, and also needs
to push data from the server to clients without the clients requesting to push data from the server to clients without the clients requesting
data. data.
It should also be mentioned that HTTP uses the TCP protocol for transport, It should also be mentioned that HTTP uses the TCP protocol for transport,
@ -857,7 +870,7 @@ Many online games use UDP as the carrier for their application layer protocol.
UDP is a good choice for applications where it is more important that data UDP is a good choice for applications where it is more important that data
arrives in a timely manner than that all data arrives undamaged, it is arrives in a timely manner than that all data arrives undamaged, it is
thus very suitable for media streaming, for example. thus very suitable for media streaming, for example.
In GGS reliability of transfer was chosen before the speed of the transfer, In the GGS reliability of transfer was chosen before the speed of the transfer,
ruling out UDP as the transport later protocol. ruling out UDP as the transport later protocol.
\begin_inset Note Note \begin_inset Note Note
@ -884,8 +897,8 @@ For reliable transfers, TCP is often used on the Internet.
missing in UDP. missing in UDP.
This ensures the consistency of data, but also makes the transfer slower This ensures the consistency of data, but also makes the transfer slower
than if UDP had been used. than if UDP had been used.
In GGS, data consistency is more important than transfer speeds, and thus In the GGS, data consistency is more important than transfer speeds, and
TCP is a better alternative than UDP. thus TCP is a better alternative than UDP.
\begin_inset Note Note \begin_inset Note Note
status open status open
@ -913,23 +926,24 @@ Fault tolerance is an important factor in all servers, a server that is
This means that fault tolerance is different in each system depending on This means that fault tolerance is different in each system depending on
what specification they have. what specification they have.
A system could be fault tolerant in different aspects, one is where the A system could be fault tolerant in different aspects, one is where the
system is guaranteed to be live but not safe and it could also be reversed, system is guaranteed to be available but not safe and it could also be
that the system is safe but not guaranteed to be live. reversed, that the system is safe but not guaranteed to be available.
Depending on the system one property may be more important(some example Depending on the system one property may be more important(some example
here). here).
A system could also have non existent fault tolerance or it could be both A system could also have non existent fault tolerance or it could be both
safe and guaranteed to be live. safe and guaranteed to be available.
It should be noted that it is not possible to achieve complete fault tolerance, It should be noted that it is not possible to achieve complete fault tolerance,
a system will always have a certain risk of failure. a system will always have a certain risk of failure.
With this in mind the goal is to make GGS as fault tolerant as possible. With this in mind the goal is to make the GGS prototype as fault tolerant
as possible.
\end_layout \end_layout
\begin_layout Standard \begin_layout Standard
In order to make GGS fault tolerant the programming language Erlang will In order to make the GGS prototype fault tolerant the programming language
be used. Erlang has been used.
Erlang will not guarantee a fault tolerant system but it has features that Erlang will not guarantee a fault tolerant system but it has features that
support and encourage the development of fault tolerant systems. support and encourage the development of fault tolerant systems.
In GGS it is important that the system overall is fault tolerant. In the GGS it is important that the system overall is fault tolerant.
Crashes of the whole system should be avoided as this would make the system Crashes of the whole system should be avoided as this would make the system
unusable for a time. unusable for a time.
By using supervisor structures it is possible to crash and restart small By using supervisor structures it is possible to crash and restart small
@ -949,7 +963,6 @@ ility is more important than the safety of the system.
For example a simple calculation error will not be critical for a game For example a simple calculation error will not be critical for a game
server but it may be in a life-critical system and then it is better that server but it may be in a life-critical system and then it is better that
the system crashes. the system crashes.
\end_layout \end_layout
\begin_layout Subsubsection \begin_layout Subsubsection
@ -963,9 +976,9 @@ Availability
\begin_layout Standard \begin_layout Standard
One important factor of any server is the availability. One important factor of any server is the availability.
A server to which you are unable to connect to is a useless server. A server to which you are unable to connect to is a useless server.
Other then within telecomunication, their uptime is of about 99,99%, the Other then within telecomunication, their uptime is of about 99,9999999%,
game developer community hasn't approched this problem very genuinely yet the game developer community hasn't approched this problem very genuinely
so there is much room for improvement. yet so there is much room for improvement.
\end_layout \end_layout
\begin_layout Standard \begin_layout Standard
@ -980,7 +993,7 @@ Add more information about that
\end_inset \end_inset
but for the GGS a different approche has been chosen. but for the GGS a different approach has been chosen.
Instead of just duplicating a virtual machine, the programming language Instead of just duplicating a virtual machine, the programming language
Erlang has been used which offers several features to increase the availability. Erlang has been used which offers several features to increase the availability.
Some of them are Some of them are
@ -1009,21 +1022,22 @@ Scalability
\end_layout \end_layout
\begin_layout Standard \begin_layout Standard
Each instance of GGS contains several tables. Each instance of the GGS contains several tables.
Each table is an isolated instance of a game, for example a chess game Each table is an isolated instance of a game, for example a chess game
or a poker game. or a poker game.
The way that GGS scales is to distribute these tables on different servers. The way that the GGS scales is to distribute these tables on different
servers.
In many games it is not necessary for a player to move between tables during In many games it is not necessary for a player to move between tables during
games. games.
This is for example not a common occurrence in chess, where it would be This is for example not a common occurrence in chess, where it would be
represented as a player standing up from her current table and sitting represented as a player standing up from her current table and sitting
down at a new table, all within the same game session. down at a new table, all within the same game session.
With this in mind, the main focus of GGS is not to move players between With this in mind, the main focus of the GGS is not to move players between
tables, but to keep a player in a table, and to start new tables instead. tables, but to keep a player in a table, and to start new tables instead.
When a server has reached a certain amount of players the performance will When a server has reached a certain amount of players the performance will
start to decrease. start to decrease.
To avoid this GGS will start new tables on another server, using this technique To avoid this the GGS will start new tables on another server, using this
the players will be close to evenly distributed between the servers. technique the players will be close to evenly distributed between the servers.
It is important to investigate and find out how many players that are optimal It is important to investigate and find out how many players that are optimal
for each server. for each server.
This approach makes it possible to utilize all resources with moderate This approach makes it possible to utilize all resources with moderate
@ -1034,7 +1048,7 @@ Each instance of GGS contains several tables.
\begin_layout Standard \begin_layout Standard
As mentioned in the purpose section there are two different types of scalability As mentioned in the purpose section there are two different types of scalability
, structural scalability and load scalability. , structural scalability and load scalability.
To make GGS scalable both types of scalability are needed. To make the GGS scalable both types of scalability are needed.
Structural scalability means in our case that it should be possible to Structural scalability means in our case that it should be possible to
add more servers to an existing cluster of servers. add more servers to an existing cluster of servers.
By adding more servers the limits of how many users a system can have is By adding more servers the limits of how many users a system can have is
@ -1042,7 +1056,7 @@ As mentioned in the purpose section there are two different types of scalability
Load scalability in contrast to structural scalability is not about how Load scalability in contrast to structural scalability is not about how
to increase the actual limits of the system. to increase the actual limits of the system.
Instead it means how good the system handles increased load. Instead it means how good the system handles increased load.
GGS should be able to scale well in both categories. The GGS should be able to scale well in both categories.
\end_layout \end_layout
\begin_layout Standard \begin_layout Standard
@ -1259,7 +1273,7 @@ reference "alg:A-simple-generator"
\end_inset \end_inset
may yield non-unique identifiers due to the lack of mutual exclution. may yield non-unique identifiers due to the lack of mutual exclusion.
\end_layout \end_layout
\begin_layout Standard \begin_layout Standard
@ -1319,7 +1333,7 @@ reference "alg:A-simple-generator"
\end_inset \end_inset
with mutual exclusion, it is not possible to have identifier collisions with mutual exclusion, it is not possible to have identifier collisions
when recovering from network splits between GGS clusters. when recovering from network splits between the GGS clusters.
Consider figure Consider figure
\begin_inset CommandInset ref \begin_inset CommandInset ref
LatexCommand ref LatexCommand ref
@ -1698,7 +1712,7 @@ Techniques for ensuring reliability
\begin_layout Standard \begin_layout Standard
One of the main goals of the project is to achieve high reliability. One of the main goals of the project is to achieve high reliability.
A highly reliable application is one crashes very, very rarely A highly reliable application is one that crashes very, very rarely
\begin_inset Note Note \begin_inset Note Note
status collapsed status collapsed
@ -1790,7 +1804,7 @@ When the linking of processes in order to monitor exit behaviour is coupled
\end_layout \end_layout
\begin_layout Standard \begin_layout Standard
In GGS, we have separated the system in to two large supervised parts. In the GGS, we have separated the system in to two large supervised parts.
We try to restart a crashing child separately, if this fails too many We try to restart a crashing child separately, if this fails too many
\begin_inset Foot \begin_inset Foot
status collapsed status collapsed
@ -1948,7 +1962,7 @@ erlang_js
To be able to run JavaScript on our server we needed to embed a JavaScript To be able to run JavaScript on our server we needed to embed a JavaScript
engine within the server. engine within the server.
After a thorough investigation erlang_js became our choice. After a thorough investigation erlang_js became our choice.
erlang_js provides direct communication with a JavaScript VM (Virtual Machine). Erlang_js provides direct communication with a JavaScript VM (Virtual Machine).
This was exactly what we wanted, but we also needed the possibility to This was exactly what we wanted, but we also needed the possibility to
communicate from erlang_js to Erlang. communicate from erlang_js to Erlang.
This functionality was not yet implemented in erlang_js, due to lack of This functionality was not yet implemented in erlang_js, due to lack of
@ -2018,20 +2032,38 @@ The clients pictured as green circles can be thought of as the physical
\begin_layout Standard \begin_layout Standard
When a player wants to enter the our particular chess club, he must first When a player wants to enter the our particular chess club, he must first
be let in by the doorman, called the Dispatcher in GGS. be let in by the doorman, called the
\emph on
Dispatcher
\emph default
in the GGS.
\end_layout \end_layout
\begin_layout Standard \begin_layout Standard
He then gets a name badge, and thus becomes a Player process in the system. He then gets a name badge, and thus becomes a
He is also guided in to the lobby by the Coordinator, which has the role \emph on
of the host of the chess club. Player
\emph default
process in the system.
He is also guided in to the lobby by the
\emph on
Coordinator
\emph default
, which has the role of the host of the chess club.
\end_layout \end_layout
\begin_layout Standard \begin_layout Standard
When players wish to play against each other, they talk to the Coordinator When players wish to play against each other, they talk to the
\emph on
Coordinator
\emph default
who pairs them up, and places them at a table. who pairs them up, and places them at a table.
Once they have sat down at the table, they no longer need the assistance Once they have sat down at the table, they no longer need the assistance
of the Coordinator, all further communication takes place via the table. of the
\emph on
Coordinator
\emph default
, all further communication takes place via the table.
This can be thought of as the actual chess game commencing. This can be thought of as the actual chess game commencing.
\end_layout \end_layout
@ -2044,14 +2076,28 @@ All the moves made in the game are recorded by the table, such that the
\begin_layout Standard \begin_layout Standard
Once a player wishes to leave a game, or the entire facility, he should Once a player wishes to leave a game, or the entire facility, he should
contact the Coordinator, who revokes his name badge and the Dispatcher contact the
\emph on
Coordinator
\emph default
, who revokes his name badge and the
\emph on
Dispatcher
\emph default
will let the player out. will let the player out.
\end_layout \end_layout
\begin_layout Standard \begin_layout Standard
With the information kept in the tables and the Coordinator combined, we With the information kept in the tables and the
can rebuild the entire state of the server at a different location. \emph on
This can be thought of the chess club catching fire, and the Coordinator Coordinator
\emph default
combined, we can rebuild the entire state of the server at a different
location.
This can be thought of the chess club catching fire, and the
\emph on
Coordinator
\emph default
rounding up all the tables, running to a new location and building the rounding up all the tables, running to a new location and building the
club up in the exact state it was prior to the fire. club up in the exact state it was prior to the fire.
\begin_inset Float figure \begin_inset Float figure
@ -2136,9 +2182,9 @@ Software development methodology
\begin_layout Standard \begin_layout Standard
The project has not followed any specific software development methodology. The project has not followed any specific software development methodology.
All work have been based on a predefined schedule and the specifications All work has been based on a predefined schedule and the specifications
are made by team members rather than an outside customer or stakeholder. are made by team members rather than an outside customer or stakeholder.
The process can be described by a plan-driven development method going The process can be described as a plan-driven development method going
from brainstorming to design, then implementation and finally testing. from brainstorming to design, then implementation and finally testing.
Yet there have been cycles in the process such as redesign and code refactoring. Yet there have been cycles in the process such as redesign and code refactoring.
\end_layout \end_layout