Pathfinder: Kingmaker Update - Turn-based Combat Overview

Earlier this month, Owlcat Games released Pathfinder: Kingmaker for Xbox One and PlayStation 4. Among many other changes and fixes, this console-focused Definitive Edition expanded the game with an official turn-based mode. Transforming a real time with pause RPG into a turn-based one was no easy feat, and if you’d like to know how it was achieved, you should check out this massive Kickstarter update.

Here are a few sample paragraphs and you take things from there:

When I joined the Owlcat Games team early in 2019, it was basically the job of my dreams: making a single-player role-playing game for PC without having to leave Russia? Until recently this could only be a dream! There was just one little drawback – I've always preferred turn-based combat games to all other genres, and Pathfinder: Kingmaker was designed as a game where battles occur in real time with a tactical pause. Oh well, all your dreams can't come true, right?

Wrong. When the issue of porting the game to consoles came up, we realized pretty fast that something had to be done about combat. Micromanaging the party in combat, particularly important at high complexity levels, is extremely difficult when you have a gamepad instead of a mouse and a keyboard. Of course, we could try to improve the artificial intelligence of the player's characters and make it customizable, but this didn't seem a good solution: we'd play AI programming, not Pathfinder.

Then we were lucky to find out that there was a mod that turned our game into a turn-based one, developed by one of our fans – the amazing, talented, and very dedicated Hsinyu Chan. We looked at the mod and agreed it was brilliant: the game transformed right in front of our eyes, and only for the better (if you like to sit and think about every move, that is). This ultimately tipped the scales in favor of officially adding a turn-based mode to our game.

We got the mod author's permission to use her code and began to implement it into the game. But it was only the groundwork. Although the mod was amazing, the author didn't have access to the game source code, so she had been constrained in what she could do. And after all, the requirements for a fan mod and for the official game’s functionality differ a great deal.

Pathfinding

The first thing we wanted to fix was the complete unpredictability of the character movement trajectory. The thing is, during real-time combat, a character can't definitively predict their path, since the situation may change during movement, for example, a previously clear passage may be blocked. That's why, when finding the initial path, the character didn't take into account dynamic obstacles – primarily other characters. Then, if a character met an obstacle while moving along the path, they tried to bypass it on the left or on the right, using a separate algorithm. It wasn't very noticeable in the chaos of a real-time fight, but in turn-based combat, when only one fighter was moving, this behavior jumped out at you like a cat in a thunderstorm.

This is how it worked: even if the path was completely blocked by other characters, the one moving now approached the living barricade and then walked along it, up and down, until their turn was over. It looked like a bug, although it was in fact the programmed behavior. To make matters worse, this approach didn't let us predict and show the player the path the character would take. This was what we had to change.