Actionscript 3 AI Steering Behaviors Library
Big update for you guys! Hey I know I’ve been a bit AWOL on posts lately, but recently I just finished a project which I was on a time crunch to get done. Also I had been having issues with ironing out the last of some bugs with my new big library for you guys. It is an AS3 Artificial Intelligence Steering Behaviors library which works with the game structure code I’ve been writing.
Also I’ve made several adds / changes / fixes to the game structure which I’ll list out below. I wanted to write a big article ( or several ) explaining this big AI library and how each thing works, but I didn’t want to keep everyone waiting any longer so I am going to go ahead and release it now and I’ll write up articles about it as time permits. ( which I have more of now )
For those of you who want to dig in and learn it all on your own go ahead, but for everyone else I promise I’ll get some articles up soon explaining the changes and some tutorials on how steering behaviors work and how I’ve designed mine.
Here is a demo app that I created which shows off everything. You can download the source from the google project page. I highly suggest setting up a repository folder on your PC and keep it updated with the current game library folder, as that is the one which I will be submitting updates to. I won’t be updating the various zips any longer. I recommend tortoise SVN.
So anyhow, here is a list of changes to the game structure that I have made so far. Be sure to check back soon for more AI / Game Structure fun!
ENGINE CHANGES:
- Added more functionality to the Sound Manager class.
- GameFactory is no longer a singleton.
- Added creation of gameworld to GameFactory for easy game setup.
- Fixed dispose function on Entity.
- MovingEntity now restricts its movements to the max speed variable.
- MovingEntity has a MaxAcceleration var, which is mainly just for external use.
- Added a damping variable to MovingEntity.
- Fixed an incorrect math function on Matrix2D.rotateVector()
- CreateCallback function added to Root
- Updated all classes extending EntityParams with the ability to pass variables in the constructor IE:
new EntityParams( { radius:10, type:”Blob” } );
NOTE: be sure to call super( a_params:Object ) AFTER you set any of your defaults, or anything passed in will be overwritten ( by the defaults ) - Added a createCallback function to Root. Quite useful in some cases, check it out.
- Cleaned up Root by taking out the FPS calculation. Use a custom FPS class for this now, such as the Urbansquall one which I am using in the Main() class.
- Added astage width/height const to Root for ease of use. Obviously you will have to change it depending on your games size. - Fixed the lineIntersecton function of the Geometry Class. ( Thanks to Ryan from Mochimedia for pointing this out )
- Added a “getRandomPolygon” utility function to the Geometry class which returns an array of points based on some parameters




(2 votes, average: 4.50 out of 5)



