A.I overly fast -- how to bring it down to more human levels?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By vonflyhighace2
:warning: Old Version Published before Godot 3 was released.

my game is a turn based game. Currently I have the Ai follow some mundane routine but it does it so fast the player has no time to react. Any way to essentially slow down its processing to human comprehensible levels?

I don’t get it. If it’s turn based, how does it matter if the AI makes its move very fast? The player will still have all the time he wants to play his turn.

Gokudomatic2 | 2016-07-09 09:41

:bust_in_silhouette: Reply From: Zylann

If you have a function to make the AI “think”, just execute it after some time. You can use the Timer node for this.
If the AI has to do several actions, you can make it so your “think()” function returns a list of actions, then you execute them one by one with a delay between them with the timer. This way, the player will be able to see what the AI does.

If you need to modify the terrain between actions, you have two options:

  1. split your think() function with delays
  2. have a copied representation of the game in the AI’s mind so it can make future hypothesis without messing with the current board.