Advertisement

Tactical RPGs

Started by November 16, 2005 04:19 PM
8 comments, last by Kaze 19 years ago
I've been working on a ruleset for a TRPG, and I'm getting curious about how the AI in these games (like Fallout, X-Com, or Final Fantasy Tactics) makes decisions or form strategies. Generally, enemy units seem to act individually with little team coordination. Are there any resouces out there on TRPG AI? I'd like to look at some general strategies. I thought some kind of chess-like AI would be the way to go. But do chess AI algorithms "make plans?" do they guess at the intentions of the player? or do they just see every possible move, a few moves ahead? Thanks in advance.
Ideally, I'd like to have an AI that will form and "commit" to tactical objectives, take and offer "bait", attempt to create diversions, ambush, regroup, etc.

I'd just like to get some info regarding what kinds of AI techniques I should look at.
Advertisement
I've been thinking about a TRPG myself, although I can't say I've really put a lot of energy into coming up with coherent AI, not having started the project and probably not being skilled enough to.

XCOM was an amazing game and although I'd swear the AI was amazing too, I've read and I believe it's true that the aliens are pretty much dirty cheaters. Obviously they start with the advantage of being scattered across the map and sometimes in sniper nests while all your soldiers are crammed into a, say, 7x2 space, but moreover, as soon as an alien spots one of your soldiers, all the other aliens know where -all- of your soldiers are. I'd like to insist they're sneaky, still, but I don't think they are.

FFT is a much different story and probably closer to the kind of game I'd like to make. Since both sides usually start in pretty fair locations&formations and there's no fog of war/LOS, one can be pretty sure there's no cheating going on. No idea how they implemented it, though. Just watching them move I'd guess either each unit is completely selfish and will do the most damage possible while taking the least, but then again, enemies will sometimes prioritize helping their friends over dealing damage or saving themselves damage, so maybe the computer calculates the moves of all units for the total good of the team. I wonder if there were separate AIs for different classes?

Just noticed this post is pretty not-relevant. Having the AI go for most damage possible might lead to pretty shallow moves, spreading out attacks over units, so maybe having the AI "target" or prioritize certain units based on their status, like near-death, or class (healers! - if you will have classes in your game) would work. I haven't a glimmer of an idea how coding squad-tactics would work.
It only takes one mistake to wake up dead the next morning.
This is what Julian Gollop, designer of XCOM, had to say in the Official Prima Guide:

"The second most difficult task was to make sure that the AI functioned well. The major fault of any AI system is that after the enemy behavior becomes predictible, it is possible to beat it every time. We tried to build a fair degree of randomness into the aliens' behavior and at the same time make sure that they did not do anything stupid. I think we succeeded reasonably well, given the limitations of the computer (sophisticated AI can swallow huge amounts of processor power). Inevitably, there is the suspicion that the computer "cheats" (that the aliens know where all your troops are). Actually, the AI is limited to the same rules as the human player--with the exception that when an alien spots one of your soldiers, it remains spotted for a few turn, depending on the alien's intelligence rating. "

I didn't realize until I typed that out that the "remaining spotted for x turns, x determined by intelligence" technique is a way to get around the problem of alien memory and expectation: in other words, if one of your units is spotted, and then hides behind a wall, does the alien remember it? This was probably a way to solve the problem that didn't cost a lot of processing power (I originally ran that game on a 486).

I don't think the aliens ever really use any teamwork in XCOM, they just (individually) kill you (or the civilians) while not getting killed or killing their teammates.

I think the AI I'd want to employ, in lieu of some kind of information communication system between units (if fog of war/line of sight is present), would be to make the units act as if they were controlled by another player. The player wouldn't be manipulating their units to fight off a swarm of enemy units, they would be trying to defeat an enemy "general," in other words, an AI that plays the game like they do. The AI would commit to using it's peices in a certain tactical manner, and may even try to fool the player.
I have said this in another AI thread.

Just write down what YOU would do in a given situation. Its easier written down than actually coded, but I have done it without too much trouble in the past.

I also think that some chess programs have a database of games played by pro chess players and can use them to base moves off of. As for the rest of chess gaming, I think that its easier for the computer to do brute force move calculations rather than "intelligent" problem solving.
Young Doc: No wonder this circuit failed. It says "Made in Japan".Marty McFly: What do you mean, Doc? All the best stuff is made in Japan.Young Doc: Unbelievable.
Quote: Inevitably, there is the suspicion that the computer "cheats" (that the aliens know where all your troops are). Actually, the AI is limited to the same rules as the human player--with the exception that when an alien spots one of your soldiers, it remains spotted for a few turn, depending on the alien's intelligence rating. "

Very possible whoever wrote that was mistaken - I did believe it. :) However now that you've mentioned it: I've also read (and seen) the effect of the aliens "remembering" where you are. Pretty frustrating to have one of them get a peek at you and then suddenly they're taking pot shots at you but you can't see them. It's very good to hear that they're constrained to the exact same rules...my faith in XCOM is held. Maybe what I read was that if one alien spots a man, they can all see him? Your team is the same way, though, so that's fair.

OP - are you thinking of an XCOM type game, or a more traditional TRPG like Shining Force, Tactics etc?

Quote:
I don't think the aliens ever really use any teamwork in XCOM, they just (individually) kill you (or the civilians) while not getting killed or killing their teammates.

Not entirely true - I can remember that on at least a few occasions an opponent would screw up something and blow a part of his own team to smithereens; one time with a blaster bomb! :) That's got more to do with accuracy, though, I guess.
It only takes one mistake to wake up dead the next morning.
Advertisement
I can't say for sure, of course, but I'm guessing that at least some of the Tactical RPGs out there do a state search.

Basically, you start out with the character whos turn it is to move, and then run through the possible moves that the character has, giving each resulting state a ranking based on how good a move is. You can have the computer continue to predict states, and refine scores based on possible moves that the players have.

The main problem with this is that if you have a wide variety of possible moves, then you will have a high branching factor (more possible resulting states), and thus take more time/space. In this case, you will have to avoid expanding or searching states that are obviously bad, in order to cut down on the branching. They also cap the depth and number of states that the computer is allowed to search.

I'm fairly certain that this is roughly how chess programs work. They have databases of chess moves to help them score states. The problems with branching factor is also why its nearly impossible to "solve" Go with this kind of technique: the branching factor in Go is a lot higher than chess.
An intuitive way to implement teamwork in a agent-based AI is having an hierarchy of agents. I.e you an an agent for individual units, but also an agent for the teams, that tries to optimise the teamwork by giving orders to the individual in the team.

For the record, I dont think Fallout had *any* coordination at all. They sometimes let me to believe that they hardcoded Vic to shoot me in the back one turn out of four.
forgive my noob-ness. I just found the AI articles section. "Project AI" was just what I was looking for.
I think making it predict future moves would be too hard because it would be useless unless you could predict what the human play would try to do

I think the best idea would be to make the ‘selfish’ approach where each unit just weighs each possible move but have a single commander ai that would modify the weights for a unified strategy to keep them from just “zerg rushing” so they could do things like stay in a formation to avoid being drawn out and picked off one by one or to protect support units

This topic is closed to new replies.

Advertisement