Week 9: Playtest

This week will be when we hold another play test for our game, for my sprint this week I wanted to try and make the elder rat look and lock onto the player when you get close and also create path finding for the humans.

Look at lock:

I wanted to have the elder rat look at you whilst you interact with him to achieve this I will be using the video below.

I started following this tutorial by masking the armature to only move the head, once the head was masked I chose all the bones I wanted to rotate including the head spine, moustache and ear bones.

After that I made some animations in unity, really simple animations where I rotate the head, I made another animation layer and added a blend tree where I put all the animations in.

I began doing some coding for the elder rat to look at target but I was struggling a bit since the tutorial wasn’t very clear and wasn’t using the best code. Parker managed to get it to work by changing and improvising the tutorials code.

video showing

Talking Animation:

I wanted to play the talking animation every time you activate the dialogue that Chen made on yarn spinner. I made a new layer and added the talk animation to the idle along side a bool parameter to activate the animation. I got some help from Parker for the coding again where he managed to code the animation getting activated when the elder rats dialogue plays.

Human Look At Target:

I thought I would do the same for the humans so that if you go near them they will look at you, for this all I had to do was the same as I did for the rat. I began with the child model where I made a mask avatar for his head, a new layer for the blend tree and also 4 animations for each direction he would look at. I then copied the same script i used for the elder rat but removed the yarnspinner code since they don’t have talking animations. Once the code was done I created a box collider that would act as a trigger to activate the code whenever the rat goes inside it. I repeated the same process for the rest of the human models.

video showing

Pathfinding:

Path finding is AI for a npc to move from one point to another without hitting any obstacles on its way. I wish to do this for the humans in the scene so that they can seem like they are interacting around the house.

Here’s a quick tutorial that I will be following for this.

The tutorial was a little outdated and over complicated but it turns out pathfinding is really simple using the AI navigation package. Using a new nav mesh object within a volume we set up around the house, we baked it and it turned out as shown in the image above. The blue areas are the walkable paths. Using a nav mesh agent on the child model, we set the target to be the rat and put the code that runs it inside the box collider trigger that we made before. Now each time the rat get too close to the child model it chases the player around.

PlayTest:

The play test went well, we managed to show the new quests such as the screw collection and the cake decoration. The testers also found the child chasing you around quite fun but it needs a picking up mechanic for a real sense of danger.

Notes:

Picking Up Mechanic:

Made some animation for the child’s interaction with the rat, such as the picking up the rat and walking with it. To see these animation visit my child animation page, Child Animations – Hugo Mazariegos.

Human picks the rat up and takes you towards a box which will be the only place the child wont try to grab you.

Once in the box the child will go back to his patrol spot. The whole process will repeat once the player enters the child FOV. The code for the whole thing is still broken since sometimes it just teleports you straight to the box and the animations sometimes just stop playing.

After doing this the Easter break started so I didn’t do much over the break.

Leave a Reply

Your email address will not be published. Required fields are marked *