The Controller (+ some groundwork) [IMPLEMENTATION]
Iterating on the Lyra Sample Project forces me to use a lot of their systems which are completeley new to me. I trully enjoyed having this safety, even if it means diving in quite complex things for a beginner Unreal Dev.
a. Camera
In order to implement the camera, I used the camera mode system from Lyra. It is a basic camera system that allow to blend between different camera profiles. These profiles can only be coded in C++, however thanks to the function UpdateView, they are relatively easy to implement. Starting from the LyraCameraMode_TopDownArenaCamera, I simply made the pivot point move to follow the player.
For the "Tracking Camera" however, things got a bit tricky. I created a new camera mode based on the previous one since they will have the same behaviour, only a different target. However I need to retrieve that new target. In the previous camera mode, I simply used the GetTargetActor() function (inherited from LyraCameraMode class) that returns a pointer toward the owner of the CameraComponent. Now I need to store another actor (the actor the player locked onto) and retrieve it in my camera mode.
I decided the best way to do this was to create a custom component (AutoLockComponent) and to attach it to the owner of the CameraComponent. That way, I keep a modular approach and don't have to modifiy Lyra components. The AutoLockComponent is responsible of storing the target actor, and later on will probably be responsible of all sort of things related to the lock system.
Lastly, To switch between camera modes, I used the very convenient Ability System and created an Ability that does just that.
b. Character
Nothing really interesting about the abilities : I used the Lyra Default Hero and the Ability System.
However The implementation of Stamina was more tricky. Indeed, to keep a fully modular approach, I have decided to use an Attribute Set which is a very convenient feature for ressource management. I used the LyraHealthSet as a starting point since Stamina and Health work quite the same.
Lastly, I implemented a StaminaComponent that allow me to retrieve various information about the Stamina Attribute Set from Blueprints (Ah yes, Attribute Sets are only availbale in C++). This component proved especially handy in order to update the Stamina Bar in the UI.
Get ProjectBossRush
ProjectBossRush
Status | Prototype |
Author | Alhuin |
Genre | Action |
Tags | 3D, Boss battle, Indie, Monsters, Short, Singleplayer, Top-Down, Unreal Engine |
More posts
- The Controller (+ some groundwork) [DESIGN]4 days ago
Leave a comment
Log in with itch.io to leave a comment.