Introduction

This intermediate-level series will teach you how to code a JRPG combat system and cover:

  • Managing an active time battle with time slowing down on the player’s turn.
  • Coding combat actions using the Command programming pattern.
  • Implementing turn-based AI.
  • Building a menu from a character’s combat actions.
  • Selecting targets.
  • Sequencing battler attacks with simple animations.
  • Winning and defeat conditions.
  • Designing a user interface displaying each character’s life and energy and showing which character is active.
  • A stat system with base and final stats, showing support for buffs and debuffs.
  • Status effects, applying buffs, or dealing damage periodically.

And some more. By the end, you learn to manage the code’s complexity of multiple communicating systems and ways to limit coupling. All these should give you strong foundations to build upon and code other features.

For instance, while the course doesn’t include consumable items, you can implement these as combat actions that consume one item instead of mana or energy points.

Who this series is for

The following tutorials are for intermediate-level users. That is, people who have experience working with Godot already and who would like to see how to approach coding a relatively complex system in general, and an RPG combat system in particular.

To follow along, you should be comfortable reading commented blocks of code, navigating the editor, and creating scenes and nodes without step-by-step instructions.

We chose a code structure adapted to this turn-based combat system. It shows some programming patterns like Command, sandboxing, and using an autoloaded node as an event bus. We’ll talk about each of these in the corresponding lessons.

Note that the techniques you will learn here are useful beyond RPG games. We will talk about sequencing gameplay, coordinating distant systems, separating game data from game logic, and more.

How to make the most out of this series

I would like to stress there are many ways to implement each of the systems you will see in this series. Your code defines your gameplay and game feel. As a result, in your projects, even small gameplay differences may work best with a code structure that’s quite different from the one you will see here.

The tutorials come with some assignments and challenges. To learn as much as possible, take the time to do them. You’re welcome to practice with your project instead of the course’s project.

While tutorials give you some insights and pointers, your practice will make all the difference as with any course.

I also invite you to share your experiments to go further than the course’s demo under corresponding lessons and discuss problems and solutions with fellow students. Discussing code and seeing how others would solve particular problems goes a long way to broaden your perspective as a game developer.

We’ll also be there to participate in those discussions, helping you go further than the lessons.

Community Discussion