This article is reposted from my Dinosaur Island blog here.
Yes, I know in Jurassic Park velociraptors could open doors (I would post a picture, but I’m worried about lawsuits so here’s a link to the clip instead). Luckily, on Dinosaur Island we don’t have any doors, kitchens, cages, Land Rovers or electric fences so we don’t have to worry about writing the artificial intelligence (AI) routines for the dinosaurs to deal with these objects.
Instead, we’re interested in if the dinosaur can see the food (I discussed 3D line of sight algorithms in, “Dinosaurs, tanks and light of sight algorithms,” here). And, if and only if, the dinosaur can see the food, how does the dinosaur get to the food? The fastest way for the dinosaur to get to the food can be solved using a least weighted path algorithm which I discussed in this blog here.
Now, the question is, “are we making the dinosaurs too smart?” The image at the top of today’s blog is a screen capture of the AI ‘looking’ at different ways to get to the objective (in this case, food that has been identified previously using the 3D line of sight algorithm). From literally thousands of possible routes (some only deviating by a meter from another possible route) the optimal, or fastest route across the landscape (avoiding steep hills and terrain that would slow the dinosaur down) is chosen.
Is this really how a dinosaur thought?
Probably not. What I suspect, and again, I’m a computer scientist, not a paleontologist, is that dinosaurs, especially a dinosaur pursuing prey, ran straight towards the target until it encountered something (an obstacle, a steep hill, swampy land) and only then considered going on an alternative path.
So, I will probably rewrite the AI so it’s not optimal. But for now, we’ve got some really smart predators on Dinosaur Island. Not opening doors smart. But smarter than the real thing.
Below is a screen capture of the optimized AI least weighted path algorithm.