The Tag Game Commentator was a project for two classes taken during Fall 2008, with a submission to the undergraduate Game AI class (CMPS 145) and the graduate class in generative programming (CMPS 2890G). For my class project, I implemented a commentator in Python, which has a proposal you can read. IntroductionThe commentator is based on Tag Game and makes relevant comments on the game action, implemented using aspect-oriented programming.What it doesThe commentator comments on tags, and evaluates each character's speed in order to decide whether to choose a saying randomly a list of lines where:
The commentator keeps up with the gameplay by using a two-slot first-in-first-out buffer, with new lines pushing out old ones that were queued to be spoken. This creates the illusion of relevance, without any decision-making or prioritizing needing to be made. Aspect-Oriented ProgrammingThis project is also a novel application of aspect-oriented programming to video games. To my knowledge, there is no prior work implementing a commentator using AOP. If you arrived here via Google, then the quick answer is "yes, this does work." I would recommend trying it out, commentary is a code tangling issue which AOP is well-suited to solving. You can read the paper in PDF format. DownloadThe code can be downloaded from GitHub. There is also a nasty bug preventing the program from exiting cleanly; I can't seem to stop the speech thread executing, despite trying lots of different code snippets. You'll need to use Ctrl+C to exit (yes, I know how bad this is). |