Priests, Smarter AI and Sudden Judgment

Game Dev: Priests, Smarter AI and Sudden Judgment

Development on Threefold: The Last Stand continues, and the game is changing pretty quickly as I actually play it and watch the AI beat itself up.

Which, as it turns out, is an extremely useful development tool.

The basic rules are still the same, but some of the pieces are starting to develop much more personality and strategic importance.

Especially our Priest.

The Priest Is Getting Dangerous

The Priest is still physically one of the weakest pieces on the board.

That's intentional.

But weak doesn't necessarily mean unimportant.

In fact, the Priest is rapidly becoming one of the most powerful pieces you have — just not because of their ability to run around beating people over the head.

Priests now have spells.

They have a limited number of spell charges that can be used throughout a battle to cast Haste, Divine Step, Second Wind and Sanctuary.

That gives the Priest a much more active support role and, more importantly, gives the player another resource to manage.

Do you spend those charges early to gain an advantage?

Or hold onto them because you might desperately need one later?

As usual, I'm aiming for decisions where there isn't necessarily one correct answer.

You Can Kill the Priest Now

Of course, if the Priest is going to become that useful, there needs to be some risk involved.

Originally, Priests couldn't be captured.

That has changed.

Any enemy combat class can now capture the opposing Priest.

Suddenly, where you put your Priest matters a whole lot more.

You can't just leave them sitting somewhere convenient while you use their abilities. They're valuable, vulnerable, and worth protecting.

The HUD now also tracks Priest captures, so both sides can immediately see when the opposing Priest has been removed from the battle.

We've also added Priest Swap.

The Priest still normally moves only one space, but can now swap positions with an adjacent friendly combat piece.

That gives them a useful escape and repositioning option without simply making the Priest faster.

So the Priest is still weak.

They're just weak while carrying around several abilities that can potentially change the entire battle.

No pressure.

Let the AI Fight Itself

One of the bigger additions is the AI itself.

Threefold is being designed primarily as a single-player game, so obviously the computer opponent is going to be pretty important.

But I also wanted the AI to be useful as a development tool.

So Threefold can now run AI-vs-AI matches.

Instead of me having to manually play hundreds of games looking for balance problems, I can let two AI players battle each other and watch what happens.

Even better, I don't have to watch them at normal speed.

There's now a game-speed control for 1×, 2×, 4×, 8× and 16× speeds.

Matches also generate detailed summary logs, giving me actual data I can use while balancing pieces, rules and abilities.

That's going to become increasingly useful as the game gets more complicated.

Making the AI Smarter

The AI itself is also getting more intelligent.

It now understands the game's Judgment system and can change its behavior depending on whether it believes it's currently ahead or behind.

And I'm currently working on AI difficulty levels.

Higher difficulty is going to mean allowing the AI more thinking time and giving it the ability to look further into the consequences of its moves.

That should hopefully result in opponents that become genuinely more challenging rather than simply cheating by getting arbitrary bonuses.

That's the goal, anyway.

We'll see how smug I am about that once it starts beating me consistently.

And Then the AI Discovered Shuffling

AI-vs-AI testing also exposed another problem.

Sometimes neither side particularly wanted to make a bad move.

So they didn't.

They shuffled.

And shuffled.

And shuffled some more.

Two artificial intelligences staring each other down while repeatedly moving pieces around without accomplishing anything.

Fascinating from a programming perspective.

Not exactly riveting gameplay.

So now we have Sudden Judgment.

Judgment Is Coming

If a match reaches a point where neither side is making meaningful progress, the game can now force a resolution.

Judgment can be triggered by threefold repetition, by reaching 15 turns without meaningful progress, or by reaching a genuine stalemate.

When that happens, the game evaluates the current state of the battle.

Surviving forces matter.

Chain health matters.

Whether your Priest is still alive matters.

Even your remaining spell charges matter.

Those factors produce a Judgment score and determine which side has the stronger position when the battle can no longer resolve naturally.

The player isn't blindsided by it either.

The HUD warns you when Sudden Judgment is approaching, and when it finally happens, both scores are displayed along with the reason Judgment was triggered.

The game-over screen also shows the scores and any tiebreak information that was needed.

So if you're ahead and Judgment is approaching, maybe you start protecting what you have.

If you're behind?

You'd better do something.

Standing around isn't going to save you anymore.

More Settings, Less Hard-Coding

I'm also continuing to build development tools around the game.

A lot of Threefold's rules and balancing values are now configurable through a custom Unity editor window.

The ThreeFold → Settings window now includes things like the no-progress limit, repetition detection and match-summary logging instead of having those values buried in code.

That's going to make balancing considerably easier.

If 15 turns turns out to be too short for Sudden Judgment, I don't need to go digging through source code.

Change the setting.

Run another batch of AI battles.

See what happens.

That's exactly the kind of workflow I want while the rules are still evolving.

Rock, Paper, Scissors Was Easier to Remember

There's one gameplay issue I'm still not completely happy with.

Remembering the capture relationships.

With Rock-Paper-Scissors, it's easy.

Rock beats scissors.

Scissors beat paper.

Paper beats rock.

We've known that forever.

Replace those with a Rogue, Paladin and Ranger and suddenly my brain occasionally goes:

Wait... can my Rogue take that Paladin, or does the Paladin take the Rogue?

That's not really a rules problem.

It's a visual communication problem.

And it's something I want to solve.

The game needs to communicate those relationships naturally enough that you're thinking about strategy instead of stopping to remember the conversion from fantasy character back to Rock-Paper-Scissors.

I have some ideas, but I haven't found the solution I really like yet.

The Graphics Are Still Very Much a Work in Progress

The current UI is also absolutely not final.

Much of it is placeholder AI artwork that lets me establish the feel of the game while I'm working on the actual systems.

The same applies to the current effects.

Spells in particular need much better visual feedback.

If a Priest casts something like Haste or Sanctuary, I want it to actually feel like something happened.

I just need to settle on the visual style first.

I also want some basic combat animations when pieces capture each other rather than simply having one disappear and the other take its place.

Nothing that slows down the game unnecessarily, but enough to give captures some impact.

It's Starting to Feel Like a Game

That's probably the most important part of all of this.

Threefold is starting to feel good.

The movement feels good.

The basic rules are fun.

The Priest is becoming much more interesting.

The AI is getting smarter.

And every round of testing is exposing little things that can be changed, clarified or expanded.

The rules have already evolved quite a bit since I started coding it, and I'm sure they're going to keep evolving as the AI and I continue beating on them.

Considering this whole thing started because I wanted to open Unity and see what had changed...

I'd say things escalated appropriately.

Now back to teaching the AI how to beat me.

Gameplay Preview

Want to see where Threefold is at right now?

I've posted an early gameplay preview showing the game in action:

Watch the Threefold: The Last Stand gameplay preview on YouTube

It's still early, the visuals are still placeholders, and plenty will change — but the game itself is very much up and running.