Dinosaurs were the largest animals ever to walk the Earth, and with thousands of them roaming around competing for the same food resources, it's a wonder they managed to survive. But new research indicates that differing dino diets allowed them to peacefully coexist, especially at dinnertime.

Sauropods - large, long-necked plant-eating dinosaurs such as Diplodocus and Brachiosaurus - dominated the land between 210 and 65 million years ago. And with so many of these 80-ton giants walking amongst each other, it's remained a mystery to scientists as to how they could have coexisted. Especially considering the fact that the Late Jurassic Morrison Formation, a distinctive sequence of sedimentary rock in the western United States, was a harsh, semi-arid environment that would have had limited plant growth to sustain these herbivores.

Now, researchers from the University of Bristol and the Natural History Museum in London suggest that their diets may have had something to do with it. They focused on the skull and jaws of sauropods, using a variety of biomechanical techniques to investigate how they functioned and what this would mean for sauropod ecology.

Using CT scans to reconstruct the skulls of the sauropods Camarasaurus and Diplodocus to find out how these dinosaurs ate.

"Our results show that although neither could chew, the skulls of both dinosaurs were sophisticated cropping tools. Camarasaurus had a robust skull and strong bite, which would have allowed it to feed on tough leaves and branches. Meanwhile, the weaker bite and more delicate skull of Diplodocus would have restricted it to softer foods like ferns," lead study author David Button said in a statement.

Even in modern Africa, the highly diverse faunas can only support one truly gigantic species, the elephant. But dinosaurs found a way to cohabit by dividing their diets, creating less competition for food.

"Although, dietary niche partitioning has been suspected between Morrison Formation sauropods based on their structural features and patterns of tooth-wear, this is the first study to provide strong, numerical, biomechanical evidence for its presence in this fossil community," said co-author Emily Rayfield.

The findings were published in the journal Proceedings of the Royal Society B: Biological Sciences.