When red pandas go on exhibit for the first time at Brookfield Zoo in July, they'll be housed around a broad tree that looks like a giant bonsai and has magical qualities.

At semirandom intervals throughout the day, will drop automatically into stainless steel cups expertly fitted into what look like huge knotholes in the "tree," a construction of welded metal, plastic mesh and concrete.

The - telegenic, frequently erect-standing relatives to raccoons, rather than to bears or giant pandas - will learn that the cups sometimes contain food, sometimes not. In this way, the theory goes, they'll also stay metaphorically on their toes, engaged with their environment and steadily on the hunt for sustenance.

"Now the habitat provides, instead of the keeper," says Tim Sullivan, the zoo's curator of behavioral husbandry. "Food can appear, like in the wild."

Sullivan is helping to lead what he calls a paradigm shift at Brookfield, a revolution in the way its residents eat that is proving to have benefits for guests and animals alike. Instead of the old regimen of keepers delivering food two or three times a day on a set schedule, the zoo is working to propagate semirandom feeding devices throughout its 216-acre property in the near western suburbs. It's being used in 15 to 20 percent of exhibits now, but the goal is to get to near-blanket coverage within five years.

"My ultimate goal is to get every animal off the feeding plan," Sullivan says. "The story is always the same: We give the animals something else to do, and they're more than happy to do it."

At the heart of the efforts is the makeshift lab where Sullivan and fellow keeper Dan Powell play MacGyver by modifying existing devices, inventing new ones and puzzling out such problems as: What is the best way to deliver a cricket to a meerkat? (In a cardboard tube, on a slow-moving belt.)

Describing another concoction, Powell says, "Oh, it's a modification of a potato gun, really. It can rain food down on the whole exhibit, and the animal never knows where it's coming from." He pauses, and adds with a smile, "Plus, I got to make a potato gun at work."

The potato gun, which he is still calibrating and which will likely deliver cardboard tubes stuffed with different comestibles, will probably first be used in the Great Bear Wilderness, says Powell.

Some of their devices use modified coolers to keep chilled food fresh. One notion is to use melting ice as a timing mechanism. They'd love to install a pneumatic tube system that would deliver tubes made of gelatin, but half-million-dollar exhibit retrofits are not likely.

Among the supplies, there's a box full of automotive door locks and also turn-signal relays on hand, for remotely unlocking doors to food. Suppliers, apparently, love them because of the novelty. Says Sullivan: "They'll say, 'You're the one! What the hell are you doing with them at a zoo?'"

It's not the work they signed on for when they began careers as zookeepers, but it feels as vital to them as the aspects of animal husbandry that may be more familiar to visitors. Plus, says Sullivan, "We have to exercise our minds too."

"Our main reason for doing it is to create an overall holistic approach to animal welfare," says Bill Zeigler, the zoo's senior vice president of animal programs. "We believe that as animals do in the wild, they should do under professional care, and that is work for a living."

The result, in anecdotal observation and in two scientific papers Brookfield zoologists have authored, has been more active animals, which has equated to visitors spending more time in front of the animals.

"When an animal's in the wild," Zeigler says, "the first thing it does in the morning, it says, you know, 'I've got to find food.' And it doesn't get that 8:30 in the morning and 4 in the evening feeding." Such food drops can bookend a sort of torpor that produces, says Zeigler, a "couch-potato mentality."

Sharp-eyed visitors can see some of the devices already at work in Tropic World, the giant airplane hangar of an exhibit that showcases primates in habitats meant to evoke Asia, Africa and South America. At the top edge of one wall above the western lowland gorilla exhibit, there's a box shape covered in the same material military snipers use to hide their presence.

Inside the box is a device built and marketed for aquaculture, essentially fish feeding. A wide belt gets pulled around an opening to the back of the box. Food devices - in this case, custom-made, nontoxic cardboard tubes, like mini poster mailers - are stuffed with gorilla treats, such as grapes or Kool-Aid powder, and placed on the belt.

In normal operation, a mechanical clock mechanism slowly lets the belt move forward over a multihour cycle, dropping food out of the opening. Sullivan and Powell make the belt feedings both random and regular by always placing food on some parts of the belt while only sometimes doing so on other parts.

With the automatic door-opening devices that will fill the food cups in the red panda tree, low-voltage electricity is required, plus computer chips that Powell programs for the proper blend of regularity and randomness.

With the modified fish feeders, though, the power comes simply from winding the clock mechanism. "The only downside with this is we have to have gravity," Sullivan says.

Just east of the gorillas, the dry "riverbed" in the bottom of the Asia section has, as a companion points out when we enter, "a 'Hunger Games' feel." Being human in a wild animal habitat is anxiety-producing enough, but the steep walls and sense of being watched add to the feeling of menace.

Yet all we're doing, really, is feeding the Asian small-clawed otters. It's early morning, before the zoo opens and before the animals come out. Keeper Nava Greenblatt brings in a couple of modified coolers, the same kind you might use to bring drinks to a picnic. But a rectangular segment of the bottom of each has been cut out so food can slide into the soon-to-be-filled river.

The delivery mechanism is, once again, one of those modified belt feeders - the Pentair Aquatic Ecosystems 12-Hour Baby Belt Feeder, to be precise - sandwiched between blocks of blue ice to keep the food fresh. Greenblatt scatters a measured portion of frozen fish onto the belt, and the timing mechanism will move it forward to drop fish in at both expected and unexpected times.

(Semirandomization is key, Sullivan says, and an inspiration is "the algorithm that Vegas uses" for game payouts. Too irregular a pattern, and the animals lose interest. Too regular, and they lose motivation.)

In a system that's been in place for just a few weeks, Greenblatt places the cooler on a shelf a few feet above the river, then covers it with a section of camouflage cloth, and we head upstairs to watch from the visitor walkway. With the orangutans already in the habitat above them, and the gibbons behind them swinging with seeming recklessness from limb to rope, the otters are released into the exhibit.

They swim immediately toward the base of the cooler, looking for fish, but nothing has dropped yet. One otter even stands to get a closer look. They swim off to another cooler on the opposite bank. Still nothing. They shimmy onto, and then across, the center island. Minutes later, a second cooler trip still finds nothing edible in the water.

Then, from up above, we see a fish chunk drop and swirl about in the water - "food in potential," Sullivan calls it - and the otter that's been the most active is the one that finds it first. "We're seeing a lot more foraging, a lot more activity," Greenblatt says.

Keepers worried that such delivery methods might mean dominant animals would hog the food supply. But in practice, Sullivan says, the animals work it out, just like they do in nature. Aggressive animals might eat their fill first, but they all seem to be getting enough, as evidenced by more frequent weigh-ins to be sure.

For an even more unpredictable feeding, live fish are sometimes released into the river.

The ideas will probably need more scientific imprimatur to really spread through the zoo community, Sullivan said: A paper on the gorilla feeding is awaiting scientific journal and peer review.

Chicago's Lincoln Park Zoo is trying something similar in its new Regenstein Macaque Forest exhibit, according to a spokeswoman. Automatic feeders that can be scheduled or turned on remotely will be tested "to track the animals' response to different feeding strategies," she said.

At Shedd Aquarium, frequent trainer interactions keep many animals engaged, said Lisa Takaki, senior director of marine mammals. And some of them get a version of timed-release, forage-encouraging food: fish chunks inside gelatin that they have to work to get hold of.

Brookfield's formal experiments started in the late 2000s, with a fennec fox study that proved semirandom feeding boosted animal activity and visitor engagement.

"It's important that animals don't simply wait for their people," said Jason Watters, a former director of animal behavior research at Brookfield who is now vice president of wellness and animal behavior at the San Francisco Zoo. "There had been previous attempts to do randomized feeds throughout the day and that kind of thing (including hiding of food). We sort of did it differently in a mixture of random and predictable. That's what worked out well."

Some early efforts to put this proof into action, in a program Watters calls "dynamic resource allocation," were crude.

Using PVC pipe and a hacksaw, according to Sullivan, he, Powell and Watters devised mechanisms that fit into a tree and provided irregular meals for a type of parrot, but the birds figured out how to just shove the food doors aside rather than wait for their automatic opening.

"Then you go to the people that actually have the (building) talent," Sullivan said. That would be people like Ian Edwards and Doug Young, who work in the exhibits department and have spent most of their winter crafting the red panda tree, a sort of version 2.0 of an automated feeder tree for lemurs that visitors can see inside Hamill Family Play Zoo.

"We're trying to service the keepers' requests and the animals' needs," says Edwards, who has a philosophical bent. "In the end, if it looks like we were never there, that's great. It's about providing a pedestal for the animals. But it's not about the pedestal. It's about the animal."

The tree should be done by April. A next big problem for Sullivan and Powell to tackle is a way to randomize delivery of big food to big animals. "How do you distribute two or three bales of hay to a hippo or a rhino in a timed way?" Sullivan wonders.

And, as is common at zoos, Sullivan is eagerly anticipating a new delivery. This one is not a new baby, though, but rather an order of 24 of the $200-plus Baby Belt Feeders. From there, "it's just left up to your imagination of how to solve the different exhibits," he says.

"The answer was always there," Sullivan says. "In the past, keepers have focused on filling the void (between feedings) with play. People said, 'The only types of enrichments use are ones that involve feeding.' Why not create foraging opportunities?"