Puzzle wars - AI Design


The game features a tetris-like gameplay, the falling block being comprised of civilian and terrorists. In order to score points, players need to complete lines of one type of population, to rescue or destroy them accordingly. In addition, they can target and shoot at single blocks of population to shape their playground.

Other features then complexifiy the gameplay, like lines combos or power-ups.


Game evaluation

The main idea was to create an heuristic evaluation function E(S) for every game situation S.
This evaluation is the sum of different elements:

  • Game points:
    • The current player's score
  • Potential points:
    • Near complete lines
    • Stored power ups
    • Other game advantages…


A goal transforms the current game situation S into an other situation S', and must provide the logic to attain it. A goal G can be evaluated by the function: E(G) = E(S') - E(S)

Complex goals can often be seen as a set of parrallel or serial basic goals so the system is very flexible, and can be built up from a few elements.


We generate a list of possible goals at regular intervals (basically every 15 frames) and they are evaluated during the following frames. We can then choose the set of goals yelding the best evaluation, and start them.

Some goals may take a long time to complete, so we need to keep track of them to avoid starting competitive goals. To this effect, each goals describes the list of effectors he needs and releases them as soon as possible. Effectors are the very basic game actions like, moving the target, dropping or moving the current piece, …


The implementation of the planned design was a succes, as the AI performance beat our expectations. Actually, the most difficult part was to scale the AI difficulty down to a reasonable level without dumbing it down too much.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License