Nicolas Kent
CMPS 146

Tag Game - Particle Filtering

The purpose of this project is to design a tracking algorith for a game of tag based on particle filtering. A pursuing object will not be aware of where its target is, but it will store a number of particle, which represent probabilities of where the target may be. These particle will be updated as the object explores the map and confirms areas where the target isn't found. Upon seeing its target, an object's particles will latch onto it. The object will then follow the mean value of all it's particles, to send it towards its target.

Project Source
Project Binary

List of changes

[Original Tweaking]

tgGame
- set obstacle count to 45
- set object count to 3
- set game field area to 768

tgCharacter - set maxspeed to 150
- max accelleration to 150

tgObstacleCircle
- randomize obstacle size (16 - 32)

tgCircleRenderer
- Caused circles to draw faded edges (modified tgGui::setColor)

tgColorRenderer
- added pulsing color to tagged player

[Assignment 1]

tgGui
- create a debugMod bool, for whether to display line of sight lines

tgEvade
- store a "lastKnownTaggedPosition"
- draw lines of sight to anyone we canSee as a debug check in the "Evade" controller
- run from the "lastKnownTaggedPosition"

tgPursue
- store a tgObject* "Prey" that is initially NULL, but becomes the nearest target
- store a "lastKnownPreyPosition"
- track the lastKnownPreyPosition

tgPerception
- add a "canSee(tgCharacter *target)" function to the Perception class This function checks to see if any obstacles fall on the line of sight

- add "randomCharacter" function to perception. Originally, I was going to have the AI chase the first person it sees...but that sort of defeats the purpose of the particle filter, which is designed to help track something you havent seen

[Particle Filtering]

- add a particle class in the "pursue" controller
- class contains location, probability, velocity
- on construction, randomly position the particles in the playing field

- add a vector of particles in to the "pursue" controller
- the pursue controller will create n particles in the constructor
- for now how about n=45

- display all particles for debugging purposes in the "pursue" getAction function

- within "tgControllerPursue"
- void randomizeParticles();
- creates an initial state for the particle filer
- void redistributeParticles();
- redistributes a new set of particles based on probability
- void wanderParticles();
- causes the particles to have a random jitter
- void updateParticlesFromTarget( tgRealVec const&);
- snap particles to a visible target and tell them to move at its velocity
- void updateParticlesFromView();
- drop probability of visible particles if the target is not seen
- make object follow the mean position of the particles