Skip to content

iamsims/Pacman-with-RL-Simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a Pacman game made in JS. The four ghosts, Blinky, Pinky, Inky and Cylde have different personalities. Blinky moves to the tile which positions itself nearest to Pacman. Euclidean distance between the two position vectors is used by Blinky to calculate the shortest distance, regardless of any obstacles. Pinky has it's target tile four step ahead of Pacman's position and uses the same algorithm as Blinky to position itself closer to its target tile. Inky moves randomly. Cylde is supposed to have a fixed movement, but random movement is used in this project.

The game has two modes as follows:

1. User playable mode

It consists of four ghosts. Arrow keys are used to move the Pacman.

2. RL simulation mode

It consists of two ghosts Blinky and Pinky.Pacman starts learning from absolutely no knowledge about the model or rules.Pacman keeps on restarting for 30 iterations. In 24 iterations for training, the Pacman learns to play fairly well and starts testing for the remaining four iterations.The stats bar in the right shows the weights provided to the features by the leanring PacmanAgent, the number of iterations completed per the total iterations to be performed, the Test/Train operation and the score obtained.

Approximate Q-learning, a model free RL algorithm is used, which allows the agent to generalize on larger layouts by extracting common features, hence requiring less iterations to train.

Tasks:

  • User playable
  • Ghost personalities
  • Approximate Q-Learning Simulation
  • Depleting exploration per training iteration
  • Menu UI
  • Stats UI
  • Option to view testing directly
  • Summarize training and testing
  • Code Refactor
  • Add delay between two training episodes
  • Change parameters for training and testing iteration of PacmanAgent

Reference:

http://ai.berkeley.edu/reinforcement.html

About

Approximate Q Learning Simulation of Pacman in JS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published