Matrices are the core aspect that play a huge role in a lot of game mechanics as they can be used to organise data in games, the regular term for matrices, a matrix, is a table of values which are organized by rows and columns.
The main uses for matrices are for games such as Skyrim each item you has a significant value of numbers associated with them so it is definitely ideal for RPGs or games that requires a player to keep an eye out on the stats a particular weapon or a certain skill level that a player has to wear a particular armour piece. It can be used for managing AI such as the enemy AI tracking positions for chasing the character AI which have specific coding coordinates and commands to be able to chase after the character and cause damage (lose a life) to the character. It can also be used as shaders in terms of 3D modelling as this could be programmed to shade in a particular direction in a particular colour which has all been combined to make up an object.
A matrix usually consists of 3 columns and 3 rows which you can also flip them on a pivot which can make each row a column which is also known as a transposition. One of the most vital aspects to understand is that if you transpose a matrix which has already been transposed, then you will be able to get the original matrix back. Another interesting fact about matrices is that you can add them together and subtract them from each other (providing that they have the same size of rows and columns) as well as being able to scale them and multiply them together (though multiplying can only be done under specific circumstances).
The way you would need to multiply two matrices (we'll call them M and N) is that the number of rows in M must be the same as the number of columns in N.
Now with this topic in mind, there is another way of how AI would be programmed is through Markov chains, Markov Chains work the same way as how matrices are multiplied as there is a state matrix - this keeps track of the values that we're going to be using in order for our AI to make decisions, then there is a transition matrix - its role is to make alterations to the values that are in the state matrix every time there is some in-game action occurring and when you multiply the state matrix by the transition matrix you end up with a new state matrix.
Firstly, I've come up with my own AI quick time event scenario; an ominous tremor causes the ground to shake and the surrounding environment starts to become destroyed around the player causing distress and harm to the NPCs as the world gets destroyed them - the possibility of succession is determined if the player chooses to escape onto another area and chooses to save themselves or help the NPCs around them by choosing to stop the falling debris or trees in time from being able to harm them and prevent injuries. The player has three options to choose from:
- Option A is the player chooses to escape to another area to free themselves
- Option B is the player chooses to help save the villagers which does end up destroying the players possible way of escaping
- Option C is the player chooses none of the following options
The values that are in this state matrix is to represent the significant impact each option has depending on which option the player chooses. The higher the value the higher the impact.
S = [ 1.0 1.5 0.5 ] The total value of the significant each
A B C option has is 3
Then let's make the transition matrix for if the player decides to choose option B
First, The impact on B would be high (0.7/ 70%) because the player chose option B because the player would reward the player for helping them and even help the player find a new area to escape, so the impact of option A would be slightly lower than B (0.2/20%) as even though the original point of escape was destroyed, there is still a way for the player to reach the same or a different area from helping the NPCs. This means that the impact option C has is nothing for both A and B as the player chose to perform an action on either decision so there would be no significant impact on either one (0%). Though the impacts of A and B would equally be high if the player chose option C as the player decided to do nothing so the point of escape is destroyed and the NPCs are at more risk of being in danger or worse (0.6/60%). If the player decided to choose option A then the impact on option B would be slightly average (0.5/50%) as although the player managed to escape the disaster and is able to explore a new area, the NPCs aren't so lucky and are not able to fend for themselves and also why the impact of A is lower than the impact of B for option A (0.4/40%) as although it seems like the most viable option, the player might miss out on some important dialogue from the NPCs if they chose option A.
This table below would be the transition matrix if the player chose option B

From participating in this workshop, I would be able to measure out and calculate how quick time event options have a significant impact depending on the decision the player chose to make also how the players chosen option could impact other choices.
I would use Markov Chains in a more technical standpoint to help program the general programming commands that I would need to incorporate such as enemy mapping and the success rate of being able to perform quick time events (for multiple choice and the impact it could have on the player or the people around them). I would use a storyboard to represent the quick time event scenario and the impacts from a visual standpoint.
Comments