Skip to main content
GameDev.net gamedev.net
🔒 Locked

Structuring Actions in Utility AI

Started by BlackDice Jun 2, 2025 at 9:07 PM 1 replies 2.1k views
Original Post
BlackDice
BlackDice

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?

Alberth
Alberth

I'd say a move should have a purpose. As such it would need guidance from the higher level goal.

If you need the same kinds of things at different places, wrap them in an object so you can re-use them.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.