sunjay / snake

Snake Game AI
http://sunjay.github.io/snake/
MIT License
1 stars 0 forks source link

AI Process Knows Too Much #1

Closed sunjay closed 8 years ago

sunjay commented 8 years ago

The AI process (web worker) is given information about the seed used to generate the next goal. This is problematic because it gives the AI undue information about the future goals in the game.

Instead, the design should be as follows:

  1. The main process lets the AI know when there is an update and the new goal every time a new goal is set
  2. The AI process updates its game with the new goal and makes its decisions from that point on

It is imperative that the AI be given the new goal as soon as the previous one is consumed as otherwise it will not be able to process in time and will now be at the effect of an undue disadvantage.

The main process will stop sending the seed it is using to generate the goal. Without this information, the AI process is sandboxed from knowing too much about the future of the game.

No cheating, not even for computers!