diff --git a/flight-proposal.org b/flight-proposal.org index 0da3776..9800570 100644 --- a/flight-proposal.org +++ b/flight-proposal.org @@ -55,3 +55,81 @@ section below. #+attr_latex: :height 500px #+CAPTION: High level architecture of the entire project [[./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 + - Session name + - Nodes Running the game [ + { Rendered Node IP + Rendered Node Specs + Flight Route Path loaded + User on Node + Flight Sim API url + } ..... N ] + - Instructor ID + #+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() +#+END_SRC +This function creates a insturctor in database. + +#+BEGIN_SRC + Player = AddPlayer() +#+END_SRC +Creates a player (i.e trainer) to the database. + +#+BEGIN_SRC + NodePlayer = AllocateNode() +#+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() +#+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. + diff --git a/flight-proposal.pdf b/flight-proposal.pdf index 729268d..1c758a9 100644 Binary files a/flight-proposal.pdf and b/flight-proposal.pdf differ diff --git a/flight-proposal.tex b/flight-proposal.tex index 196ae9e..21b8f93 100644 --- a/flight-proposal.tex +++ b/flight-proposal.tex @@ -1,4 +1,4 @@ -% Created 2025-04-06 Sun 12:44 +% Created 2025-10-08 Wed 11:52 % Intended LaTeX compiler: pdflatex \documentclass[11pt]{article} \usepackage[utf8]{inputenc} @@ -25,7 +25,7 @@ \begin{document} \section{Xplane WebRTC} -\label{sec:orgb89245a} +\label{sec:org0e3cbea} \begin{center} \includegraphics[width=.9\linewidth]{./xprc.drawio.png} \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 devices such as FPGAs or potato machines in abstraction layer similar to speaking nodes in an network. \section{Architecture} -\label{sec:orgcd900b9} +\label{sec:orgb730ec5} This chapter dives into the high architecture design of the project and each module is communicated in detail on the following section below. @@ -85,4 +85,80 @@ section below. \includegraphics[height=500px]{./Flightsimarch.drawio.png} \caption{High level architecture of the entire project} \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 +- Session name +- Nodes Running the game [ + { Rendered Node IP + Rendered Node Specs + Flight Route Path loaded + User on Node + Flight Sim API url + } ..... N ] +- Instructor ID +\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() +\end{verbatim} +This function creates a insturctor in database. + +\begin{verbatim} +Player = AddPlayer() +\end{verbatim} +Creates a player (i.e trainer) to the database. + +\begin{verbatim} +NodePlayer = AllocateNode() +\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() +\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}