By invisdev July 1, 2024 In devlogs

Devlog 23: Combat Mechanic Overhaul and Introducing Wolves!

Hello everyone,

Welcome to Devlog #23 of our single-player RPG, Tales of Elondria. As you may have noticed, I’ve decided to publish monthly devlogs rather than weekly ones to provide updates on major mechanic implementations as a whole rather than in weekly partitions.

During June, I was mostly busy developing and testing the combat mechanic. Additionally, I also added a new NPC type, wolves!

So, let’s get started.

Combat Mechanic

The combat mechanic was the biggest implementation in version 0.2 and also one of the mechanics I thought about the most. Some of my past concerns were: “Where should the battle take place?”, “Will it be a new map, or the same map with different indicators?”, “How will the player cast spells?”, “How will looting take place?”, “What will the world do when the player is fighting?” and many, many more.

After discussing these concerns in our Discord channel with the community, we concluded that the battle should take place on the same map because the hex art isn’t mine, so I can’t just create new art for “combat maps”. I can get new art, but the styling would be different because the artist that created the current hexes doesn’t have more assets. If I used the same hexes, then there would be no point in creating a “new” map.

But the challenge was if the map would not be the same, then I needed to make the player feel that something was different. For that “feeling,” I came up with a few tricks:

  1. Camera Lock: Normally, in the free map, the camera always follows the player, and the zoom can be adjusted. But during combat, the camera locks its position.
  2. UI Changes: During combat I removed the time indicators and the bottom menu. Instead, a combat skill bar appears.
  3. Music: When combat starts, the music changes to something more… combaty(?).

After implementing these changes, I realized that other NPCs would still be hanging around since it’s the same map. So, I implemented a feature where NPCs not involved in combat become transparent, allowing the player to focus on the enemy.

I then worked on NPC behavior in combat. Now, they have a skill set and cast those skills according to range and availability. Every skill has its own cooldown, and NPCs have their own global cooldown as well. The same system applies to the player. Currently, I’ve created only one physical skill, “Quick Attack”, which is the simplest attack that every creature in the game has. However, it uses strength as its multiplier, so even though every creature has the same skill, the damage differs. Additionally, I implemented a Critical Strike logic. Following the development philosophy where every action affects the player’s progress, the Quick Attack being a physical attack improves your strength stat.

Next, I needed to decide how to trigger combat. If the character needed to collide with the enemy, it would be unfair for ranged characters. So, again with the Discord community, we decided to have a similar logic as the insight check mechanic but for combat range. It was all good, but I felt it wasn’t intuitive to press CTRL to make the range visible. Therefore, I added icons to the NPCs indicating that they are in insight check range or/and combat range.

Left image was the old “press CTRL to see the range” implementation. Right image is the current icon implementation.

Afterwards, I finished up the limb-based health system. I also created blood sprites on the portrait images to indicate how much health you have left and implemented a debuff where damaged legs slow the player’s movement speed. Lastly, I handled how low health screen and dying screen should look like and created a “You Died” screen for the player.

With all these elements in place, the combat system was ready to be tested and further improved!

Wolves!

Introducing the wolf, the first aggressive NPC in Tales of Elondria. Yes, I yoinked the Deer and Goat code and made it aggressive :). Here’s what’s different with wolves and others:

  • Instead of going for berries, when a wolf gets hungry, it hunts animals in its diet, such as deer and goats.
  • When they eat the whole animal, they get full. Deers and goats have their bite size so lets say their hunger is 40, when they eat, their hunger becomes 60. But with wolves, if its 40 and they eat, it becomes 100.
  • They attack the player if he is close enough.
  • Goats and deer run away from wolves.

One of the biggest implementations was the chasing and hunting logic. I wanted them to fight each other (as predator and prey) in real time, allowing the player to witness the interaction rather than just calculating outcomes based on stats. So, they fight in real time, and the player can see how it goes for both.

The rest of the wolves’ behavior is the same as deer and goats: they live, reproduce, grow old, and die if they don’t starve.

After implementing these changes, I recorded a video of me playing the game and uploaded it to YouTube.

However, a person from the Discord community commented that the health system was not clear since there were no health indicators. So, we came up with a system for indicating health in combat. It’s a thin frame line around the portraits that changes color: green if above 80%, then yellow, and red.

Final words

In addition to these above, I also made small adjustments here and t here..

  • Changed the post processing a little bit,
  • Added a small loot inventory that shows up after an NPC dies.
  • I implemented the same inventory for gathering professions as well, so instead of the item just spawning in your inventory, it appears as a new inventory and you select to get it from there.
  • I also worked on pathfinding of animals and the player.

 

 

So all in all, I can say I did some improvements.

This was June for Tales of Elondria. Hope to talk to you next month!