Applied AI Principles with GameplayKit



The primary objective of this project is to take the concepts from CS440: Principles of Artificial Intelligence and build a better understanding of agents and apply these concepts by implementing and comparing agents in a video game.


The main goals for this project consist of the following:

  • Creating (or modifying) a game suitable for agent experimentation using SpriteKit and Swift
  • Implementing Apple’s agents from GameplayKit to complete game levels
  • Writing and comparing different methods of agent implementations


Milestones in this project assume a standard fourteen-week course in a given semester.

Milestone 1: Complete Game

By the end of the fourth/fifth week, a proper, playable game should be created using Swift and SpriteKit for macOS. The game should contain a few playable levels and a couple of reliable mechanics; overall, the game should have less items that are done well rather than more items that have sloppy implementations.

The game should do the following:

  • Properly work with a regular player’s input and as a standard Mac app (with notarization).
  • Include a method of scoring or competition so that agents can use these metrics to complete levels.
  • Have all of the proper assets and materials ready.
  • Include well-documented code and, if time permits, an API.

Additionally, there should be a small write-up of the game that describes the objectives and mechanics of the game.

Milestone 2: Agent Implementation

By the end of the eighth week, at least two of the agents provided in Apple’s GameplayKit should be properly implemented in the game.

The following should be readily available or completed:

  • The agents should successfully complete at least three levels in the game.
  • The game should include an option to switch or load agents into the game, either as a command line argument or in a GUI.

Milestone 3: Custom Agent Implementation and Comparisons

By the end of the twelfth/thirteenth week, there should be at least two custom agents that have been implemented into the game.

Additionally, the following tasks should be complete:

  • Tests and metrics of each agent in a given level should be recorded.
  • Observations about different agents should be recorded, as well as their implementations.
  • An analysis of the aforementioned data should be completed

Milestone 4: Completed Project and Presentation

By the end of the fourteenth week/final experience, the project should be in a releasable state for inspection, further inquiry, etc. The presentation regarding the process and findings of this project should also be ready, either as a presentation file or a Markdown document.

Additional Resources