Body: <p>Imagine a game with grid size 10x10, there is a good guy and a bad guy and obstacles in the grid, i.e. essentially a maze. The goal of the bad guy is to find the good guy and trap him by erecting walls around him. The good guy is able to move in the maze using a simple random movement, only in 4 directions - up, down, right or left.</p>
  <p>I've used the A* algorithm to find the shortest path to the good guy but am still unsure as to how to go about trapping the good guy in his own space?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-11-07T21:08:37.563Z
Comments.Text: The good guy is able to move in the maze using a simple random movement, only in 4 directions - up, down, right or left.
Comments.UserDisplayName: Sakthi Somaskandan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-11-08T15:37:19.987Z
Comments.Text: What do you mean by "erecting walls around him"? It seems that you imply that the bad guy has more actions than up, down, right and left. It has also the actions of building walls. But how? You need to explain more in detail how this works.
Comments.UserDisplayName: nbro
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-11-08T15:42:42.907Z
Comments.Text: Agree you need to define how the "bad guy" builds walls (can he build in adjacent cells, or anywhere?), and what it means to trap the "good guy" (seal him in a 1x1 cell, seal him in a 2x1 with the bad guy, cut him off from the bad guy?).
Comments.UserDisplayName: Nuclear Hoagie
Tags: <game-ai><algorithm-request>
Title: What AI algorithm could I use to trap an agent in a game?
UserDisplayName: Sakthi Somaskandan
ThreadText: # What AI algorithm could I use to trap an agent in a game?
  
  (Asked by: username_0 on 2021-11-06)
  
  Imagine a game with grid size 10x10, there is a good guy and a bad guy and obstacles in the grid, i.e. essentially a maze. The goal of the bad guy is to find the good guy and trap him by erecting walls around him. The good guy is able to move in the maze using a simple random movement, only in 4 directions - up, down, right or left.
  
  I've used the A\* algorithm to find the shortest path to the good guy but am still unsure as to how to go about trapping the good guy in his own space?
  
  **Tags:** game-ai, algorithm-request
  > **Comments:**
  > **username_0**: The good guy is able to move in the maze using a simple random movement, only in 4 directions - up, down, right or left.  
  > **username_1**: What do you mean by "erecting walls around him"? It seems that you imply that the bad guy has more actions than up, down, right and left. It has also the actions of building walls. But how? You need to explain more in detail how this works.  
  > **username_2**: Agree you need to define how the "bad guy" builds walls (can he build in adjacent cells, or anywhere?), and what it means to trap the "good guy" (seal him in a 1x1 cell, seal him in a 2x1 with the bad guy, cut him off from the bad guy?).  
  
  ---
  
  ## 0 answers
  
  