memory management and minor improvements

This commit is contained in:
Benedikt Galbavy 2025-01-13 23:42:01 +01:00
parent 3be7a1c646
commit 87bcd39cf1

View File

@ -13,6 +13,8 @@
%\usepackage{xcolor} %\usepackage{xcolor}
%\definecolor{codecolor}{HTML}{FFC300} %\definecolor{codecolor}{HTML}{FFC300}
\usepackage{csquotes}
\title{VEGO-Engine} \title{VEGO-Engine}
\subtitle{A student project} \subtitle{A student project}
\author{Benedikt, Nicole} \author{Benedikt, Nicole}
@ -86,6 +88,8 @@ Hate
\item git-modules - do not bloat contributions \item git-modules - do not bloat contributions
} }
\subsection{ECS}
% ECS slides, split into 3 sections
\begin{frame}[allowframebreaks, fragile]{We made an ECS} \begin{frame}[allowframebreaks, fragile]{We made an ECS}
Why an ECS - Entity Component System? Why an ECS - Entity Component System?
\begin{itemize} \begin{itemize}
@ -98,7 +102,7 @@ Why an ECS - Entity Component System?
\note[itemize]{ \note[itemize]{
\item Reusable code mainly on engine side, but also applies to game dev components \item Reusable code mainly on engine side, but also applies to game dev components
\item plug and play mostly an advantage for game dev - i.e. "I want physics, here are physics" \item plug and play mostly an advantage for game dev - i.e. "I want physics, here are physics"
\item \say{video series} - tease issue of abruptly ending \item \enquote{video series} - tease issue of abruptly ending
\item Components usually only have data, and are querried by the system (hence ecS) \item Components usually only have data, and are querried by the system (hence ecS)
\item System part used for rendering \item System part used for rendering
} }
@ -149,6 +153,8 @@ projectile.addComponent<ColliderComponent>(0.6f);
\end{minted} \end{minted}
\end{frame} \end{frame}
\note{mention: this ease of use is our goal} \note{mention: this ease of use is our goal}
\subsection{Memory Management}
\begin{frame}[allowframebreaks, fragile]{Memory Management} \begin{frame}[allowframebreaks, fragile]{Memory Management}
\begin{minted}[linenos,autogobble]{c++} \begin{minted}[linenos,autogobble]{c++}
class Manager class Manager
@ -167,12 +173,20 @@ private:
\end{minted} \end{minted}
\framebreak \framebreak
Does that solve memory management? Not quite: Does that solve memory management? Not quite:
\begin{itemize} \begin{itemize}
\item Missing separation of concern - manager also propagates update call \item Missing separation of concern - manager also propagates update call
\item What if I want to "save" existing entities \item Does not allow "saving" existing entities
\item Everything is an entity
\end{itemize} \end{itemize}
Architectural issues like this are hard to solve this late in development
However it does solve memory management\footnote{For \texttt{Entity} classes only, there are some leaks due to bad usage of the \texttt{SDL\_mixer} library}
\end{frame}
\note[itemize]{
\item \enquote{Perfect example of why our ECS is not ideal}
\item scene management - would replace manager - however manager is too widely used - break API consistency
\item classic example of good on surface level only for a beginner; transition to more such examples
}
\end{frame} \end{frame}
%code example %code example