The Frey
This project started as an experiment to build a high-quality locomotion system for a character using AAA assets, such as the Paragon Frey character and its animations. The project eventually expanded, and now we have a small game that includes combat, a health system, gameplay mechanics, sound, and visual effects.

Languajes
The project combines both Blueprints and C++. In this case, we primarily focus on Blueprints, as we're not implementing any complex behaviors. The player character's logic is handled through Blueprints, while we used C++ to develop the artificial intelligence for the enemy. Animations, effects, and sounds are also implemented via Blueprints.


Software architecture
The enemy structure in this case is quite simple. We use a CPP_Enemy C++ base class, and a CPP_EnemyFrey C++ class that contains all the core logic for the enemy Frey. CPP_EnemyFrey inherits from CPP_Enemy. The visual aspects of the character (mesh, skeleton, effects, etc.) are handled in the BP_EnemyFrey blueprint class, which inherits from the CPP_EnemyFrey C++ class. In the image, orange boxes represent the C++ classes, while blue boxes represent the Blueprint classes.
This structure is simple but effective. It allows us to extend the code to add more characters, though it isn’t necessary for this small project. The structure is more suited for larger projects where extension and scalability are key considerations. You can see a similar logic implemented with a wide variety of enemies in my Artificial Intelligence Showcase.


Enemy structure
The player character and the enemy both throw a projectile. This projectile has a C++ base class called CPP_ProjectileBase, along with two Blueprint classes: BP_ProjectileBase and BP_FruitProjectile, where the visual aspects of the projectile, such as the mesh, are implemented. The BP_ProjectileBase class is used to spawn the visual and sound effects. The CPP_ProjectileBase class contains the core logic, such as the velocity variable. While the CPP_ProjectileBase class is not central, it is useful for handling the projectile reference in C++
Projectile Structure
In the video, you can see how the enemy can die and react to the damage they receive (the player also has this behavior). They also have a health bar that shows the current health of the enemy. All of this behavior is thanks to the health system we implemented.
To build a reusable health system, we decided to create an isolated system that can be implemented in any actors we want. We can achieve this by using actor components and attaching them to the child elements that define our actor, in this case, the enemy character. Thus, each enemy type will have this health system attached to their child elements.
The health system works independently from the character logic. It is attached to it, connected, and has the functionality to communicate with the character it belongs to.
The health system communicates with the character via event dispatchers. The health system triggers a specific event that the enemy character is subscribed to. When the health reaches 0, the event triggered by the health system kills the enemy. In other cases, when the character receives damage but does not die, the health system determines the behavior the character must perform. For instance, playing a hit animation and reducing its health by a certain amount. This system is also connected to the health bar.
The health system is fully implemented in C++. The Frey player character connects to this system via Blueprints, as it is a class entirely implemented in Blueprints. On the other hand, the enemy Frey connects to the system through C++.
Health System




Environment
We decided to add the Advanced Village Pack from the Fab marketplace. Since the Frey character is a fairy I thought this is one of the most suitable free environment resources.


Animations
The animations used in this project are from the Paragon Frey pack. We did not use all of them, but the necessary to build the locomotion system. We also used one of its attacks (throw the 'seed') and the sprint hability to fly faster.
As you can see in the video, we created the hability to travel on the ground and in the air so there are two types of locomotion animations here, one for the ground mode and other for the air mode.
We used, anim blueprints, animation montages, and animation blendspaces (to build the 8 directional movement when focusiong a target and the leans, which gives you as a player a really good traveling feeling). All this tools were used to build the animation system, which is one of the best features of this project.












Artificial Intelligence
We need an artificial intelligence in order to move the enemy frey we placed into the world.
The artificial intelligence is made up of two basic components: the AI controller and the behavior tree.
In the AI controller, we implemented the AI perception system with sight, damage, and hearing senses. The AI controller handles which action must be triggered when one of these senses is activated. For instance, the controller has the ability to store and recognize which enemies were detected at a certain time and when those enemies should be forgotten when they are no longer seen.
On the other hand, the AI controller also manages the state of the possessed character. For example, the controller determines when the controlled character is in a passive, attacking, or investigating state, and it has the ability to switch between them at any time depending on the actions taking place. To do that, the AI controller can communicate these states to the blackboard component of the behavior tree. Thus, the behavior tree will select the corresponding execution branch.
You can see in the image a representation of how the behavior tree is structured. It has three main branches: attacking, patroling and investigating. Patroling and investigating states are sub-trees, which can be reused in other character's trees.
The behavior tree uses tasks. These tasks are created from the blueprint side, but most of their internal logic is implemented in C++. We create blueprint behavior tree tasks to make them more manageable.



