mastodon.gamedev.place is one of the many independent Mastodon servers you can use to participate in the fediverse.
Mastodon server focused on game development and related topics.

Server stats:

5.1K
active users

For my procedural creatures, I'm still working on a (generic mathematical) system for manually creating a derived higher-level parametrization based on an original parametrization.

I got some great pointers about using the matrix pseudoinverse and made a working implementation of that which works for one level of "parents", but I'm still unsure how to expand this approach to support an arbitrary hierarchy of parent parameters.

I managed to work out the generalized matrix logic for arbitrary layers of parents, where each parent can pick children from not only the layer immediately below, but any layers below. I have it fully working in a test window - now to integrate it into my parametrization framework...

Rune Skovbo Johansen

Turned out there was a flaw in the logic above. Groups mixing contributions from multiple different lower levels didn't work right. I went back to my earlier idea of stacking matrices before using the pseudoinverse on them. This worked.

But then I noticed some patterns, and suspected I could simplify more. Instead of having different matrices with sizes corresponding to the parameters per layer, I could use large matrices corresponding to all the parameters at once. And I found out I could furthermore do the calculations for all layers at once too in one single swoop. The calculations I have in code now are much, much simpler than what I had before, and take up only a third as many lines.

Here is the entirety of the calculations I've ended up with. It is *so simple* compared to all the complex diagrams and implementations for them I had earlier.

@runevision Big sparse matrices make the world go round!

@TomF Apparently! I still have basically no practical experience with (non graphics related) data matrices for anything else than what I've been working on here, but I've felt my intuition leveling up and repeatedly found matrix math lead to simple and beautiful satisfying solutions.

@runevision They're simple and satisfying, but there's a massive number of 0.0f in those matrices, and often quite a few integers.

So sure - not many lines of code - but it can be considerable work for compilers and runtime libraries to remove those pointless multiplies.

Once you have a working solution, it's a very good idea to go back and figure out where all the zeros are and express the actual code in a more efficient way.

The poster-child for this is AI of course :-)

@TomF I’m using C# library math.net which has a sparse matrix representation option. I’m not currently using it since I haven’t experienced any performance issues so far (and I assume it has trade offs), but I assume if need be it can address the issue better than I could myself.

@runevision Well no. It you know that a value is never not-0, you can encode that yourself with a smaller matrix or a set of smaller submatrices. It takes effort for it to discover this stuff.

But yeah, at this stage you shouldn't worry about it. Finish the algo, then start tuning it.

@TomF The heavy calculations happen at edit time. The result is a derivation matrix and a reconstruction matrix. Those don’t change at runtime and are only used for multiplication with vectors. So whatever values are or are not zero stay that way once calculated.