Making a Hack’n’slash #25: Final notes & sum up

Today, let’s conclude our hack’n’slash tutorial series by doing a quick review of what we’ve learnt!

This article is also available on Medium.

And here we are: today is the final article in my tutorial series on how to make a hack’n’slash game in Unity/C#! Over the past six months, throughout these 25 episodes, we covered quite a lot of features and Unity trick that can hopefully help you in your next game projects.

So let’s do a quick sum up of all that we’ve seen so that we can see what we achieved with this prototype!

Don’t forget that the entire project is available for free on my GitHub! 🚀

Part 1: Setting up the scene and the hero

At the beginning, we discussed how to create a core mechanic of any hack’n’slash: the movement of our hero along with a camera to follow him. We made sure this system was cross-platform so that we could play the game either with a mouse and keyboard or with a gamepad controller.

Of course, we also quickly replaced our red capsule with an actual character model of a little guard. We discussed how to import FBX models or animations from Mixamo and how to automate this import step.

Part 2: Implementing an enemy AI and the attack system

Then, we moved on to another system: the attack mechanics. We set up a simple 3-punches combo that allows us to deal higher damage to the enemies in the scene when stacked.

To give some life to these enemies, we used finite state machines and gave them a simple AI behaviour to let them spot our hero, chase it, attack it… or die, if we’re faster!

We also worked on our first Scriptable Objects and Prefabs, and we even had a look at the TextMesh Pro library to show some nice damage popups.

We also took this opportunity to discuss an advanced techniques for managing resources in Unity: the Addressable Assets.

Part 3: Creating an inventory

We then devoted a good chunk of the tutorial to making a cross-platform and quite well-featured inventory. During several weeks, we added more and more controls to gradually improve the functionalities of this system, and we eventually had a fairly complex system to display, sort, drop or loot items.

This implied working on the UI with Unity’s UI Canvas, learning more about the new Input System and playing around with some sprite animations. We eventually added some input displays to help players know how to perform the different action at their disposal.

Part 4: Equipment & skills

Finally, we built on this inventory to allow the hero to equip some items and improve its statistics. We saw how items could be put in or removed from equipment slots and how they could upgrade or downgrade some basic data on the player, that can in turn influence other variables like its attack damage, for example.

In the end, we wrapped up the tutorial with a basic skills system to have our hero deliver an over-powered punch that instantly kills the enemy… with some VFX for kicks!

To conclude…

Although this tutorial was shorter than the previous one, on how to make a RTS game in Unity/C#, it was really interesting to make because it allowed me to go deeper in some topics and present more advanced up-to-date solution to specific issues.

But of course, just like the previous tutorial, this series was not meant to create a prod-ready game: it was about discovering various common game dev techniques and features of Unity. So, now, feel free to have a look at the files on GitHub 🚀 and re-adapt them in your own game projects in the future!

I really hope you enjoyed this tutorial series and that you learnt a few things for your next game projects – as usual, thanks a lot for your support and for reading, and of course don’t hesitate to share your ideas for other Unity tutorials in the comments! 🙂

Leave a Reply

Your email address will not be published.