Week 43-44: YouTube "blessing" and biquaternions
Added 2023-09-06 11:23:47 +0000 UTCIn the past two weeks I was mostly on holiday. Well, the nursery was closed and my kid had to be looked-after full time. It was a pretty good incentive to go on holiday and spend time with our families. During these two weeks I still made some progress:
I hacked together an implementation of collision avoidance in the game. This is the relativistic counterpart of the demo I previously shared in Shadertoy and described here. I am quite pleased with the result. Collisions look right and navigation is still pleasant. The result is much better than what I had before, which was based on this post. The code handling collisions is, however, a bit messy. It needs some clean-ups and restructuring. I guess it’s trying to do too many things at once. Also, the algorithm can be improved but I’d rather focus on issues that are more pressing for the publication of the first minimal game demo.
I spent some time trying to better understand what happens to clocks placed in different points inside an accelerating relativistic rigid body. Short answer: the clocks end up getting out of sync. The effect is analogous to gravitational time-dilation, according to which clocks tick faster when they are further away from the gravitational source. Interestingly, Wikipedia tells me that “Gravitational time dilation was first described by Albert Einstein as a consequence of special relativity in accelerated frames of reference.” The conclusion is that proper time inside a rigid body is not a reliable time to use for animations, which - unfortunately - is what I am doing for the robot’s flames/fire. I will have to change this, possibly as a requirement for the demo publication. Not doing this means that the flames could look “odd” after playing the game for long enough.
Another change I’d like to do for the release is the replacement of 4x4 matrices in physics calculations with complexified quaternions, aka biquaternions. At the moment, I use 4x4 matrices to represent Lorentz transformations. At each time-step I multiply a matrix by another one. The problem is that - due to numerical errors - the result deviates more and more from being a Lorentz transformation. Biquaternions should solve this issue and prevent the game from becoming unplayable due to numerical errors. I’ll write a dedicated post once I manage to complete the replacement.
Finally, I have to mention that the “train in a tunnel paradox” was blessed by the YouTube algorithm. In the end, it did much better than I expected. I consider this the achievement of one of the objectives I set for myself at the start of the project: establish a link with my audience and gain some confidence that there is a market for my game. This is an important milestone. I’ll write a dedicated post about it. As a result of the success of the video, I found myself reading and replying to a lot of comments. That’s great but also time consuming. I am now keen on focusing my efforts and making more progress with the project.