August 2023

General

Hello, August’s and September’s devlogs were both written at the same time during September. I unfortunately was overloaded with work through these two months. They are therefore being published at the same time. I suggest you look at August’s devlog first, then September’s.

New hybrid collision method

Collisions can be handled in several different ways. 

To put it simply, there are simple collisions with several static shapes (rectangle, capsule, sphere). These are generally used for ragdolls or static objects.

For example, this container is made up of 4 rectangles for the different walls.

Container Collisions

And then there are surface collisions, which take into account each polygon and can be entirely deformed by the mesh.

Pot Collisions

Each of the two methods has its strengths and weaknesses, but it's generally preferable to use simple collisions in terms of quality of physical feedback and CPU performance.

In MMVS, due to scale differences, I need very accurate and deformable collisions, so surface collisions seem to be a better choice. However, the physical feedback is of very poor quality and this method consumes a lot of CPU resources.

 So, I created my own system to exploit the best of the two methods with a variable level of detail to optimize use.

During this month, I was mainly involved in research and development. The idea is to use static shapes for physics and collisions between characters, such as when a player pushes with his hand, and to use surface collisions for contacts and animations, such as when Cobble rubs his hands over Talas's paws.

Surface collisions will be separated into several parts and will have several levels of geometry depending on the distance from the player, allowing the game to be optimized when not close to Talas.

Rub shader and optimisation

It is possible to clean Talas' paws in-game, but to do so, there's a whole system and a lot of math behind it.

During this month I've been working on optimizing this system to improve CPU resource consumption and quality.

First, to detect the shape to be painted, the game will convert certain collision boxes in 3D spaces into a black-and-white 2D shader.

Then, between each frame, the 3D model is unfolded flat and captured. The shader then displays the contact zones and paints a 2D texture, as shown in this gif.

Brush And Paint Result

It's a little more complex than that, but I am attempting to make it easy to understand.

The optimizations I've been able to make are related to collision boxes storage on the shader and processing speed.

The shader needs to be updating by transfering lots of data, something that can now be easily done using a simple texture. Each pixel has 4 linear channels (RGB Alpha) ranging from 0 to 1. 

On the first pixel, for example, I can store the position of a capsule. I then use another pixel to store length, diameter and opacity, etc.

While I previously could only store a maximum of 32 spheres, I can now store 1365 capsules with a simple 64*64 texture with a much lower resource cost.

Loading Icon

All that's left is to calculate the various capsules through the shader (GPU) according to the data retrieved from each pixel.

Dynamic Shader Capsule Result

The various modifications allow me to improve the quality of the hand with many more collision boxes, and to get rid of some of the fixes and adjustments used in the previous system.

Here's the previous result.

And here’s the current result.

Desktop arms

I reworked how non-VR arms are managed and separated its code into a module external to the character. 

The aim was to make the game more modular.

This gives me more control and makes all of my code easier to debug. I also can now replicate arms in multiplayer.

Quest 2 better support.

Since the very first version of the game I've been working using my Pimax 5K VR headset through Steam VR.

A friend of mine lent me his VR Quest 2 headset, which allowed me to test and correct several bugs related to this specific headset and its controllers.

Pimax 5K   And Quest 2

Open XR has been used since v0.4.2 to ensure that the game is compatible with all Open XR-compatible headsets. However, there are still problems tied to each individual headset.

Other

Some work has been done to fix a large amount of small bugs. https://github.com/xavier150/MMVS/blob/main/ReleaseLog/v0.4.4.3_Alpha.md

I’ve also added an animated icon on the game’s loading screen.

MMVS Loading Icon UI

Loading Icon