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
#+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 <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.