Mantis shrimps carefully survey burrows before trying to evict rivals, new research shows.
Burrows in coral rubble are vital for the shrimps - providing a place to shelter, feed, moult, mate and lay eggs - and competition is fierce among both males and females.
Size matters to a homeless shrimp in search of a home, as burrows need to be big enough to fit into and small enough so they can block the entrance with their armoured tail.
Scientists from the University of Exeter and Duke University worked out the "ideal" burrow size and found that, when presented with empty burrows, shrimps chose a larger-than-ideal home - perhaps intending to grow into it.
However, when faced with occupied burrows, intruders fought hardest (measured by rate of success) for homes that were slightly smaller than ideal.
"We know that animals can assess a variety of factors, including the size of the opponent and the value of the prize, when deciding whether to fight and how hard to fight," said Dr Patrick Green, of the Centre for Ecology and Conservation on Exeter's Penryn Campus in Cornwall.
"In this case, as a smaller burrow is probably occupied by a smaller opponent, it seems mantis shrimps will compromise on the size of the home if it means an easier fight.
"It might be assumed that animals fight hardest for the biggest assets, but this study is an example of maximum effort being reserved for something that's 'just right'."
This species is one of a group of mantis shrimp called "smashers", as they strike with a club-like appendage that can kill prey and rivals, and can even crack aquarium tanks.
These strikes can accelerate as fast as a bullet, reach a speed of more than 50 miles per hour and create a flash of light by vapourising water upon contact.
When fighting rival shrimps, they generally take turns to throw one or more "punches" while the opponent curls up, using its tail as a shield.
Overall, resident mantis shrimps won most of the fights (69%) against intruders in the study.
However, when intruders fought over burrows slightly smaller than their ideal size, they won 67% of fights.
This victory rate dropped to just 13% for burrows that were much smaller or much larger than the intruder's ideal size, as calculated by the researchers.
When intruders did triumph, they usually did so by throwing the first punch and delivering more strikes.
The shrimps in the study were collected from their seagrass habitat off the Caribbean coast of Panama and kept in tanks for the experiment.
Funders of the research included the Human Frontiers Science Program and the National Science Foundation.
The paper, published in the journal Animal Behaviour, is entitled: "Quadratic resource value assessment during mantis shrimp (Stomatopoda) contests."