Life of an Adventurer Battle System Update


Welcome for an another devlog!

As the title of this devlog says, I am working on now the implementation for the battle system for this game. I've mentioned in my last devlog that I should be working on the town scene however, I have changed my plans to focus more on the battle system because I think that the battle system will be the hardest and the longest one to implement because of these things:

  • Turn-based System
  • Different Mob Skills and Attacks
  • Different Character Skills and Attacks
  • Action Order Implementation
  • Animation for each skills and attacks for all enemies and the characters

The implementation for the different skills and attacks are not that hard but it is certainly quite a long one to implement. As of now I only have the basic attack of the slime mob and the basic attack and its class skill of the knight implemented.

On how was I able to implement it, I used the principle of Inheritance where I created a main script for both player skills and enemy skills and then created individual scripts for different types of enemies like a slime and player usable characters like a knight. The main skill script contains some virtual and abstract methods and here are the difference of the two:

  • Virtual methods can be exist on the main script and will still be able to use these methods in the child scripts like the knight skill script even without declaring it inside the knight skill script as long as the knight skill script is a child script of the main script. However, it is still possible to declare that virtual method inside the knight skill script but will become an override method.
  • Abstract methods can exist on the main script but without any code inside the method then all of the child scripts of the main script should declare an override method of the same method name inside of its script. For example, we can use the abstract methods for every player usable characters because every characters has a 2nd skill and 3rd skill but with different effects and functionality.

It may sound complicated at first, because it was like that at first for me also, but when you always practice using these principles then slowly you will understand it. The hardest and also the longest one was the implementation of the turn-based system and the action order. Action order was hard to implement because different enemies and characters have different speeds where it affects their turn orders especially when you have to calculate where to put the enemies' and player's next turn based on the speed values inside the action order list. 

After a long hours of trial and error, the solution I came up with was a simple one because I do not have enough time to perfect the exact system I had in mind and that solution was whenever the player's or enemies' turn ends, they will just go to the end of the action order list. A simple and fast solution to implement given the time frame which I think an important thing to consider when joining this types of game jams. Here is now the look of the game:

Next update would be adding more implementations to the battle system and hopefully after the next devlog, the battle system will be complete... "Hopefully"... And thats the end of this devlog. See you in the next one!

Leave a comment

Log in with itch.io to leave a comment.