by date
Be the Dinosaur - AI Postmortem
Be the Dinosaur - AI Postmortem
| Name: | James Ford | ![]() |
|---|---|---|
| Date Posted: | May 24, 2008 | |
| Rating: | 5.0 out of 5 | |
| Public: | YES | |
| Comments: | YES | |
| RSS Feed: | or Subscribe with . | |
| Profile Page: | View profile page for James Ford |
Blog post
Be The Dinosaur
AI Postmortem

This was originally going to be a blog post but it got way, way too long. For the complete pdf doc, click here. The rest of this post contains no information not in the full version. Go ahead and click it.
Introduction
Be The Dinosaur (BtD) is a museum exhibit featuring an interactive simulation in which the visitor takes first-person control of a dinosaur in the late Cretaceous period. The exhibit may contain 1 - 32 machines together on the same network. Currently the two playable dinosaurs are the Triceratops (trike) and Tyrannosaurus rex (trex). Visitors will interact with each other in the simulation and with AI controlled dinos (DinoAgents). The most important activities are finding food, water, and defending yourself from other dinos.
This project is produced by Eureka Exhibits and developed by us at Sickhead. The Sickhead team consists of Tom Spilman, Russell Fincher, Ross Pawley, and James Ford (me). We began work on this project October 1st; 2000+ svn commits and 7 months later we emerge having finished the first project phase.
The focus of this paper, however, is the ai in BtD. Serious work on the AI began ~February 25, 2008. This paper reflects work done from then until May 19, 2008. This means approximately 2.5 months of full time work by an individual (me) was done for the BtD AI as it is now.
Reasons for this Paper
- Spend some time reflecting on what we have done, and what to do next.
- Let the community know what we are up to here at Sickhead.
- Give something back to the community; there might be something useful for you in here.
AI Development Cycle
The first BtD museum exhibit opened on Feb.3, 2008. At that time there was no dinosaur AI except for a random wander behavior which did not perform pathfinding or obstacle avoidance. Since multiple players were not always available and not reliable for "modeling correct dinosaur behavior", improvements to the AI were a high priority for both improving the educational value and overall visitor experience.
After completing work on other core issues I began working exclusively on the AI around February 25th. The simulation was already on exhibit and the museum was promised on-going improvements throughout the duration of the exhibit. Also, visiting publicists and agents from other museums would be visiting and we needed to maximize the chance of booking future exhibits. If you are getting worried, we did make all deadlines, a good impression, and everyone was happy. At this time the exhibit has moved to the Louisville Science Center in Kentucky and we are in preparation for beginning a second BtD contract, which will include more AI improvements.
Since the simulation was already on exhibit when real work on the AI began it was important to implement features that would make the biggest different in gameplay first. We did not have an allocated amount of time for a design phase or time to develop a complex architecture. I also had very little AI programming experience. This should set the tone for you, and I thought it worthwhile to mention that time constrains played a large role in the AI development.
Resources and Acknowledgements
The most valuable resource turned out to be ImmersiveAI provided by Gavin Bunney.
www.garagegames.com/blogs/64167/12423
The book Programming Game AI by Example by Mat Buckland.
www.ai-junkie.com/books/toc_pgaibe.html
And the AI Game Programming Wisdom series of books.
www.aiwisdom.com
Thank you Gavin for making iAI available to the public, and excellent work! We had to make a decision early on whether to make our own architecture from scratch or try integrating an ai resource. We looked at GOAP (goal oriented action planning used in F.E.A.R.) and would have loved to implement it in Torque, but we just didn't have the time. iAI turned out to be a perfect starting framework for A* pathfinding and goal-based behaviors.
Also very useful and often consulted was the book Programming Game AI by Example, thanks Mat Buckland for writing the most practical, and best overview, ai book ever. In particular, the steering behavior code formed the basis of our SteeringManager class.
The AI Game Programming Wisdom books were also excellent for providing general education of contemporary ai techniques. Obviously not all the papers could apply to this project, and in fact source code from only one or two papers made it into BtD. Some of the more tantalizing ideas and techniques we just did not have time to mess with. However, I consider myself a much better educated ai programmer for having read them and that will help solve any problem.

BtD AI Architecture Overview
Brief list of components:
- Steering Behaviors for managing short range movements and obstacle avoidance.
- Procedural node generation based on empirical testing and A* pathfinding.
- A prioritized goal architecture for defining dino behaviors.
- A DinoAgent class completely separate from the Player class, which can be attached and detached.
- A DinoAgentManager class to handle updating agents, propagating sound events, and other operations that affect all or multiple DinoAgents.
Brief list of DinoAgent behaviors:
All Dinos:
- Find and drink water.
- Prefer to remain near their pack.
- Interact with friendly dinos (eg. vocalization).
- Respond appropriately to overly aggressive "friendly" dinos.
Trike:
- Find and eat edible plants.
- Use a variety of tactics while in combat ( eg. charge, defend, flee ).
Trex:
- Find and eat dino carcasses.
- Hunt and kill prey dinos using a variety of tactics ( eg. stalk, charge, circle, flee ).

A few AI topics covered in the pdf:
Interesting techniques...
- Integrating dynamic and static obstacle avoidance ... what didn't work, what else didn't, and what did
- Precomputing paths to solve problems ... finding the closest water or plants to a dinos position
- Handling goal failure and avoiding goals ... don't repeat the same mistake
Areas for BtD AI to improve...
- Making Dino AIs more responsive to the player ... more interaction options, re-prioritizing interaction goals
- Improvements to handling goal failure ... better failure tests, more custom code in goal-fail callbacks
- Improvements to the goal architecture ... goal subclassing, dynamic goal priority ...
---
The rest you can read in the PDF. Also our client put a few videos on YouTube.
Enjoy!

Recent Blog Posts
| List: | 07/28/08 - My Programming Cheatsheet 05/24/08 - Be the Dinosaur - AI Postmortem 09/07/07 - TGB 1.5.1 Tutorial Pack In Development |
|---|
Submit your own resources!| Peter Simard (May 24, 2008 at 03:04 GMT) |
| Daniel Allessi (May 24, 2008 at 03:19 GMT) |
| Matt Huston (May 24, 2008 at 07:17 GMT) Resource Rating: 5 |
| Andy Rollins (May 24, 2008 at 08:46 GMT) |
| Phil Carlisle (May 24, 2008 at 09:04 GMT) |
I'd also recommend Mat Bucklands book, its actually pretty good as a first step. I'd recommend looking up "Behavior Trees" if youre interested in AI, as its something a lot of us are using (its almost like bucklands goal system, but a lot cleaner to implement).
| Kevin James (May 24, 2008 at 13:39 GMT) |
| Brian Richardson (May 24, 2008 at 16:30 GMT) Resource Rating: 5 |
One quick note on the debug rendering. An alternative to adding the DinoAgents to the client scene graph would be to create a new RenderBin that would loop over your DinoAgents (since you've got this list already) and call the render method directly. (Like the RenderObjectManager does). That way you wouldn't need to transmit any info over the wire to support debug rendering, you'd have full access to the server side version of the dino. (Assuming you're running everything on one box of course! heh).
| Tom Eastman (Eastbeast314) (May 24, 2008 at 17:36 GMT) |
| Treb Connell (formerlyMasterTreb (May 25, 2008 at 05:30 GMT) |
Hopefully the exhibit will make its way over to the Seattle Science Center, I'll certainly go if it does.
Edited on May 25, 2008 05:31 GMT
| Tom Spilman (May 25, 2008 at 07:20 GMT) Resource Rating: 5 |
| Francis (May 25, 2008 at 23:02 GMT) |
| Bill Vee (May 26, 2008 at 23:28 GMT) Resource Rating: 5 |
I like the dino animations. Very talented animator.
Very original.
Great work.
| Russell Fincher (May 27, 2008 at 03:22 GMT) |
Edited on May 27, 2008 04:37 GMT
| JPaxson (May 27, 2008 at 18:59 GMT) |
| Deborah Marshall (May 27, 2008 at 18:59 GMT) Resource Rating: 5 |
| Todd Pickens (May 28, 2008 at 02:20 GMT) |
| Brett Seyler (Jun 01, 2008 at 08:19 GMT) Resource Rating: 5 |
| Andy Hawkins (Jun 01, 2008 at 17:08 GMT) |
You must be a member and be logged in to either append comments or rate this resource.



5.0 out of 5


