During the spring of 2009, Zynga developers logged long hours in their aging Potrero Hill offices, furiously coding a new game that would cement the young company's lead in the nascent social gaming space.

FarmVille offered players a pastoral respite from daily stresses, a chance to plant seeds, harvest crops and raise barns with friends.

Zynga beefed up its technology to support as many as 100,000 daily players. But within days of FarmVille's June launch, the number topped 1 million, forcing engineers into a mad scramble to fix software and add servers.

"We had jumped on this rocket ship and were just trying to keep it from blowing up in our faces," said Luke Rajlich, chief technology officer of FarmVille.

That's life at Zynga speed. The company appears to be the fastest-growing business in San Francisco, and ranks among the most rapidly expanding Internet companies in the world.

Zynga tapped into a huge market of people who like to play games by providing new outlets on social networks such as Facebook. And it found that many would pay real money for virtual goods that enhanced their experience or accelerated their progress.

"We had a fundamental belief that, if people found games at their fingertips, if you really reduced the barriers to entry to games and you made them social, then a much larger group would engage," said Mark Pincus, 44, who founded Zynga in January 2007.

He was indisputably farsighted in recognizing the opportunity, and has been rewarded with a company that could pull down a half-billion dollars in revenue in its fourth year. There's rampant speculation the company will go public, an event that would propel Pincus into the leagues of the region's superrich.

But the conspicuous success of Zynga Game Network Inc. has also engendered scrutiny and lawsuits, as some questioned the business practices that secured its early lead in the sector.

Shooting stars

Social gaming is a scorching industry. In recent months, Walt Disney Co. and gaming giant Electronic Arts Inc. agreed to buy Zynga rivals Playdom Inc. and Playfish Inc., respectively, in deals worth hundreds of millions.

Zynga, however, easily boasts the high score.

SharesPost Inc., an exchange for shares of private companies, says the company is valued at $5.51 billion - exceeding the market cap of the nearly 30-year-old Electronic Arts.

Unlike the shooting stars of San Francisco's dot-com era, a real business model has fueled Zynga's rise.

Only around 2 percent of social gaming users spend money, but 2 percent of hundreds of millions of users adds up to big numbers, said Mark Rose, vice president at virtual goods marketplace PlaySpan Inc.

Zynga boasts 208.8 million active players per month on Facebook and could reach $500 million in revenue this year, estimates research firm Inside Network. The company has been profitable since it was 9 months old, Pincus said.

Zynga is expanding its global footprint by perpetually hiring and acquiring. Its sprint to more than 1,200 employees has left the staff spilling out of a collection of Potrero Hill spaces, so in September, it signed the biggest new office deal in the city in nearly five years.

"This is the largest, fastest-growing, most profitable company with the most happy customers that Kleiner has ever invested in," said John Doerr, the partner of Kleiner Perkins Caufield & Byers, one of a handful of venture capital firms that have plugged about $360 million into Zynga. Doerr knows a little something about fast-growing companies, having backed Google and Amazon.com.

So how did a less than 4-year-old company surpass the value of EA, and outpace the early growth of the Web's giants? It depends on whom you ask.

Zynga was one of the first to pounce on the opportunity for gaming on social networks, recognizing a chance to transport something closer to the traditional model of games - friends playing Trivial Pursuit together in the living room - to the Web.

"We wanted to put the games in a place where people go, but also, make it additive to this social cocktail party that they're already in," said Pincus, who previously founded Freeloader, Support.com and Tribe.net.

He also suspected the most engaged users would be willing to pay money for virtual goods like coins, tractors or weapons that allowed them to more rapidly advance or "level up" in the games, or simply enjoy them more.

He was right.

Playing its cards right

The company launched its first game, Texas Hold'Em Poker, in September 2007, and became profitable the same month. It unveiled Mafia Wars the next summer, which catapulted Zynga to the top developer spot on Facebook with more than 40 million monthly users.

Pincus and other executives say they outmaneuvered the marketplace by designing better games, adjusting them based on how people were actually playing, and spending heavily on technology, customer service and marketing.

"We wanted to go for it, we wanted to be the biggest macro bet on social gaming," said Pincus, who lives in San Francisco with his wife and their twin baby girls. "We wanted to have more great teams going after more game ideas."

To motivate those teams, the company granted its young, bright employees as much autonomy and responsibility as they could handle, a philosophy articulated in the corporate value: "Be CEO, Own Outcomes."

"Mark said, 'Just own this. ... Pretend like this is your startup,' " said Justin Cinicolo, who quickly moved up from Mafia Wars producer to mobile general manager. "You have a chance to show off your abilities and rocket up the ranks as fast as you can take yourself."

And there are generous rewards along the way for successful workers, like the chance to spin around in a Lamborghini for a few days or indulge in paid weekend trips to Las Vegas.

But some believe Zynga's success has less to do with prescience or culture than a willingness to spam social network users, manipulate players and copy games.

FarmVille looked remarkably similar to an earlier game called Farm Town, and Mafia Wars closely followed another Facebook game called Mob Wars.

Bing Gordon - a Zynga board member, Kleiner partner and former Electronic Arts executive - responded that some amount of emulation is commonplace in the video game world.

But the creator of Mob Wars considered the similarities egregious enough to file a copyright lawsuit against Zynga. The parties reportedly settled for an undisclosed amount.

"That's their entire philosophy: Farmville is Farm Town," said Gregory Wild-Smith, formerly a senior engineer at Zynga who now works for a competitor. "Zynga says, 'This seems to work, we can tweak it about 10 ways and make it better.' "

Better, in this context, means more profitable. By doing deep analysis of the games, the company figured out the precise points when players would be most likely to spend money, he said.

Giving credit for innovation

Users, for instance, don't want to have to stop playing at critical junctures, lag behind competitors or disappoint their team members by refusing to plunk down cash for weapons or health points. So when the game asks, they pay up.

Some call it psychological trickery, but ThinkEquity analyst Atul Bagga said it's good game design.

"You have to give them credit for innovation on some of those features," he said.

He added that Zynga got the best of its rivals by marketing more aggressively, through paid and viral advertising.

For instance, notifications often appeared across a player's social network when they accomplished certain tasks. This kick-started a virtuous cycle, where players spread the word to more users, generating more revenue, more advertising and more users still, Bagga said.

But the viral ads engendered a backlash from people swamped by the messages. Facebook eventually clamped down on the notifications, a change that whacked tens of millions off Zynga's user counts.

Legal challenges

Zynga has run into additional problems over its advertising practices.

A number of lead generation marketers on Zynga and other social games offered in-game credits in exchange for things like participating in online quizzes or downloading ring tones. In some cases the ads mislead users into signing up for automatically recurring fees, industry blog TechCrunch wrote last fall.

Last month, the Wall Street Journal reported that several of Zynga's games, along with other top Facebook apps, were sending information that could be used to identify users to advertising companies.

Both revelations prompted lawsuits.

Kershaw, Cutter & Ratinoff LLP of Sacramento filed a class action complaint last year accusing Zynga and ad marketplace Adknowledge of engaging in fraudulent business practices. A federal district court judge in Oakland denied Zynga's motion to dismiss the case this month.

In a blog post after the TechCrunch articles, Pincus stressed that the company worked hard to remove "bad offers" and said the worst offender had been permanently banned before the articles appeared. He committed to take additional steps to prevent questionable ads.

Jay Monahan, deputy general counsel for Zynga, expressed disappointment with the court decision in a statement.

"The ads involved were created by third parties, not Zynga, and were removed more than a year ago, before the case was filed," he said.

Zynga said the cases prompted by the Journal article are without merit.

Growing up

Shortly after the flareup over the lead generation offers, an online video came to light that suggested the company had knowingly allowed such ads. It showed Pincus speaking at a Berkeley event in 2009.

"I funded the company myself, but I did every horrible thing in the book to just get revenues right away," he said. "I mean we gave our users poker chips if they downloaded this wiki toolbar."

"I downloaded it once, I couldn't get rid of it," he said. "We did anything possible to just get revenues so that we could grow and be a real business."

The question is: Is Zynga that real business now? Amid its rapid growth, has the company also grown up?

In October 2009, it launched Zynga.org, a nonprofit arm that encourages players to purchase "social goods" that benefit earthquake victims in Haiti.

In June, the company launched FrontierVille, which some have called its first original game. It features far more sophisticated graphics and game mechanics than past Zynga products.

Steps at improving image

Meanwhile, it is steadily expanding its distribution, rolling out mobile versions of its games for smart phones, striking deals with Yahoo Inc., and reportedly pursuing a similar partnership with Google.

To some, it appears the company is taking conscious steps to improve the corporate image.

"There's a period where there's very little to lose and a lot to gain by doing things that are a little more edgy," Forrester analyst Augie Ray said. "But you get to a certain point, like at the valuation Zynga is, and you have to change. You have to become the type of company that people have faith in, because that's important to your investors."

But it remains to be seen whether Zynga can maintain its spectacular growth in an industry where players on average disappear after six months and where companies are only as good as their latest games. And given its track record, some still wonder: Can the company be trusted as a steward of its customers' best interests?

"We want to build an Internet treasure," Pincus replied. "We want to build one of the trusted brands on the Internet. If you look at our actions, they speak louder than our words and hopefully louder than my bad words."