My childhood hamster, Hamlet, seemed pretty depressed. He didn’t seem to enjoy his colorful cage, complete with a tunnel, wheel, and ramp. The only thing he did with zest was gnaw at the plastic, trying to escape, which he eventually did. A few days later, my mother found him lying on the bathroom floor, dead.

I have wondered ever since: Was Hamlet suicidal? Or was he simply displaying normal hamster behavior? Now, a new study suggests a scientific method for gauging hamsters’ emotional states.

Hamster emotions don’t just baffle pet owners; they also bedevil scientists who use the fluffballs as subjects in their experiments. One of the most frustrating things about trying to study animal emotion in general is that you can’t take behaviors at face value. If a hamster runs madly on its wheel all night, for example, how do you know if it is running out of joy, or boredom? (Or just for the heck of it.)

To bypass that problem, the researchers decided to measure something called judgment bias—essentially, the way that mood affects behavior and decision-making. As humans, our decisions are influenced by our emotions all the time—witness stress-eating, or revenge-shopping. Similar biases have been found in primates, rats, mice, and many other animals, but never before in hamsters.

In the experiment, researchers split 30 Syrian hamsters into two groups. One group lived the high life, in cages bedecked with extra toys, ramps, bedding, and hammocks. The second group had the minimum in hamster hospitality, with some light bedding and a wheel.

To see whether living in such different environments would affect the rodents’ emotional states, and, consequently, their decision-making, the researchers administered a simple test. Previously, all the animals been trained to associate plastic drinkers located on the left side of a meter-long arena with bitter quinine water, and drinkers on the right side with sugar water, a yummy treat. In the new test, the researchers put the drinkers at intermediate locations between the two drinkers, then measured how often the hamsters approached them.

Hamsters living in the lap of luxury were roughly 12% more likely to approach drinkers in ambiguous locations—even those close to the bitter drinker—than those living in more austere cages, the researchers report today in Royal Society Open Science. When the scientists swapped the hamsters’ cages, their behavior also switched. It is possible to objectively measure both positive and negative shifts in the animals’ behavior, the researchers say.

We will never know what the enigmatic fluffballs are really feeling—we don’t have hamster brains. But a better understanding of hamsters’ emotional lives should help make research and pet care more humane, they say.

It may be too late for Hamlet, but there’s hope for all the other hamsters out there.