Revisiting the forgotten forest.
Updated: Jan 6, 2021
I released a game called "The Forgotten Forest" in an itch.io game jam in October of 2020 called ScreamJam. The game was inspired by hyperlight drifter by heart machine and I wanted to capture the fast paced combat but give it a medieval spin. Due to scope there was a lot I was unable to fit in which I had originally envisioned. Mainly having a versatile enemy that the player would need to face. I ended up using similar logic to a prior game jam in which I programmed the AI. Much more simple with a few basic behaviours such as attack, chase, and patrol.
When the Jam was over I threw myself back into another project but still had ideas stirring around my head. Recently I decided to come back to The Forgotten Forest and begin to give life to some of the ideas I had. The Biggest idea was making the combat feel better, along with creating enemies that behaved a bit more realistically. The main goal is to create an enemy that strafes around the player to flank them.
Firstly I created a simple patrol that moves between patrol points, just to get him moving creating one piece of character logic at a time. Next focus was creating a blend tree that shows versatile character movement. Strafing movement was the first thing to do.
To educate myself more on unity's animator, past what I'd already learnt I found a really helpful youtube series by a user called Nicky B. He broke down each aspect of the animator individually and explained their case use scenarios.
I had previously been using 2D freeform cartesian blend type. But after learning freeform directional was better suited to characters who strafe in multiple directions I made the necessary changes.
The next challenge was getting the the blend tree to work with character logic. As you can see from the below video the blend tree did work but the video is just me manipulating the values of the blend tree. As the NPC uses root motion I wanted to drive him using root motion.
I managed to create the logic that would move the character in terms of behaviours. Chase, Attack, Wander, Idle, and Flank. Its just at this point I was unable to figure out the logic to merge my current blend tree with my scripts behaviours. The end result was placing the animations in an altogether separate script to handle animation changes. I found a script in reference to a third person character controller which worked perfectly with the NPCs nav mesh.
Once the blend tree was working with the behaviours The next stage was getting the attacks to work. Before I did this I did a deep dive into some of the games I like with regards to combat. The game I spent the most time with was dark souls 3. The reason I chose this is because the enemies behave in the way that I'm aiming to achieve. Strafing behaviours, multiple enemies kiting around each other each waiting for their own opportunity to attack.
As you will see from below I managed to achieve this in some semblance. What I managed to do was create a string of attacks that redirect for the third. Giving the player an opportunity to dodge the first two but not be entirely safe. I did this by creating an animation event at the end of the second animation that makes the NPC retarget the player.
This is the end of this dev blog for The Forgotten Forest in the next segment I will be showcasing the main feature I want to place in the games combat being disarming.
I want to recreate the suspense and tension of when the hero becomes disarmed. This is also why I plan on revisiting player movement. If the player is going to be at times defenceless his movement needs to feel amazing!