Skip to content

Commit

Permalink
Deploy preview for PR 11 🛫
Browse files Browse the repository at this point in the history
  • Loading branch information
RiscadoA committed Oct 27, 2024
1 parent 7302e1d commit 7eadde6
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 104 deletions.
53 changes: 27 additions & 26 deletions pr-preview/pr-11/04-is-out.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,22 @@ <h4>Project Management and Debugging <span class="m-text m-dim">(&#64;RiscadoA)<
<iframe width="560" height="340" style="display: block; margin: auto" src="https://www.youtube.com/embed/Pu40BjmmW2U" title="" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowFullScreen></iframe></section>
<section id="voxel-model-importing-tool-scarface1809">
<h4>Voxel Model Importing Tool <span class="m-text m-dim">(&#64;Scarface1809)</span></h4>
<p>In this release, we’ve added a highly useful plugin to <strong>Tesseratos</strong>: a <strong>Voxel Model Importing Tool</strong>. With this new tool, you can now import <cite>.qb</cite> files directly within the editor, bypassing the need for the external conversion tool <strong>Quadrados</strong>.</p>
<p>Previously, importing voxel models required converting <cite>.qb</cite> files into <cite>.pal</cite> and <cite>.grd</cite> files using Quadrados before they could be used in the engine. Now, with the <strong>Voxel Model Importer Plugin</strong>, the process has been simplified, acting as an interface to handle the conversion process within the editor.</p>
<p>The tool allows you to:
- Assign names to the <cite>.pal</cite> and <cite>.grd</cite> files.
- Choose the file paths where the <cite>.grd</cite> files and the <cite>.pal</cite> file should be saved.
- Specify how many <cite>.grd</cite> files supported by the <cite>.qb</cite> file you want to import.</p>
<p>With this tool, importing voxel models into your projects is now faster and easier, allowing for a smoother workflow and less reliance on Quadrados.</p>
<p>In this release, we've added a highly useful plugin to <strong>Tesseratos</strong>: a <strong>Voxel Model Importing Tool</strong>. With this new tool, you can now import <cite>.qb</cite> files directly within the editor, bypassing the need for the external conversion tool <strong>Quadrados</strong>.</p>
<p>Previously, importing voxel models required converting <cite>.qb</cite> files into <cite>.pal</cite> and <cite>.grd</cite> files using <strong>Quadrados</strong>, a CLI tool, before they could be used in the engine. Now, with the <strong>Voxel Model Importer Plugin</strong>, the process has been simplified, acting as an interface to handle the conversion process within the editor.</p>
<p>The tool allows you to:</p>
<ul>
<li>Assign names to the <cite>.pal</cite> and <cite>.grd</cite> files.</li>
<li>Choose the file paths where the <cite>.grd</cite> files and the <cite>.pal</cite> file should be saved.</li>
<li>Specify how many <cite>.grd</cite> files supported by the <cite>.qb</cite> file you want to import.</li>
</ul>
<p>With this tool, importing voxel models into your projects is now faster and easier, allowing for a smoother workflow and less reliance on <strong>Quadrados</strong>.</p>
</section>
</section>
<section id="on-the-engine">
<h3>On the Engine</h3>
<section id="physics-with-rotation-fallenatlas">
<h4>Physics with Rotation <span class="m-text m-dim">(&#64;fallenatlas)</span></h4>
<p>We have <strong>rotations</strong>!</p>
<p>We have <strong>rotation</strong>!</p>
<img class="m-image" src="images/complex_physics_sample_rotations.gif" />
<p>Since the start of the physics plugin, we always treated rigid bodies as simple particles.
This is because the calculations were more intuitive, and it reduced the potential amount of mistakes we could make when first starting out. It also made debugging, of penetration solving for example, easier.
Expand All @@ -107,9 +109,9 @@ <h4>Physics with Rotation <span class="m-text m-dim">(&#64;fallenatlas)</span></
<section id="collision-manifold-and-collision-points">
<h5>Collision Manifold and Collision Points</h5>
<p>Previously, since everything was a particle, we simply computed if there was a collision using SAT, which also returned the normal along which the penetration was the smallest, along with that penetration value.
For rotations we need a <code>ContactManifold</code> Relation, that holds all information about the collision. A Contact Manifold is effectively a 2D polygon that details the surface of contact between the 2 bodies.
For rotations we need a <code>ContactManifold</code> relation, that holds all information about the collision. A <em>Contact Manifold</em> is effectively a 2D polygon that details the surface of contact between the 2 bodies.
In computer physics the bodies inter-penetrate each other, which does not happen in the real world. The manifold is the aproximation of the real contact surface the bodies would have.
This polygon is described by it's vertices, in the form of Contact Points, all of which contain their position and penetration in <code>ContactPointData</code>.</p>
This polygon is described by it's vertices, in the form of <em>Contact Points</em>, all of which contain their position and penetration in <code>ContactPointData</code>.</p>
<p>To compute the manifold we use the Sutherland Hodgman algorithm. Our current implementation was mostly inspired by this <a href="https://research.ncl.ac.uk/game/mastersdegree/gametechnologies/previousinformation/physics5collisionmanifolds/2017%20Tutorial%205%20-%20Collision%20Manifolds.pdf">tutorial</a>, which you can check out, to see how it works.</p>
<pre class="m-code"><span class="k">struct</span><span class="w"> </span><span class="nc">ContactPointData</span>
<span class="p">{</span>
Expand All @@ -129,7 +131,7 @@ <h5>Collision Manifold and Collision Points</h5>
<span class="w"> </span><span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">ContactPointData</span><span class="o">&gt;</span><span class="w"> </span><span class="n">points</span><span class="p">;</span><span class="w"> </span><span class="c1">///&lt; Contact points of this manifold.</span>
<span class="p">};</span></pre>
<p>With this change, our narrow phase firstly checks for collision with SAT, since it's cheaper, and only then computes the manifold.</p>
<p>The Collisions sample was also enhanced so we could visualize this information.</p>
<p>The collisions sample was also enhanced so we could visualize this information.</p>
<img class="m-image" src="images/collision_sample_manifold_demo.gif" />
</section>
<section id="new-components">
Expand All @@ -141,7 +143,7 @@ <h5>New Components</h5>
<h5>Expand the Integrator and Solver</h5>
<p>The last step was to add rotation in the Integrator and <code>PenetrationConstraint</code> Solving.</p>
<p>The integrator simply takes the <code>AngularImpulse</code> and <code>Torque</code> components and handles them similarly to the linear movement components.
We want to note that the <code>Force</code> component also holds a torque vector, in our current design. This is because our way of adding force on a point of the body is done through <code>Force</code>, meaning, it has an hidden torque vector, which we also use in the Integration fase.</p>
We want to note that the <code>Force</code> component also holds a torque vector, in our current design. This is because our way of adding force on a point of the body is done through <code>Force</code>, meaning, it has an hidden torque vector, which we also use in the Integration phase.</p>
<pre class="m-code"><span class="k">struct</span><span class="w"> </span><span class="nc">Force</span>
<span class="p">{</span>
<span class="w"> </span><span class="kt">void</span><span class="w"> </span><span class="nf">addForceOnPoint</span><span class="p">(</span><span class="n">glm</span><span class="o">::</span><span class="n">vec3</span><span class="w"> </span><span class="n">force</span><span class="p">,</span><span class="w"> </span><span class="n">glm</span><span class="o">::</span><span class="n">vec3</span><span class="w"> </span><span class="n">localPoint</span><span class="p">,</span><span class="w"> </span><span class="n">glm</span><span class="o">::</span><span class="n">vec3</span><span class="w"> </span><span class="n">centerOfMass</span><span class="p">)</span>
Expand All @@ -154,7 +156,7 @@ <h5>Expand the Integrator and Solver</h5>
<span class="w"> </span><span class="n">glm</span><span class="o">::</span><span class="n">vec3</span><span class="w"> </span><span class="n">mForce</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">{</span><span class="mf">0.0F</span><span class="p">,</span><span class="w"> </span><span class="mf">0.0F</span><span class="p">,</span><span class="w"> </span><span class="mf">0.0F</span><span class="p">};</span>
<span class="w"> </span><span class="n">glm</span><span class="o">::</span><span class="n">vec3</span><span class="w"> </span><span class="n">mTorque</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="p">{</span><span class="mf">0.0F</span><span class="p">,</span><span class="w"> </span><span class="mf">0.0F</span><span class="p">,</span><span class="w"> </span><span class="mf">0.0F</span><span class="p">};</span>
<span class="p">};</span></pre>
<p>The <code>PenetrationConstraint</code> is now solved for each contact Point, using their local anchor for relative velocity, separation and angular velocity calculation at each step.
<p>The <code>PenetrationConstraint</code> is now solved for each contact point, using their local anchor for relative velocity, separation and angular velocity calculation at each step.
This involved changing the constraint itself to also have <code>PenetrationConstraintPointData</code>, which are the same as the manifold points but with extra information to keep track of the constraint solving.
The constraint is now created when the <code>ContactManifold</code> relation is present between 2 entities, instead of <code>CollidingWith</code>.</p>
<pre class="m-code"><span class="k">struct</span><span class="w"> </span><span class="nc">PenetrationConstraintPointData</span>
Expand Down Expand Up @@ -242,26 +244,26 @@ <h4>Cascading Shadow Maps <span class="m-text m-dim">(&#64;tomas7770)</span></h4
<section id="input-axis-deadzones-kuukitenshi">
<h4>Input Axis Deadzones <span class="m-text m-dim">(&#64;kuukitenshi)</span></h4>
<p>Previously, dealing with input sources that exhibited drift, like older gamepad joysticks, required developers to manually filter out noise from input data.</p>
<p>In this release, we’ve introduced a new feature to make input handling more user-friendly: the input axis deadzones.
Deadzones can now be configured directly within the bindings asset, allowing players to adjust it in the settings for their controllers to filter out unwanted noise.</p>
<p>In this release, input deadzones can now be configured directly within the bindings asset, allowing players to adjust it in the settings for their controllers to filter out unwanted noise.</p>
<p>This enhancement significantly simplifies input handling and ensures a smoother and more reliable gameplay experience, especially for games that heavily rely on precise controller input.</p>
</section>
<section id="ortographic-cameras-mkuritsu">
<h4>Ortographic Cameras <span class="m-text m-dim">(&#64;mkuritsu)</span></h4>
<p>Created a standalone generic Camera component that holds the projection matrix of the current camera in use.</p>
<p>This component should be used and preferred for query operations where previously the Perspective Camera component would be used whenever possible, allowing for better separation and abstraction over the current camera.</p>
<p>With this, it was also possible to add an Ortographic Camera component in the new Camera system, this camera updates the matrix with an ortographic projection of the scene currently in view.</p>
<p>Previously we only had support for perspective cameras in Cubos, and additionally, perspective matrix computations were duplicated all over the code.
To address this, we've added a new generic <code>Camera</code> component that holds the projection matrix of the current camera in use.
Now, the <code>PerspectiveCamera</code> component is only used to fill in the <code>Camera</code> component with the correct projection matrix, and code needing the projection matrix can simply query the <code>Camera</code> component.</p>
<p>With this, we decoupled the camera type from the rest of code, allowing us to add a new <code>OrtographicCamera</code> component uses an ortographic projection instead of a perspective one.</p>
</section>
</section>
<section id="on-the-core">
<h3>On the Core</h3>
<section id="spans-for-profiling-and-tracing-roby2014">
<h4>Spans for Profiling and Tracing <span class="m-text m-dim">(&#64;roby2014)</span></h4>
<p>In our ongoing efforts to improve metrics and address performance issues, we are excited to announce the implementation of a new feature for telemetry: Tracing.
This addition will significantly enhance our ability to monitor and understand the execution flow of applications built with Cubos.</p>
This addition will significantly enhance our ability to monitor and understand the execution flow of applications built with <strong>Cubos</strong>.</p>
<p>Tracing allows developers to track the execution of their code by creating spans that represent specific periods of execution.
This capability makes it easier to log messages and visualize the flow of an application, providing valuable insights into performance and behaviour.</p>
<p>In Cubos, tracing is facilitated through a set of macros defined in <code>core/tel/tracing.hpp</code>:
<p>In <strong>Cubos</strong>, tracing is facilitated through a set of macros defined in <code>core/tel/tracing.hpp</code>:
- <code>CUBOS_SPAN_TRACE</code>
- <code>CUBOS_SPAN_DEBUG</code>
- <code>CUBOS_SPAN_INFO</code></p>
Expand Down Expand Up @@ -296,18 +298,17 @@ <h4>Spans for Profiling and Tracing <span class="m-text m-dim">(&#64;roby2014)</
<span class="o">[</span><span class="m">16</span>:03:31.967<span class="o">]</span><span class="w"> </span><span class="o">[</span>main.cpp:29<span class="w"> </span>main<span class="o">]</span><span class="w"> </span><span class="o">[</span>thread11740:main_span:other_scope<span class="o">]</span><span class="w"> </span>info:<span class="w"> </span>hello<span class="w"> </span>again!
<span class="o">[</span><span class="m">16</span>:03:31.968<span class="o">]</span><span class="w"> </span><span class="o">[</span>main.cpp:34<span class="w"> </span>main<span class="o">]</span><span class="w"> </span><span class="o">[</span>thread11740:main_span:other_scope:manual_span<span class="o">]</span><span class="w"> </span>info:<span class="w"> </span>entered<span class="w"> </span>a<span class="w"> </span>manual<span class="w"> </span>span
<span class="o">[</span><span class="m">16</span>:03:31.969<span class="o">]</span><span class="w"> </span><span class="o">[</span>main.cpp:37<span class="w"> </span>main<span class="o">]</span><span class="w"> </span><span class="o">[</span>thread11740:main_span:other_scope<span class="o">]</span><span class="w"> </span>info:<span class="w"> </span>after<span class="w"> </span><span class="nb">exit</span><span class="w"> </span>manual<span class="w"> </span>span</pre>
<p>Looking ahead, we aim to develop a Tesseratos plugin that will allow developers to debug and view all possible spans and their execution times
<p>Looking ahead, we aim to develop a <strong>Tesseratos</strong> plugin that will allow developers to debug and view all possible spans and their execution times
(e.g: <a class="m-link-wrap" href="https://github.com/bwrsandman/imgui-flame-graph">https://github.com/bwrsandman/imgui-flame-graph</a>).</p>
<p>This UI will enable developers to interact with the tracing data, providing a comprehensive view of the entire game flow.</p>
</section>
<section id="swapping-openal-for-miniaudio-diogomsmiranda-dageus">
<h4>Swapping OpenAL for Miniaudio <span class="m-text m-dim">(&#64;diogomsmiranda, &#64;Dageus)</span></h4>
<p>This milestone marks the beginning of an exciting new chapter for Cubos: the Audio Plugin.
<p>This release marks the beginning of an exciting new chapter for Cubos: the Audio Plugin.
But before we could start working on the plugin itself, we had to make some changes to the audio backend.
Previously, we were using OpenAL for audio, which no longer aligned with our vision for Cubos, so we decided to switch to <a href="https://miniaud.io">miniaudio.h</a>, a lightweight, single-file audio library easy to integrate and use while also sharing the same license as Cubos. Now, we are working on a new audio context abstraction <a href="https://docs.cubosengine.org/classcubos_1_1core_1_1al_1_1AudioContext.html#ac94450fd25db89331cfef27fd06c94a1">AudioContext</a> that will allow us to easily create other more conventional components that come with an audio system, such as AudioBuffers, Sources, and Listeners.</p>
<p>For those interested in a sneak peek, you can check out the interface in this src <a href="https://github.com/GameDevTecnico/cubos/blob/main/core/include/cubos/core/al/audio_context.hpp">file</a> containing the <code>AudioContext</code> class as well as <code>Source</code>, <code>Listener</code> and <code>Buffer</code> classes.</p>
<p>This change will allow us to have a more flexible audio system, making it easier to implement the audio plugin, coming in the next release of Cubos!</p>
<p><em>(Dev note: With these improvements, background music in Cubos could soon become a reality!)</em></p>
Previously, we were using OpenAL for audio, which no longer aligned with our vision for Cubos, so we decided to switch to <a href="https://miniaud.io">miniaudio.h</a>, a lightweight, single-file audio library easy to integrate and use while also sharing the same license as Cubos.
We implemented a new <code>AudioContext</code> abstraction on the core library, which hides the underlying audio library from the rest of the engine.</p>
<p>In the next release of <strong>Cubos</strong>, we're planning to have a fully functional audio plugin, which will allow you to play sounds and music in your games!</p>
</section>
<section id="type-client-and-type-server-riscadoa">
<h4>Type Client and Type Server <span class="m-text m-dim">(&#64;RiscadoA)</span></h4>
Expand Down
Loading

0 comments on commit 7eadde6

Please sign in to comment.