pygame is
Simple DirectMedia Layer is
Site Swing

pyGOAP - .2

Leif Theden (bitcraft)



goap is: Goal Oriented Action Planning

goap tries to make virtual character come alive through planning. behaviors are programmed, but they don't have to be explicitly linked. action planning is done at run time using the a*star pathfinding algorithm.

A more useful introduction

pyGOAP v.4

The main concept of GOAP is that AI is not a static table or set of states. Rather, GOAP uses a A* like search to find solutions to goals at runtime. This frees the designer of setting up complex behavior trees.

There is a test called It more-or-less test/demos the GOAP library. You should be able to run the pirate demo and watch how he satisfies his goal: getting drunk.

Check out the source comments and also the tutorial.



New version of pyGOAP! Does not require any external libraries other than the ones included with python. Tested and working on python 2.6.6 on os x. New version has support for more type of goals, recursive planning, "best guess" planning, and actions which require more than one time step to process. This is a rewrite of the library. The planner and been greatly simplified, and should be easier to understand.


Home Page:


click to view original size


pyGOAP - .4 - Apr 23, 2013
pyGOAP - .3 - Jan 19, 2012
pyGOAP - .2 - Jun 7, 2011
pyGOAP - .1 - Feb 11, 2010 account Comments

If you wish to leave a comment with your account, please sign in first.

December 21, 2011 12:27pm - Leif Theden - nickname: (bitcraft)
@saluk that is an interesting test case. the ability to repeat actions over and over, like dancing for money, is a new feature i've added. i can tell why the agent chooses to dance first, because it is fewer steps than going to get loot, which can take many steps. it is obviously not weighing the time spent doing one action over and over again. <br><br>i made some comments in the source about heuristics in the tree search that said that they are not used during the search. it wouldn't be a difficult thing to add, but i've got some ideas about the tree search that would require a rewrite of the actions.csv file and i've just put that off until i get the rest of it together. i will take that into consideration as on the next release. it's a small pet project, and i don't work on it often. thanks for the interest and the feedback; it means a lot!
June 21, 2011 3:14am - patrick mullen - nickname: (saluk)
Why can the pirate not seem to go do the third thing a pirate does, get loot? If I make dancing give him a small amount, and looting give a high amount, he dances a whole bunch and never goes looting. I can't seem to change any of the values to make him go looting instead of dancing. If I take away the dance, he figures he can't drink or get laid so idles the whole time. Is there more to the example than just the actions.csv? Seems like a pirate should be more interested in sailing for phat lewt than dancing for chump change :)
June 8, 2011 7:36am - Ken Lauer - nickname: (kne)
I like the concept a lot. Good job.
February 11, 2010 10:05pm - Nathan Franck - nickname: (font)
It'd be cool to see some sort of graphical simulation... I'd be up for that!

our projects welcomes all python game, art, music, sound, video and multimedia projects. If they use pygame or not.
recent releases
Feb 21, 2017

Jan 31, 2017

Jan 24, 2017

Jan 18, 2017

Jan 7, 2017

Dec 30, 2016

Dec 8, 2016

Nov 28, 2016

Nov 27, 2016

... more!
for pygame related questions, comments, and suggestions, please see help (lists, irc)