Skip to content

Functional Design

daan41114 edited this page Mar 13, 2025 · 4 revisions

Maze navigation

Players (and enemies) need to be able to navigate through the playing-field.
The playing-field in question consists of the following:

  • Corners
  • T-junctions
  • Intersections Knowing that an intersection can consist of 4 directions at most.

Players can navigate through the playing-field by inputting their preferred next direction. Then at the next intersection it will check if the preferred input is available. If not, the player will stand still. If no preferred next direction was given by the player, it will keep going straight when possible, else it'll stand still.


Enemy

The player needs an enemy to stop picking up all the pellets in the playing-field. This enemy is controlled by a trained machine-learning model. And navigates through the playing-field the same way that the player does.


Ghost behaviour AI

Playable characters when not controlled by the players need to move through the level on their own.

Their movement works in these three way's.

  • Move towards the enemy under normal circumstances.
  • Move away from the enemy when the edible state is on.
  • Move in a random direction randomly.

The behaviour will only input a direction when it steps on an intersection. From there it will decide randomly whether it will choose the closest path to the enemy or a random direction. If it chooses to use the closest path to the enemy, it will check the X and Z distances between the ghost and the enemy and choose the closer one to go to. When that path is not available it will choose the second closest path, when that is also not a possible path it will choose one of the other two paths randomly.

Clone this wiki locally