From 67cd967437edd4ca0dd1b9f585b6677132642542 Mon Sep 17 00:00:00 2001 From: David Pires <79417054+Dacops@users.noreply.github.com> Date: Thu, 16 May 2024 22:36:34 +0100 Subject: [PATCH] docs: add serialization changes tl;dr --- content/0-2-and-coffeejam.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/content/0-2-and-coffeejam.rst b/content/0-2-and-coffeejam.rst index 5eff282..927f4e3 100644 --- a/content/0-2-and-coffeejam.rst +++ b/content/0-2-and-coffeejam.rst @@ -90,6 +90,7 @@ Check our documentation page for more information: https://gamedevtecnico.github Repeating systems and fixed-step updates :dim:`(@joaomanita)` ------------------------------------------------------------ + Certain plugins, like the physics plugin, required some of their systems to run multiple times per frame so that they could make more accurate aproximations. In addition, some of them need to be executed in ordered groups (ex: physics integrate position > update velocities > clear forces > clear impulses). To do this I added tags that make systems tagged by them be repeated while a condition is true (cubos.tag(exampleTag).repeatWhile({});). @@ -102,6 +103,20 @@ And to create subgroups, all you need to do is tag your subgroup tag with a pare With this it was easy to implement a fixed-step plugin, which adds a tag that forces systems to repeat according to the DeltaTime passed, avoiding variance due to different framerates and more/less powerful PCs. +Serialization overhaul :dim:`(@Dacops)` +--------------------------------------- + +Serialization is a crucial part of the game engine that allows for the saving of any CUBOS. game components aswell as then loading them in. Due to the new reflections +system used by CUBOS. serialization needed an overhaul to use these newer tecnologies that allow not only for a more user friendly usage but also to considerably reduce +the lines of code taken by this component. Previously only primitive types were natively supported for saving/loading, any newer structures implemented by the game +developers would need to be accompanied with overwrites of the saving/loading methods for the given structure. This, apart from being annoying could easily also amount +to an unecessary increase of lines of code written. +With the new reflections, this is no longer needed, developers just need to "reflect" their structures via a macro that ammounts to a single line, to declare their types. +The new saving/loading methods will then pick up on these structures and iteratively decompose them into primitive types. The methods for primitive types were also removed +for a common method, significantly reducing the space occupied by this feature. +Furthermore several other parts of the CUBOS. unnecessarely used serialization (such as voxel grids, palettes and input bindings) these were removed and replaced by faster +methods contributing to a more efficient engine. + Next steps ==========