A strong smell of beer hits me as soon as I walk into the noisy filling and bottling plant. The cement floor is wet and sticky in places, and I'm careful not to step in any puddles.
I watch a robotic arm move a large steel keg into place while another caps it. Nearby, a conveyor belt transports brown glass bottles from one machine to the next. This one cleans the bottles. That one inspects them for defects. Another fills them with a honey-colored liquid, while yet another glues on the labels: Hofbräu Oktoberfestbier.
I'm at Bavaria's state-owned Hofbräu München brewery just outside the Bavarian capital of Munich. I'll get to taste the world-famous beer later. But first, I'm hearing about how the 428-year-old brewery makes its beer taste the same decade after decade, even as ingredients change over the years.
"The target is to always produce the same beer at the same quality," Rolf Dummert, technical director of Hofbräu München brewery, tells me. "It's very difficult" to get it right, he says -- especially for something made only once a year, like its Oktoberfest brew.
Germany -- and Bavaria in particular -- is synonymous with beer. And for good reason. Weihenstephan Monastery Brewery, about 25 miles north of Munich, has been brewing beer for nearly 1,000 years, longer than anywhere else in the world. Germans also developed the modern techniques used in brewing today. Then there's Oktoberfest, Munich's three-week festival of beer that's been celebrated since October 1810, in honor of the marriage between Crown Prince Ludwig and Princess Therese of Saxony-Hildburghausen. It's now the world's largest festival, of any kind. Germany and beer are inextricably linked.
But tastes are changing. Consumers aren't drinking as much beer as they used to, thanks to a combination of factors, including health concerns and people over 30 switching to wine. Meanwhile, the rising popularity of fuller-flavored craft beer created by small brewers has put pressure on long-established companies, according to a 2015 report from McKinsey. Increasingly, technology can help. While the basic brewing process hasn't changed for hundreds of years, automation, artificial intelligence and machines that handle multiple tasks are making it easier to get a consistently perfect brew.
Focus on fundamentals
Germans don't mess around with their beer. They even created a law dictating its ingredients.
The Bavarian Beer Purity Law of 1516, or Reinheitsgebot, decreed that only water, malted barley and hops could be used in brewing. The list later expanded to include yeast after scientists discovered its fermentation uses, but things like sugar and fruits were banned. If a beverage didn't comply with those regulations, it couldn't be called beer.
Today, when you see "Reinheitsgebot" on a beer label, you know what you're getting. Traditional breweries like Hofbräu München closely adhere to the standards to keep their longtime customers happy.
"Beer is a traditional value in Bavaria," says Markus Söder, Bavarian State Minister for finance, regional development and home affairs. "Everybody comes to Bavaria to taste this beer."
That's especially true during Oktoberfest, when about 6 million people gather to enjoy more than 7.5 million liters of beer served among 14 giant tents and 20 smaller tents set up in southwest Munich. This year's 184th Oktoberfest lasted from Sept. 16 to Oct. 3.
But while beer drinkers love Bavaria's traditional brews, they've also developed a taste for something newer: American craft beer, loosely defined as beer made in a traditional or nonmechanized way by a small brewery. Even Germans are starting their own craft breweries.
"Big [German brewing] companies aligned to the same [essential pale lager] taste and color," says Johannes Tippmann, head of the Weihenstephan research brewery at the Technical University of Munich. "It made things a bit boring. Then came craft brewers."
The craft beer trend has affected one important ingredient for beer: hops.
The small green bud, about the size of a marble and shaped like a pinecone, gives off a pungent yet familiar odor. It's a hop, something I've tasted many times in beer but have never actually seen. It's these flowers, harvested from the common hop (Humulus lupulus) vine and compacted into tiny pellets, that give brews their balance, depth and underlying flavor -- from bitter to piney, floral to grapefruity. And there are more than 200 varieties to choose from.
Because traditional German brewers are limited by the Bavarian Purity Law, they get creative by varying the hops.
There's been a big trend over the past few years of cultivating hops to bring out unique flavors, like intense pineapple or a combination of fruity and coconut, says Florian Perschel, a sales manager for Nuremberg, Germany-based Barth-Haas Group, the world's biggest supplier of hops.
Some brewers use old hops varieties in new ways. For instance, the Comet hop variant hadn't been used for 30 years. Now it's expensive and difficult to get. Others apply dry hopping, a previously out-of-fashion technique that involves adding hops to the brew after fermentation to create new flavors. The latest innovation is called Pure Hop Aromas, or PHA -- distilled hop oils that can be used to change the taste of brews.
"If you want to put more flavor in a beer, put in two drops of PHAs, and it makes it a hoppy, really great beer," Perschel says over -- what else? -- a few beers at Barth-Haas' booth at the quadrennial Drinktec trade fair, held last month in Munich. Consumers can't tell the difference between a beer made with PHA oils or with pellets, Perschel says, and some prize-winning beers use them.
But traditional German brewers never touch PHAs because they don't comply with the purity law. The ingredient is accepted in the rest of the world.
I decide to try them for myself. I take a sip of a beer that -- to my nondiscerning palate -- tastes, well, fine. Then I start sniffing the PHAs contained in clear little bottles. I decide to try the coriander flavor. Perschel opens the bottle and, using a medicine dropper, puts a couple drops in my beer. He swirls the glass to mix the brew and hands it back to me.
What I taste is... coriander-flavored beer. I decide to add a little smoky flavor to the mix. That may not be everyone's idea of a good brew, but I like it.
The goal with PHAs is to produce them so there's no difference between using hops pellets and PHAs. But today, there are some pellet flavors that can't be replicated with the oils, Perschel says. For instance, when you dry-hop an IPA using two hop pellets varieties to give you a rich flavor of tropical fruits, there's no PHA that can currently create that flavor.
A crowd gathers around a silver machine in the center of the Drinktec conference hall. Four large circular compartments connect to each other through a descending cascade of chutes, making it look like some sort of mechanized sea monster. No wonder this serpentlike contraption is called the Nessie.
This is the newest mash filtration machine made by Germany-based Ziemann Holvrieka -- a 165-year-old maker of brew house gear -- and it changes how liquid is traditionally separated from solids. Instead of individual machines for separation, extraction and washing grains, Nessie handles it all.
Nessie can't be purchased alone. Instead, it's part of a bigger system called Omnium, which the company says revamps every aspect of the beer-making process. The brewing process with the Omnium takes precisely four hours, 10 minutes, compared with six to eight hours before.
"It's a totally new brew house concept," says Verena Blomenhofer, senior manager of R&D and patent systems at Ziemann Holvrieka.
A small pilot brewery tested the technology earlier this year, and a bigger German brewery will have its turn with the machine in early 2018. Other brewers will be able to try the Omnium in that larger facility, and Ziemann will gradually roll out the system to early adopters starting in 2019.
Mash filtration isn't the only process getting an update. Elsewhere in the convention center I see a bottle inspection device. It's one of the most important machines a brewery can have. A system from Heuft, called the InLine II IR, inspects empty bottles for possible defects like chips and cracks. The machine is equipped with cameras to make sure no potentially problematic bottles get through to the next stage in the process.
I stand in front of the machine and look at its display panel as glass bottles move along the conveyor belt. A bright light shines into a bottle as soon as it enters the machine, while a camera automatically looks for problems. When it detects an issue, the machine sorts the bottle into a separate area.
I check out another Heuft glass bottle inspection machine, the InLine II IXS. Along with cameras, this one includes X-ray strobes to uncover even harder-to-detect flaws. And it comes with something else to make inspection easier: a "chief navigator" or assistant called Amanda that can speak instructions for using the machine. It's a one-way interaction. Amanda doesn't respond to spoken commands. But in the future, the goal is for Amanda to be a smarter assistant that knows who you are, remembers your preferences and responds to your verbal commands.
"Everything I would have done with my finger [on the machine's control panel], I will be able to do over voice control," says Anton Diehl, a product manager at Heuft. "But that's not yet."
Next up is the actual filling and sealing of bottles. Krones, one of the world's biggest makers of brewery machinery, now offers the Dynafill, which fills and caps bottles in five seconds flat, versus the previous rate of about eight to 10 seconds. I watch the Dynafill fill a bottle with liquid, then put a cap on so quickly, I miss it. I literally blink and miss it.
Since the beer bottles stay inside the one machine instead of moving to a second, less oxygen gets into the bottle before capping -- improving flavor. It will be installed in a German brewery at the beginning of 2018 for tests before being rolled out to customers the following year.
Hofbräu München earlier this year installed a different Krones machine at its brewery: the Varioline packaging machine. It combines the work of five different pieces of equipment, including putting cartons into an upright position and then placing bottles in them.
The new machines make the brewers more efficient, but they also come with some drawbacks. Because the equipment is more complex, it's harder for brewers to fix the machines on their own -- kind of like what's happening in the auto industry. Such complexity increases brewers' dependence on suppliers, and means they can't simply patch up machines with new parts.
"A lot of things we can solve by ourselves, but the number of things we need external help for is growing," Dummert, of Hofbräu München, tells me. "And it will keep growing even more in the next 10, 20 years."
Bundles of green hops arranged in wreaths hang from the ceiling of a massive tent as a giant, inflatable angel holding a harp -- the Engel Aloisius, as he's known -- bobs above the endless crowd. Nearly 10,000 people dressed in their finest brown lederhosen and colorful dirndls are crammed into the tent. Gingerbread hearts with phrases like "I mog Di"-- "I like you" -- dangle from women's necks.
People stand on wooden benches and swing liter steins filled with golden beer as a band plays the drinking song "Ein Prosit" ("A Toast") over and over. Even people who speak no German will soon know the words, or think they do.
This is Oktoberfest, or Wiesn as it's known in Germany, at the Hofbräu Festzelt site. The tent, with its wooden floors and high ceiling, looks to me like a permanent structure, but it has to be rebuilt every year, starting two months before Oktoberfest begins. The brewing of Oktoberfest beer starts in April.
It's here, at Bavaria's biggest party, where the Reinheitsgebot, that old beer purity law, is on full display. It's also here where I finally get to taste that famous Hofbräu Oktoberfestbier.
CNET's Shara Tibken worked in Munich through the end of September as part of the Arthur F. Burns journalism fellowship program. That included testing a lot of German beer -- for research, of course.
The Smartest Stuff: Innovators are thinking up new ways to make you, and the things around you, smarter.
Tech Culture: From film and television to social media and games, here's your place for the lighter side of tech.