Questions tagged [gkminmaxstrategist]

A GKMinmaxStrategist object is a form of artificial intelligence for use in turn-based, adversarial games. This class implements a “minmax” strategy—with ratings you supply for possible states of your game model, the strategist makes choices that maximize the rating for its own moves and minimize the rating for an opponent’s moves.

A GKMinmaxStrategist object is a form of artificial intelligence for use in turn-based, adversarial games in . This class implements a “minmax” strategy—with ratings you supply for possible states of your game model, the strategist makes choices that maximize the rating for its own moves and minimize the rating for an opponent’s moves.

References:

6 questions
16
votes
3 answers

GKMinmaxStrategist doesn't return any moves

I have the following code in my main.swift: let strategist = GKMinmaxStrategist() strategist.gameModel = position strategist.maxLookAheadDepth = 1 strategist.randomSource = nil let move = strategist.bestMoveForActivePlayer() ...where position is…
Tim Vermeulen
  • 12,352
  • 9
  • 44
  • 63
6
votes
2 answers

Where to start with GKMinmaxStrategist?

I was wondering if anyone here has had any luck using GKMinmaxStrategist. This class/feature was showed off at the WWDC, but most of the sample code was in Objective-C, which was a disappointment. The WWDC videos for GameplayKit featured another…
tsb
  • 107
  • 4
3
votes
0 answers

GKMinmaxStrategist - not working for starting move (Swift 4)

I am working on a two-player strategy board game with the option to play against CPU and I am using the GKMinmaxStrategist to give some brains to the CPU player.Just for background, there are two "factions" in the game (King, Enemy) and the one…
SanMu
  • 645
  • 1
  • 6
  • 19
2
votes
1 answer

Swift 4 - GKMinmaxStrategist Modifying Actual Game Model

Before I start, this question has already been asked a while ago but I don't believe the answer is satisfactory (GKMinmaxStrategist modifies model after return of best move) I am trying to build a straightforward board game with two player types…
SanMu
  • 645
  • 1
  • 6
  • 19
2
votes
0 answers

GKMinmaxStrategist not exploring required positions

Imagine a very simple game, where in any non-final position, the active player can make either move 1 or move 2. Let's say if player 1 starts with move 1, he wins the game immediately. If he starts with move 2, he can still win if player 2 plays…
1
vote
1 answer

Affect on MinMax algorithm if opponent doesn't play optimally

How does it affect the chances of winning a turn based zero sum game by a AI algorithm such as Minmax algorithm if the opponent doesn't play optimally or rationally? Is it possible to defeat a Minmax algorithm by playing not so optimal moves as…