Ferran Martín Vilà


Programmer

My Job:

I started working in the scripting system of the engine, improving some features like the transform component, and adding new ones like the material component. During the first sprint I only focus on the scripting system, but when the scrums were created I start collaborating on the AI development.

In the AI scrum I help building the base of the behavior threes and creating some actions like the steering arrive and the attack. Later, when more than one enemy behavior was programmed, I create an enemies manager in order to improve the interaction between the player and the different AIs.

Finally, when all the behaviors and actions were implemented, I focus on fixing AI bugs and building scene elements related with the AI in collaboration with the designers. Like the boss lever and the boss triggers.

In the next paragraphs there’s a more accurate description of my job.

Scripting

- GameObject Tag

Tags are used to classify all the game objects in different groups. You can define and delete the Tags to adapt them to your game. The GameObject Tag is used in the scripting system to get information about the object you are working with. For example, in a collision CompareTag method can be called to check if the collided object is an enemy or a wall.

- Physics

Methods to link physic with the scripting system. OnTriggerEnter and OnTriggerLost methods can be called from any script, you can get the collided GameObject from the component collider of the current object.

- UI

Methods to link UI with the scripting system. OnClick method can be called from any script and the button component contained in the same GameObject will trigger it automatically.

- Inherited variables

Originally, the scripting system don’t support the inherited variables, so you can’t call a variable that was contained in the fader script of the current one. Now inherited variables are accessible and you can modify them using code or from the inspector.

- Component Transform

Component transform was updated to be Unity like, adding methods and variables that let the programmers work with it more intuitively.

- Component Material

I build this component in order to let the gameplay programmers modify the materials textures during the game. Calling the different methods, you can change the textures sending the path of the new ones.

AI

- Behavior three inheritance

When we, the AI scrum, define the enemy behavior three I divide it in a basic BT that only contains the necessary variables to manage the actions, an Enemy BT with the basic BT data and the enemy stats, and finally a behavior three script for each enemy.

- Enemies Manager

To manage all the enemies in the scene I create an enemies manager where all the spear, lance, shield and boss enemies are saved. The main functionality of this script is helping the player to know about the enemies state. For example, inside the enemies manager there’s a method called FindEnemyByTile that the player uses to check if he can move in the desired direction or there’s an enemy on his way.

The enemies are stored at the start of the scene load using the initialization method of the behavior threes. When an enemy dies the RemoveEnemy method is called to delete it from the enemies manager. So, when an enemy is removed from the enemies manager the player can’t detect it.

- Actions
Steering Arrive

Used in the move action to stop the enemy smoothly when is near the target position.

Attack

A basic attack action that is triggered every x time when the player is in range. This action checks the current enemy type to use the correct animations. The attack rate is defined in the behavior three.

Apply Damage

This is not properly an action, is the virtual method that the player uses to damage the enemies. Every enemy override this method in order to generate a correct reaction, for example, the shield enemy can block some attacks.

Die

This is a simple action that triggers the die animation and removes the enemy from the enemies manager when the animation ends. So, the player can’t detect it and consequently you can walk over it.

Boss Wide Attack

Boss special attack that applies damage in an area front of it. To implement this attack, I use the map tiles and the boss direction to collect all the coordinates where the player is going to be damaged in the attack moment.

Boss Activate & Engage

I implement a method called Activate in the boss behavior three that enable the boss script and call the engage action. When the boss is active the engage action simply starts the presentation animation, enable the boss UI, blocks the player movement, and trigger the scream audio fx. When the engage action ends the player recover the control and the combat starts.

Boss Phase Change

When the boss is damaged over a X percent defined in the boss behavior three with a float (0.0 - 1.0) the phase change action is called. This action triggers a rampage animation, change the boss stats to upgrade it, and finally change the boss state. Change the boss state means change the boss behavior, so in the second face a charge attack is added and the phase one attacks are faster and stronger.

Scene

- Boss Trigger

When you enter the boss room there's a trigger in front of the door. This trigger collides with the player and when you cross it the method Activate of the boss behavior three is called.

- Boss Door

To enter the final room there’s a door that you need to open. There’s a lever at the right of the door that opens it and when you cross the trigger commented previously the door closes.

- Boss Lever

At the right of the boss door there’s a lever, as we commented previously. This lever apart of opening the door It also triggers an animation where the player loses the control and the avatar enters automatically to the boss room crossing the boss trigger.

- Presentation FX Trigger

At the first corridor of the boss scene there’s a trigger that interacts with the player. When it is active, the component audio, placed in the dead soldier object in the entrance of the boss final room, reproduce the defined audio effect.