09/02/2019 and 10/02/2019
After setting up all the states of the Boomshroom, I wanted to tackle moving the Boomshroom along the along the same spline as the player. If I allowed the enemy to move freely it would move directly towards the player and the player would not be able to attack the enemy due to the players restricted movement along a spline path.
The spline system works almost identically to the system that Belly uses to move along a spline path. The Boomshroom has to be attached to the spline path manually which is time consuming but I haven’t found a better way of attaching the enemy to the spline. Although this system uses a EventTick, I don’t feel that it will be that performance heavy as there won’t be a massive amount of enemies in the level at once.
If the Boomshroom is not attached to the spline the enemy will cause an error as soon as the game starts. To prevent the player from adding a Boomshroom without attaching it to a spline I made a IsValid node that checks if the spline reference is created. If the reference has not been created a print string will be called which will inform the player which Boomshroom actor needs to be attached to the spline. This will save a lot of debugging time in the future as the print string will tell the team which Boomshroom actor has caused an issue.
To create a state machine for the Boomshroom I needed to have some animations to work with so I began to make some basic animations for this enemy. When creating this walk cycle I used the walk cycle above as reference. During the walk cycle I wanted to make sure the player bobbed up and down when the Boomshroom was walking to add character to the enemies movement. The walk cycle has to be looped so I made sure that the walk cycle ended at the same point it begins at so that it loops correctly.
The animation above is the hidden idle animation for the Boomshroom. I wanted this animation to be fairly expressive as I want this view of the mushroom to look alive as it will be a trap that the player wants to be able to see before they trigger the Boomshroom. These need to be noticeable because if the hidden state was idle they would look like a prop rather than an enemy within the level.
The triggered animation is activated when the player enters the radius of the Boomshroom. Rather than launching the Boomshroom into the air using a blueprint I decided to animate the jumping motion as I was able to have more control over the height and speed of the jump movement.
The blend space is a combination of the idle animation and the walk animation. This allows the Boomshroom to walk at different speeds using one walk speed as it blends between not walking (the idle animation) and walking at full speed (the walk cycle).
Although I have not implemented all of the animations into the Boomshrooms movement, compared to the AI states without the animation this feels like a massive improvement in how the character moves in the environment.
The animation above casts to the Boomshroom blueprint to check when the Boomshroom has been triggered to launch out of the ground and it also checks the current speed of the mushroom which then controls the position of the blend space.
Rees, O (2019). Top down view of the Boomshroom following a spline path. [offline]. [Accessed 11/02/2019].
Rees, O (2019). Spline path used for the player and Boomshroom. [offline]. [Accessed 11/02/2019].
Rees, O (2019). Spline blueprint attached to the EventTick. [offline]. [Accessed 11/02/2019].
Rees, O (2019). Print debug string if the spline reference is not valid. [offline]. [Accessed 11/02/2019].
Rees, O (2019). Boomshroom walk cycle. [offline]. [Accessed 11/02/2019].
School of Motion (2018) [image]. The basics of the walk cycle. [online]. Available from: https://images.schoolofmotion.com/w950/3b57704f-d551-4c1c-9b1f-e6eda53d6a5d/walk_cycle_inspiration_animators_survival_kit.jpeg [Accessed 11/02/2019].
Rees, O (2019). Boomshroom hidden idle animation. [offline]. [Accessed 11/02/2019].
Rees, O (2019). Boomshroom triggered animation. [offline]. [Accessed 11/02/2019].
Rees, O (2019). Boomshroom idle animation for the blend space. [offline]. [Accessed 11/02/2019].
Rees, O (2019). Boomshroom blend space using the idle and walk animation. [offline]. [Accessed 11/02/2019].
Rees, O (2019). Boomshroom with the current animations applied to it’s movement states. [offline]. [Accessed 11/02/2019].
Rees, O (2019). Animation blueprint event graph checking if the player has been triggered and updates the players speed. [offline]. [Accessed 11/02/2019].