Menu Close

Chomp Movement

The chomping monster has several methods to move around. The character can be controlled using the keyboard, move in a random direction, or use a custom algorithm to complete the map.

The algorithm is named Gluttony and was designed to move across the map as much as possible while eating all of the dots. The code currently doesn’t have any avoidance options. This will come in a future update

The chomping monster uses the following rules to move around.

  1. It checks if there are any dots in the immediate directions.
  2. Then counts the number of dots in a line and chooses the largest number to travel.
  3. Then gets every dots until it reaches the end and then repeats the process.
  4. If there are no dots visible, it then checks in front and side to side and counts the dots on the entire screen.
  5. Then takes a “suggestion” of the largest quantity and moves in that direction.

 

Getting the character unstuck. When Chomp is being directed around the maze there is a possibility of getting stuck into a loop. This can be caused by having the same number of dots in several directions. to address this issue.

  1. When the chomping monster is at an intersection point where there is more than one direction available. it places down a marker in that cell.
  2. This marker has the direction that was chosen.
  3. The next time Chomp hits the same cell it will be forced to make a different choice.