Best T. rex hunting strategy may have been a direct attack.

Even when stalking upwind a T. rex is frequently able to get within 40 meters before being detected. (Screen capture, click to enlarge.)

Even when stalking upwind a T. rex is frequently able to get within 40 meters of the prey before being detected. (Screen capture, click to enlarge.)


After five weeks at the Bone Marrow Transplant center at the University of Iowa Hospital I’m finally back home and working on Dinosaur Island again!


As part of my work on scent ‘plumes’ or ‘cones’ and the ability of prey animals, like the Edmontosaurus, to detect the scent of a nearby T. rex and respond accordingly, I was wondering if it would be beneficial for a T. rex to adopt a hunting strategy in which it purposefully maneuvered downwind of the prey and then attacked. Consequently, I created a simulation in the Dinosaur Island AI test bed program (see screen shot above) with one T. rex (Bob) and one Edmontosaurus (Gertie), entered wind direction and velocity (as shown by the plume) and let the AI control Bob’s hunting with two different methods:

  1. An AI routine that maneuvered Bob downwind of Gertie and then attacked.
  2. An AI routine that maneuvered Bob directly towards Gertie using the fastest path (considering for terrain and slope).

After running a small number of tests today (about 25) it appears that the maneuvering downwind of the prey strategy is not as beneficial as I would have thought. Frequently Bob was observed by Gertie while maneuvering downwind. But, more importantly, when Bob adopted strategy #2 (the direct rush), Gertie didn’t smell or see Bob until he was within less than 40 meters.

Keep in mind that these experiments are just preliminary and, most importantly, they only involve a T. rex stalking an isolated Edmontosaurus (who almost always traveled in herds) but this is still food for thought. When a T. rex encountered a single isolated prey animal, it’s best hunting strategy was probably a direct rush.

Share

New scent detection algorithm integrated into Dinosaur Island.

The finished equation for determining the probability of a dinosaur detecting the smell of another given wind direction, velocity, distance and bearing. Click to enlarge.

The finished equation for determining the probability of a dinosaur detecting the smell of another given wind direction, velocity, distance and bearing. Click to enlarge.

Above is the equation for calculating the probability that one dinosaur can smell another dinosaur given the wind direction, wind velocity, distance and bearing of dinosaur one to dinosaur two. A great deal of work went into this equation and I must thank my good friends and colleagues, Alberto Segre and Mike Morton, for all their help, feedback and encouragement.

Below are examples of the output of the equation with various wind direction and wind velocities:

Results of the equation showing likelihood of detecting a scent at a specific location given the wind direction and wind velocity. Each square is 100 meters. Click to enlarge.

Results of the equation showing likelihood of detecting a scent at a specific location given the wind direction and wind velocity. Each square is 100 meters. 

    Results of the equation showing likelihood of detecting a scent at a specific location given the wind direction and wind velocity. Each square is 100 meters. Click to enlarge.

Results of the equation showing likelihood of detecting a scent at a specific location given the wind direction and wind velocity. Each square is 100 meters. 

    Results of the equation showing likelihood of detecting a scent at a specific location given the wind direction and wind velocity. Each square is 100 meters. Click to enlarge.

Results of the equation showing likelihood of detecting a scent at a specific location given the wind direction and wind velocity. Each square is 100 meters.

Below is a screen capture from Dinosaur Island showing the results of the new scent detection algorithm (coupled with the newly added olfactory acuity variable, see New sight and smell variables added to Dinosaur Island).

Screen capture of Dinosaur Island with new scent detection algorithm integrated.

Screen capture of Dinosaur Island with new scent detection algorithm integrated into the AI. Note AI output on right (highlighted by red box): Gertie, the Edmontosaurus, cannot see Jim, the T. rex, but she can smell him. Click to enlarge.

While developing the scent detection algorithm and reading about the extent and frequency of injuries sustained by T. rex (broken ribs appear in about 25% of known T. rex fossils) it seemed very likely that an old T. rex (and T. rex did not achieve sexual maturity until their twenties) had to be a very cautious hunter. An Edmontosaurus regalis tail could break T. rex ribs if the Edmontosaurus was aware that the T. rex attack was imminent. As we will see in the next post, a smart hunting T. rex must have had to employ clever tactics to avoid both visual and olfactory detection as it approached its prey.

Share

New AI enables T. rex to anticipate prey’s future location.

Trex looking 40 secs into future

In this screen capture from the Dinosaur Island AI testbed program a T. rex (John, left) is stalking an Edmontosaurus (Muffie). The long yellow line intersecting the shorter yellow line is where John anticipates that Muffie will be 40 seconds in the future and he is planning accordingly. The blue lines are angle of vision arcs (140 degrees for Edmontosaurus, 55 degrees for T. rex). John can see Muffie. Muffie cannot see John. Click to enlarge.

We recently added ‘blinders’ to the dinosaurs by restricting their ‘vision’ to accurate angles calculated from the position of their eye sockets in their skulls (see new sight and smell variables added to define dinosaur species).

After restricting the T. rex’s vision to 55 degrees we observed some unexpected behavior: while pursuing prey a T. rex would occasionally ‘lose sight’ of his target and not be able to reacquire it. Upon investigation we discovered that the cause of this was that the T. rex would advance, single-mindedly, towards where the prey is now. Under some circumstances, and if the simulation’s ‘time slices’ were sufficiently larger (> 8 seconds), and if the prey moved away at an oblique angle, or disappeared behind a hill, it was possible that their prey was no longer observable within the restricted angle of vision.

The solution was to give the T. rex the ability to anticipate and calculate its prey’s position in the future.

If we simply wished to use ‘cheating AI’1 the solution would be trivia. Because the current goal for every dinosaur is stored in memory a ‘cheating AI’ could simply look up the objective for its prey and arrive there first. That is not what we did.

Instead, if the T. rex sees a prey animal and begins stalking it the future position of the animal at X seconds2 in the future is calculated given the prey animal’s bearing, current speed, expected terrain traversal and anticipated slope traversals.

Again, we must ask: are we making the T. rex too smart? At this point; we must be pushing the extreme levels of dinosaur calculations and planning abilities. However, as a predator – and there is solid evidence that T. rex was, at least, occasionally a predator –  he must have possessed the ability to calculate future positions of prey animals. Furthermore, he must have been very familiar with his hunting territories and, consequently, possessed a priori knowledge about terrain and slopes.

This AI technique probably makes a hunting T. rex in Dinosaur Island the most advanced NPC (Non Player Character) in all current computer games.

SmallRule

1) Cheating AI: There are numerous examples of ‘cheating AI’ in computer games. Without going into specific details, some of the more common methods include giving the computer AI information that should be hidden (such as enemy unit positions and intentions) and weighting random factors in the computer’s favors. See also Artificial intelligence (video games) and The Computer Is a Cheating Bastard.

2) X seconds: we are currently using 40 seconds as the future point in time for anticipated position calculations.

Share

T. rex (AI) successfully locates and hunts prey on Dinosaur Island.

A T. rex named George successfully found, tracked, pursued and attacked an Edmontosaurus named Julie. Click to enlarge.

A T. rex named George successfully found, tracked, pursued and attacked an Edmontosaurus named Julie. Click to enlarge.

It has been said that nobody wants to see how politics or sausages are made. Artificial Intelligence (AI), for some, may also be added to that list. Today’s blog topic is about achieving an important milestone in the AI behind Dinosaur Island: a T. rex ‘looked’ around his virtual world (using a 3D line of sight algorithm), spotted potential prey (an Edmontosaurus regalis named Donna) pursued it using an optimized A* least weighted path algorithm that avoided steep slopes and boggy terrain (the attack was up hill) , then saw a more attractive target (an Edmontosaurus regalis named Julie), changed his pursuit and successfully overtook the prey.

This AI is unique and probably the first time such a series of events has been demonstrated in a 3D virtual world environment. Below are step by step screen captures showing the events:

Screen capture with all AI tracing turned on. There are three dinosaurs in this image. George sees Donna (dark red line)

Screen capture with all AI tracing turned on. There are three dinosaurs in this image. George sees Donna (dark red line), Donna is looking almost due east (dark red line) at the forest of Araucaria trees where she wants to go to eat, the cloud of yellow is the AI looking at alternative paths for Donna to climb up a hill, Julie is also looking at the same forest of Araucaria trees to her northeast and the AI (yellow path) has plotted the best route for her to climb the hill. (Click to enlarge).

AI2

This screen capture taken 10 seconds later shows Donna approaching the Araucaria forest to the east and Julie climbing the hill towards the same forest to the northeast. George now sees that Julie is the closest prey and switches his attack to her (dark red line) and races toward her. (Click to enlarge).

George has

Ten seconds later, George has closed the distance and has attacked Julie from the flank. (Click to enlarge).

It’s important to remember that Dinosaur Island will ship in full 3D; these screen shots are of the AI testing environment which is in 2D.

Now that we have created a ‘perfect killing’ AI we will have to make it ‘stupider’ by adding distractions and imperfections.

Share

Tyrannosaurus rex hunting an Edmontosaurus regalis

A Tyrannosaurus rex (Barney) on the left has identified an Edmontosaurus regalis (Gertie) on the right. Screen capture (click to enlarge).

A Tyrannosaurus rex (Barney) on the left has identified an Edmontosaurus regalis (Gertie) on the right. Red lines indicate respective dinosaur’s goals (food). (Click to enlarge.)

Today the AI (Artificial Intelligence) routines for the inhabitants of Dinosaur Island to identify food were put in place and tested. The above screen capture shows the results: Gertie, a hungry Edmontosaurus regalis, has spied a forest of Araucaria trees on higher ground about 55 meters to the north-northeast. Barney, a very hungry nine year-old Tyrannosaurus rex has spotted Gertie 145 meters almost due east on the other side of a creek bed lined with Nipa plants. This doesn’t look good for Gertie. Will one and a half football fields be enough of a head start? How long will Barney pursue dinner before the energy expended will be too great? Look at Barney’s health. He hasn’t eaten for a while and he doesn’t have much energy left.

A reminder: the 2D ‘top down’ version of Dinosaur Island is just for testing and scenario creation purposes. Dinosaur Island will be released in full 3D. Dinosaur Island is a unique interactive simulation of real dinosaurs in their natural environment.

Share