Enhancing Combat, AI, and Quest Mechanics in Shoggoth Indie Game

Enhancing Combat, AI, and Quest Mechanics in Shoggoth Indie Game

Table of Contents:

  1. Introduction
  2. Adding Enemy Models
  3. Implementing Combat Mechanics
  4. Adding Spells and Abilities
  5. Enhancing Player Health and Mana
  6. Designing the UI
  7. Implementing Enemy AI
  8. Creating a Finite-State Machine
  9. Using Raycasting for Player Visibility
  10. Implementing AI States: Idle, Chasing, Attacking
  11. Adding Quests and Dialogue
  12. Conclusion

🔍 Making Shoggoth: Enhancing Combat, AI, and Quest Mechanics

Introduction

Welcome back to Shoggoth, where we continue our journey in Game development. In this video, we will be focusing on enhancing the combat mechanics, implementing advanced enemy AI, and adding quests and dialogue to create a more immersive gameplay experience. Let's dive right in!

Adding Enemy Models

To make our game more challenging, we need some enemies. I found a cool skeleton model in the asset store and added it to the scene. However, our friendly penguin character needed to step aside for now. Don't worry, he'll be back!

Implementing Combat Mechanics

Now that we have enemies, we need to be able to defeat them. To do this, we utilize the NavMesh system from earlier. By clicking on an enemy, our character will move towards it and attack when in range. But wait, let's take it up a notch and add some magical spells to our arsenal!

Adding Spells and Abilities

To spice up the combat, I followed a Tutorial by Gabriel Aguiar on YouTube to implement a fireball Spell. Now we can rain fireballs upon our enemies! But hold on, this isn't fair to the skeleton. Let's give it some brains and make it a worthy opponent.

Enhancing Player Health and Mana

Before we dive into enemy AI, let's make sure our player can actually take some damage. I added health and mana attributes to the player script, allowing the skeleton to inflict damage. But wait, we also need a visually appealing way to display our health and mana. Inspired by games like Diablo and Path of Exile, I created UI orbs to represent these attributes, and surprisingly, they turned out well!

Implementing Enemy AI

To make our enemies more intelligent, we will be implementing a finite-state machine. Just like water can exist in solid, liquid, or gas states, enemies can have various states such as patrolling, chasing, and attacking. This state machine will ensure that enemies behave dynamically based on their current state.

Creating a Finite-State Machine

The enemy's finite-state machine consists of two scripts: the base state and the state manager. The base state serves as a template for all other states and contains functions such as EnterState and UpdateState. On the other HAND, the state manager script keeps track of the active state and switches states based on certain conditions. For example, if the skeleton's health reaches zero, it immediately transitions to the dead state.

Using Raycasting for Player Visibility

To make enemies aware of the player's presence, we use a simple Raycast combined with dot product calculations. This allows the enemies to have a 180-degree field of view. I came across a helpful tutorial that explains the math behind it, and it even provides a way to control the enemy's view distance.

Implementing AI States: Idle, Chasing, Attacking

To complete the enemy AI, I created scripts for each state: idle, chasing, and attacking. These states determine the enemy's behavior and actions in different situations. Although these states are not fully developed yet, they lay the foundation for more advanced enemy AI in our game.

Adding Quests and Dialogue

No RPG is complete without quests! But before we create quests, we need a dialogue system. Following a tutorial by Trevor Mock, I implemented a dialogue system using Ink. This program allows us to create branching dialogues with attributes like speaker names, portraits, and emotions. We can even associate dialogues with specific quests for seamless progression.

Conclusion

In this video, we enhanced the combat mechanics, added enemy AI, and implemented a quest system. Our game is gradually taking Shape, and with each step, we are bringing it closer to becoming a captivating RPG experience. Stay tuned for more updates, and don't forget to like, subscribe, and leave your feedback. Follow us on Twitter for the latest news and check out the other videos on the screen for more exciting content.

🎮 Resources:

  • Gabriel Aguiar's Fireball Tutorial: Link
  • Raycasting and Dot Product Tutorial: Link
  • Trevor Mock's Ink Dialogue System Tutorial: Link

Most people like

Find AI tools in Toolify

Join TOOLIFY to find the ai tools

Get started

Sign Up
App rating
4.9
AI Tools
20k+
Trusted Users
5000+
No complicated
No difficulty
Free forever
Browse More Content