When aliens besiege Earth in Universal Pictures’ recent action film"Battleship,” it is the Chinese authorities in Hong Kong whom Washington credits with delivering the early proof that these invaders aren’t exactly homegrown.

But those aren’t the only Chinese do-gooders on screen these days.

In “Salmon Fishing in the Yemen,"a romantic comedy about building a dam in the Mideast, Chinese hydroelectric engineers showed off their know-how; the original book included no such characters. In Columbia Pictures’ disaster movie “2012,” the White House chief of staff extolled the Chinese as visionaries after an ark built by the country’s scientists saves civilization.

In fact, references to the Middle Kingdom are popping up with remarkable frequency in movies these days. Some are conspicuously flattering or gratuitous additions designed to satisfy Chinese business partners and court audiences in the largest moviegoing market outside the U.S. Others, filmmakers say, are simply organic reflections of the fact that China is a rising political, economic and cultural power.

Meanwhile, Chinese bad guys are vanishing — literally. Western studios are increasingly inclined to excise potentially negative references to China in the hope that the films can pass muster with Chinese censors and land one of several dozen coveted annual revenue-sharing import quota slots in Chinese cinemas.

MGM, the studio behind the remake of the 1984 movie “Red Dawn,” last year digitally altered the invaders attacking the U.S. to make them North Koreans instead of Chinese, as originally shot.

When Sony’s “Men in Black 3" was released in China last month, censors had the studio remove or shorten several scenes set in New York’s Chinatown that they believed depicted Chinese Americans unflatteringly. (One portrayed Chinatown restaurant workers as alien monsters, and another showed bystanders of Chinese heritage having memories erased by a U.S. government agent / alien fighter played by Will Smith.)

Sony executives refused to comment publicly, and the scenes remained in versions of the film shown outside China. But privately, studio officials suggested they might have considered changing the locale from Chinatown to another New York ethnic enclave — thus altering the movie for audiences worldwide — had they been aware of the Chinese sensitivities before production.

“Hollywood these days is sometimes better at carrying water for the Chinese than the Chinese themselves,” said Stanley Rosen, director of the East Asian Studies Center at USC and an expert on film and media. “We are doing all the heavy lifting for them.”

A screenwriter on another Hollywood tentpole was told by the studio to steer clear of any Chinese villains in shaping his script.

The net effect is a situation that movie-business veterans say is unprecedented: The suppressive tendencies of a foreign nation are altering what is seen not just in one country but around the world.

“It’s a clear-cut case — maybe the first I can think of in the history of Hollywood — where a foreign country’s censorship board deeply affects what we produce,” said a leading Hollywood producer who, like several others interviewed for this story, spoke on condition of anonymity because he did not want to offend potential Chinese partners.

As overseas box office has become more important to Hollywood, studios have become more attuned to foreign cultures. The industry has been mindful, for instance, about offending Japan, which until recently was the largest foreign market (Japanese characters also play a big part in “Battleship”).

With China, co-financing deals add to the pressure: Under those agreements, foreign films receive funding from Chinese entities and are allowed to bypass the quota system. But such films often must include some Chinese elements — positive ones. Marvel Studios’ “Iron Man 3,” which recently began filming in locales including North Carolina and China, is expected to show a highly friendly side to the Chinese, because the production is accepting Chinese funds from the financing entity DMG.

“We look forward to working alongside DMG to bring ‘Iron Man’ to the Chinese marketplace in a significant way,” Rob Steffens, general manager of operations and finance for Marvel, said when the deal was announced. “Adding a local flavor … will enhance the appeal and relevance of our characters inChina’sfast-growing film marketplace.”

Some filmmakers say their inclusion of Chinese elements is a natural part of the creative process — such as a sequence in Disney’s “The Muppets"last year in which Miss Piggy, Gonzo and Jack Black were portrayed as martial arts experts, with onscreen flashes of their names in Chinese characters. James Bond will be in Shanghai in the next 007 film, “Skyfall,” though the production isn’t receiving Chinese funding.

Simon Beaufoy, the writer of “Salmon Fishing,” said he was under no obligation to reference China, but that the idea came to him spontaneously. “I wanted the biggest and most ambitious idea, and having the engineers from this dam achieved that,” he said. “These days, if you want to put something in a film that’s bold and ambitious, chances are you’re going to end up with China.”

Still, he was mindful of causing offense.

“I thought a lot about it and, yes, I probably was a little more careful” than he might otherwise have been, he said. “With the French and the Brits, for example, we know we can throw bricks at each other and it’s all very cheerful. But with China we don’t really know where the line is yet.... If you go over the line with the portrayal of any country, it can quickly turn into racism.”

Mainland censors have long taken out scenes they deem culturally or politically offensive. In 2007, a Chinese pirate character played by Chow Yun-fat was removed from Disney’s “Pirates of the Caribbean: At World’s End” for its release in China. The character is bald, has a long beard and long fingernails. At one point, he recites a poem in Cantonese, not Mandarin, which Beijing promotes as the nation’s common language.

The last timeChina’sState Administration of Radio, Film and Television clarified its censorship guidelines was four years ago. Those guidelines were vague and broad, with prohibitions against “disturbing social orders and harming the social stability,” “violations against the fundamental principle of the Constitution,” and “promoting obsceneness, gambling and violence.”

The rules also forbade content such as “murders, violence, horrors, ghosts and demons, supernaturalism … value orientations confusing the real and the fake, the innocent and the evil, and the beautiful and the ugly.”

There’s little public resistance. “Chinese will come to the theater even if they know in advance that a film’s been cut,” said Jimmy Wu, chief executive ofChina’sLumiere Pavilions theater chain. “They’re coming for the big-screen experience.”

A few years ago, comments on Chinese pop culture website douban.com and movie review site MTime.com regularly reflected the game of “gotcha” that Chinese film fans played with censors. People would buy pirated discs or download uncensored versions of Hollywood films, then comment online about what was missing from the versions in Chinese theaters.

Today, online comments about censorship are at a relative trickle, because, one cautious website executive said, “Chinese take censorship for granted. It’s a surprise when a film comes in uncut.” The censored “MIB3" took in a robust $48 million in its first 10 days in Chinese cinemas, according to Shanghai film industry consultants Artisan Gateway.

In fact, many Chinese moviegoers appreciate when Hollywood inserts elements that appeal to national pride. In “2012,” when the White House staffer (played by Oliver Platt) sings the praises of Chinese scientists, audiences rose for standing ovations.

The effect of all this outside China is more fraught. USC’s Rosen worries that a generation of moviegoers could emerge with a skewed, sanitized view of China in which human-rights abuses and even the grittiness of everyday life are swept under the rug.

“I don’t think the average U.S. filmgoer is hugely aware of all of these small decisions,” said Rosen. “But subliminally, it can start to have an effect.”

But some in Hollywood say that collaborating with China doesn’t present unmanageable hurdles.

“I’m not sure working with China is that different from working with a big studio,” said Michael London, an independent film producer who has had discussions with Chinese entities on a co-production. “I’m being partly facetious, of course. But I do think most producers in this climate have long since stopped looking askance at any entity that can help get their movie made. There are always going to be challenges and compromises.”

Even for those companies intent on playing to Chinese interests, though, it’s not always simple to do so.

U.S.-based Relativity Media thought it had hit upon a savvy business strategy when it decided to accept Chinese co-financing on its film “21 and Over,” a U.S. college comedy that had nothing to do with Asia. After shooting was nearly complete stateside, Relativity added in back story about a Chinese American character and, last fall, the production set out for China.

By shooting in China, the film would get some added production money and hopefully assure itself of a Chinese release.

But the company soon ran afoul of human-rights groups when it decided to shoot in the eastern city of Linyi, near where the blind dissident Chen Guangcheng was under house arrest. The activist group Human Rights Watch even urged a boycott of the film upon its release, prompting a fast back-pedal from Relativity Media. (The film is scheduled for release in the United States in November; no Chinese release date has been set.)

“I think the incident showed why China isn’t going to be a simple cash cow,” said a person associated with the project who was not authorized to speak publicly on its behalf. “People in Hollywood who want to do in business in China are going to learn this the hard way.”

steve.zeitchik@latimes.com

Landreth reported from Beijing and Zeitchik from New York.