There is actually not much magic ivolved
If you multiply two matrices, you basically you just take all elements from the first
row of the left hand matrix and
multiply them with all elements of the first
collumn of the right hand matrix.
Sum these products togehter and you have the upper left element of the result matrix. Do this for every elements of the result matrix and you are done.
Here is an example with 2x2 matrices:
- Code: Select all
A =
1 2
3 4
B =
2 1
0 2
You multiply them to get matrix C:
- Code: Select all
A * B = C
C =
c1 c2
c3 c4
with:
c1 = 1 * 2 + 2 * 0 = 2
c2 = 1 * 1 + 2 * 2 = 5
c3 = 3 * 2 + 4 * 0 = 6
c4 = 3 * 1 + 4 * 2 = 11
The result C is than:
- Code: Select all
So C =
2 5
6 11
I know, this might be far to much math for people who just want to play games. But if you get familiar with this concept things get pretty easy, and it becomes possible to write down complex data in a nice way.
Take your beaver meat example:
lachlaan wrote:bb1 = bb0 * 1.23 + ph0 * 0.5 + yb0 * 0.5
The values '0.5', '0.5' and '1.23' somehow correspond to the last collumn of my beaver modifier matrix. It's the same information, but written in a more compact way.