Over half a billion people play games on or with Facebook every month, and developers are earning billions. In this photo illustration, Facebook is displayed on a laptop screen, March 25, 2009. dan kitwood/getty images

The days of endless Farmville or Words with Friends invites may be over, but Facebook is once again playing a big role in the economics of online gaming. The key is the log-on-with-Facebook feature: Publishers that use it can accept Facebook ads, and as Facebook’s ad revenue grows, so do the checks for gaming companies.

Of the $8 billion Facebook paid to developers over five years, a significant chunk of that went to game developers. In 2015, game developers using Facebook tools for web alone made $2.5 billion. At the same time, the number of people playing games on or with Facebook grew to 550 million, from 375 million in 2014.

These stats are sure to be front and center when Facebook summons its developers to Menlo Park, California, for its annual F8 Conference in April when the company is expected to tout games as an underserved market ripe for advertisers. "Our role in the overall ecosystem is, we help people build, grow and monetize their gameplay experiences," said Leo Olebe, director of global games partnerships at Facebook. "At the end of the day, gaming is about helping people find the stuff they’re passionate about and enabling them to share it with their family, friends and whoever."

To get there, Facebook has had to overcome a stigma that dates back to its earlier days when gaming empires like Zynga were built largely on Facebook with games like Farmville and Words With Friends, and then struggled when Facebook moved games off the network. But now games are back with a vengeance, and this time making money from Facebook.

"Looking back to 2014 vs. 2015, our number of players doubled," said Roman Zhdanov, head of marketing for Plarium, an Israel-based development studio whose titles include Sparta: War of Empires and Soldiers Inc. Organic channels, conversations on Facebook and sharing achievements account for 50 percent of Plarium's revenue. Players who use Facebook Login are 10 times more likely to make in-game purchases, he said. Facebook's mobile app Install Ads was responsible for 41 percent of traffic to their various games. The average lifetime of a player on for Plarium was over 18 months.

Retention is at a premium for game developers, as players rarely stick with a game for a few weeks, let alone a few months or a year. Facebook for Developers has tools to target audiences, understand their behavior and find others that fit the profile of a gamer you want or need. The reach for Facebook for Developers extends to mobile. For developers in the incredibly competitive world of mobile gaming, dominated by the likes of Clash of Clans and Candy Crush Saga, finding success requires skill, luck and powerful tools capable of quickly understanding an audience.

Facebook launched its mobile ad platform, Facebook Audience Network, in 2014 to reach an audience that was becoming more reliant on getting their news, playing games and sharing socially on smartphones and tablets. Those small banners on the bottom of your screen showing a small thumbnail of a game, its rating and a call to install is one part of Facebook's ad network. Mobile accounted for 80 percent of Facebook's ad revenue, the company reported for the October-December period.

Facebook Login is the most obvious example of Facebook's suite of tools. Developers can add this function to let users use their Facebook account to sign in to the game. The advantage for the player is ease of use. For developers, Facebook Login helps create a customized experience that can better engage its audience. "There are things you can learn about how users are playing the game and adjust the game accordingly," Olebe said.

Developers can integrate Facebook's ad network to their product, with the social media company handling the distribution across its partners. Developers can target certain audiences and select what ads appear in their apps. For this, Facebook gets a cut of the revenue and some additional personal data of the individuals using the apps. For those concerned about their privacy, there are ways to opt out of the tracking.

One way to target a potential audience is with App Events. Developers can build custom audiences or lookalike audiences — customers similar to those already playing the game — and market to these groups. For a developer looking to expand its global reach, Facebook can be a powerful tool.

Piano Tiles 2, the musical game where players tap along to various songs, is a global hit powered by Facebook. Chinese developer Cheetah Mobile used Facebook Login and Analytics for Apps to reach a targeted audience. "Being able to leverage Facebook's mobile app ads helped us to acquire over 20 million new high-quality users all over the globe, and using Analytics for Apps allowed us to to achieve a lower cost per install by measuring the effectiveness of other acquisition channels," Sylvan Wang, producer at Cheetah Mobile, said.

The reach of Facebook extends beyond the desktop, smartphone or tablet. There are 33 million players who used Facebook Login on the PlayStation Network or Xbox Live, Olebe said. While many may have abandoned their virtual farms, others may never leave.