added base information for the game allocator

This commit is contained in:
2025-10-08 11:53:57 +01:00
parent af48a2c184
commit 3729db43c0
3 changed files with 157 additions and 3 deletions

View File

@@ -55,3 +55,81 @@ section below.
#+attr_latex: :height 500px #+attr_latex: :height 500px
#+CAPTION: High level architecture of the entire project #+CAPTION: High level architecture of the entire project
[[./Flightsimarch.drawio.png]] [[./Flightsimarch.drawio.png]]
** Game allocator
The game allocator stores information about the game sessions. This consists of attributes
such as:
#+NAME: DSGameSession
#+BEGIN_SRC
- Game Session ID <UUID>
- Session name <String>
- Nodes Running the game [
{ Rendered Node IP <String>
Rendered Node Specs <Node Specs>
Flight Route Path loaded <TBD when network
scenery files
defined>
User on Node <UUID>
Flight Sim API url <String>
} ..... N ]
- Instructor ID <String>
#+END_SRC
The following above shows a high level data structure for storing session
information. A session consists of multiple pilots training with a single
instructor. Each pilot is assigned a node to render the game remotely
and the instructor can set the scenarios to be trained on.
*** Interfaces
We will now motivate the higher level interfaces to construct a _game allocator_
this term is inspired from the use of terms like /malloc/ and /free/ in userspace
for allocating memory in a kernel.
#+BEGIN_SRC
Instructor = AddInstructor(<Instructor object>)
#+END_SRC
This function creates a insturctor in database.
#+BEGIN_SRC
Player = AddPlayer(<player object>)
#+END_SRC
Creates a player (i.e trainer) to the database.
#+BEGIN_SRC
NodePlayer = AllocateNode(<player object>)
#+END_SRC
Finds a free node varaible and adds allocates
a player to it based on least latency.
#+BEGIN_SRC
FreeNode(NodePlayer)
#+END_SRC
Frees the player from the node. Normally called
after the end of the flight session.
#+BEGIN_SRC
Node = AddNode(<register node information>)
#+END_SRC
Adds a node that can redered the flight sim
into the network.
#+BEGIN_SRC
FreeNode(Node)
#+END_SRC
Removes the flight sim render node
from the network.
#+BEGIN_SRC
Session = CreateSession([Player],...n],[Instuctor,...n])
#+END_SRC
Create session of players mapped and adds
instructors to the session. This function
is a high level function that encapsulates
/AllocateNode/ and maps it to /Instructors/.
#+BEGIN_SRC
FreeSession(Session)
#+END_SRC
Free the entire session created.

Binary file not shown.

View File

@@ -1,4 +1,4 @@
% Created 2025-04-06 Sun 12:44 % Created 2025-10-08 Wed 11:52
% Intended LaTeX compiler: pdflatex % Intended LaTeX compiler: pdflatex
\documentclass[11pt]{article} \documentclass[11pt]{article}
\usepackage[utf8]{inputenc} \usepackage[utf8]{inputenc}
@@ -25,7 +25,7 @@
\begin{document} \begin{document}
\section{Xplane WebRTC} \section{Xplane WebRTC}
\label{sec:orgb89245a} \label{sec:org0e3cbea}
\begin{center} \begin{center}
\includegraphics[width=.9\linewidth]{./xprc.drawio.png} \includegraphics[width=.9\linewidth]{./xprc.drawio.png}
\end{center} \end{center}
@@ -76,7 +76,7 @@ approach and this open lot of areas of future research and hopefully better
performant flight simulators with better purposed algorithm to offload tasks to performant flight simulators with better purposed algorithm to offload tasks to
devices such as FPGAs or potato machines in abstraction layer similar to speaking nodes in an network. devices such as FPGAs or potato machines in abstraction layer similar to speaking nodes in an network.
\section{Architecture} \section{Architecture}
\label{sec:orgcd900b9} \label{sec:orgb730ec5}
This chapter dives into the high architecture design of the This chapter dives into the high architecture design of the
project and each module is communicated in detail on the following project and each module is communicated in detail on the following
section below. section below.
@@ -85,4 +85,80 @@ section below.
\includegraphics[height=500px]{./Flightsimarch.drawio.png} \includegraphics[height=500px]{./Flightsimarch.drawio.png}
\caption{High level architecture of the entire project} \caption{High level architecture of the entire project}
\end{figure} \end{figure}
\subsection{Game allocator}
\label{sec:orgd67a679}
The game allocator stores information about the game sessions. This consists of attributes
such as:
\begin{verbatim}
- Game Session ID <UUID>
- Session name <String>
- Nodes Running the game [
{ Rendered Node IP <String>
Rendered Node Specs <Node Specs>
Flight Route Path loaded <TBD when network
scenery files
defined>
User on Node <UUID>
Flight Sim API url <String>
} ..... N ]
- Instructor ID <String>
\end{verbatim}
The following above shows a high level data structure for storing session
information. A session consists of multiple pilots training with a single
instructor. Each pilot is assigned a node to render the game remotely
and the instructor can set the scenarios to be trained on.
\subsubsection{Interfaces}
\label{sec:org380680a}
We will now motivate the higher level interfaces to construct a \uline{game allocator}
this term is inspired from the use of terms like \emph{malloc} and \emph{free} in userspace
for allocating memory in a kernel.
\begin{verbatim}
Instructor = AddInstructor(<Instructor object>)
\end{verbatim}
This function creates a insturctor in database.
\begin{verbatim}
Player = AddPlayer(<player object>)
\end{verbatim}
Creates a player (i.e trainer) to the database.
\begin{verbatim}
NodePlayer = AllocateNode(<player object>)
\end{verbatim}
Finds a free node varaible and adds allocates
a player to it based on least latency.
\begin{verbatim}
FreeNode(NodePlayer)
\end{verbatim}
Frees the player from the node. Normally called
after the end of the flight session.
\begin{verbatim}
Node = AddNode(<register node information>)
\end{verbatim}
Adds a node that can redered the flight sim
into the network.
\begin{verbatim}
FreeNode(Node)
\end{verbatim}
Removes the flight sim render node
from the network.
\begin{verbatim}
Session = CreateSession([Player],...n],[Instuctor,...n])
\end{verbatim}
Create session of players mapped and adds
instructors to the session. This function
is a high level function that encapsulates
\emph{AllocateNode} and maps it to \emph{Instructors}.
\begin{verbatim}
FreeSession(Session)
\end{verbatim}
Free the entire session created.
\end{document} \end{document}