Skip to main content
added 1084 characters in body
Source Link

I'm building a grid turn-based game, and I have a couple of questions about Utility AI that I can't wrap my head around for a couple of weeks. Suppose we have a unit that can move X tiles and attack in melee range. I want an AI controller to enumerate all possible targets for this melee attack and score them.

  • Are "move" and "attack" two separate decisions, or is it one decision that does both the movement and the attack?

  • If they are separate decisions, then how can a decision to move consider a melee target? The option is to copy all of the considerations from the "melee" decision to the "move", but it feels bad.

  • If they are a single decision, how to reuse it if, let's say, I have another unit that knows how to teleport instead of how to move?

My question boils down to this: where is the reasonable edge when I want to make some sequence of actions a single decision or a couple of decisions?

Edit 1

After some thought, I think I have some additional context for my problem.

Cons of separate decisions:

One of the crucial aspects of my turn-based game is a "time unit" budget that each unit has in its turn. There can happen a situation, when the unit decides - well, it is a great opporunity to go to another dude's melee zone. He runs to the dude, but then - oops, no "time units" left for the melee attack itself! It happened because "move for melee attack" does not have enough context, and so the AI chooses a degenerate action.

The second problem, as already mentioned in the answers, is that I, as a player, do not pick a tile to stand on, and then one of the possible targets near this tile. I evaluate both of them at the same time.

Cons of a single decision:

Reusability and combinatorial explosion. If the unit can move, can teleport, and also dig to the target tile, then I will need NxAction decision makers set up, where N is the number of movement methods. I don't know if it is really an issue, though; maybe it only seems this way.

I'm building a grid turn-based game, and I have a couple of questions about Utility AI that I can't wrap my head around for a couple of weeks. Suppose we have a unit that can move X tiles and attack in melee range. I want an AI controller to enumerate all possible targets for this melee attack and score them.

  • Are "move" and "attack" two separate decisions, or is it one decision that does both the movement and the attack?

  • If they are separate decisions, then how can a decision to move consider a melee target? The option is to copy all of the considerations from the "melee" decision to the "move", but it feels bad.

  • If they are a single decision, how to reuse it if, let's say, I have another unit that knows how to teleport instead of how to move?

My question boils down to this: where is the reasonable edge when I want to make some sequence of actions a single decision or a couple of decisions?

I'm building a grid turn-based game, and I have a couple of questions about Utility AI that I can't wrap my head around for a couple of weeks. Suppose we have a unit that can move X tiles and attack in melee range. I want an AI controller to enumerate all possible targets for this melee attack and score them.

  • Are "move" and "attack" two separate decisions, or is it one decision that does both the movement and the attack?

  • If they are separate decisions, then how can a decision to move consider a melee target? The option is to copy all of the considerations from the "melee" decision to the "move", but it feels bad.

  • If they are a single decision, how to reuse it if, let's say, I have another unit that knows how to teleport instead of how to move?

My question boils down to this: where is the reasonable edge when I want to make some sequence of actions a single decision or a couple of decisions?

Edit 1

After some thought, I think I have some additional context for my problem.

Cons of separate decisions:

One of the crucial aspects of my turn-based game is a "time unit" budget that each unit has in its turn. There can happen a situation, when the unit decides - well, it is a great opporunity to go to another dude's melee zone. He runs to the dude, but then - oops, no "time units" left for the melee attack itself! It happened because "move for melee attack" does not have enough context, and so the AI chooses a degenerate action.

The second problem, as already mentioned in the answers, is that I, as a player, do not pick a tile to stand on, and then one of the possible targets near this tile. I evaluate both of them at the same time.

Cons of a single decision:

Reusability and combinatorial explosion. If the unit can move, can teleport, and also dig to the target tile, then I will need NxAction decision makers set up, where N is the number of movement methods. I don't know if it is really an issue, though; maybe it only seems this way.

Source Link

Structuring Actions in Utility AI

I'm building a grid turn-based game, and I have a couple of questions about Utility AI that I can't wrap my head around for a couple of weeks. Suppose we have a unit that can move X tiles and attack in melee range. I want an AI controller to enumerate all possible targets for this melee attack and score them.

  • Are "move" and "attack" two separate decisions, or is it one decision that does both the movement and the attack?

  • If they are separate decisions, then how can a decision to move consider a melee target? The option is to copy all of the considerations from the "melee" decision to the "move", but it feels bad.

  • If they are a single decision, how to reuse it if, let's say, I have another unit that knows how to teleport instead of how to move?

My question boils down to this: where is the reasonable edge when I want to make some sequence of actions a single decision or a couple of decisions?