About this talk
In this talk, the speaker discusses the New York Times' new multiplayer game called Crossplay, delving into its development and the underlying dynamics. As a game developer at the New York Times with a diverse background in machine learning, mobile development, and data science, the speaker aims to provide insight into the game's mechanics and the company's extensive games portfolio, which includes popular titles like Wordle and Spelling Bee. Crossplay was designed to address player needs for a more engaging multiplayer experience, allowing users to connect and play collaboratively. The session also covers technical aspects such as the game's board structure, actions available to players, and the algorithms that facilitate gameplay, including a directed acyclic word graph used in the AI component. Additionally, the speaker highlights features like the automated content moderation system, chat functionality, and the learning tools embedded within the game to enhance player enjoyment and engagement.
Full transcript
speaker Shafi, he's setting up right now. He is going to tell us quite a bit about a new game that they built at the New York Times. And I always love seeing behind the scenes stuff at everything that's to do with with games. So, really looking forward to our next speaker. Big round of applause. Thank you. >> [applause] >> Okay. Great. All right, I just have to
make sure that's connected, right? Is it on? Okay, great. Thank you. Uh great, thanks for the introduction. And yeah, so I am going to be talking about our new game that we built. So, the title of my talk is multiplayer game dynamics behind the scenes of the New York Times new game Crossplay. That's the name of our game. And [snorts] so, I guess I'm not sure how
many people know that the New York Times builds games. Some of you probably do, but we do. But before I get into that, I'll go a little bit about myself. So, I'm a game developer at the New York Times primarily. I do a number of things, but that's one of the main things that I've worked on for the last 2 years and change. I previously worked at
a lot of different companies before. I worked for the federal government, I worked for Business Insider We're where I got a lot of my media experience, worked for the NBA and MTV. Um I have a background in machine learning AI research, which I procured at the federal government and did in my studies through the school I went to. Mobile development and data science, so I come from
a lot of different amalgams of things in order to make my work work. And here's my information. Okay, so yeah, we have a lot to go over here. So I'll try to get through everything I can, but if I can't make it through everything, feel free to reach me afterwards and I'll be here for questions. So we're going to start off with the basics of the games,
talk about crossplay, which is the core piece here, our games pillars and what we did and why we did it. How we achieved them and a little bit on the learnings that we had. So for those of us who for those of you who are not familiar, the New York Times Games portfolio is actually quite extensive. We actually started our games back in 1942 with the New
York Times Crosswords. I don't know how many people play the Crosswords, but they are pretty fun and challenging. And since then, that's been many years since we've grown our portfolio quite significantly, especially within the last several years. If you played Wordle, that's probably when it started coming into the cultural zeitgeist, but you can see that this is currently the set of a lot of our games and
the game that you see here is called Spelling Bee. It's one of our more popular games for learning how to spell and spelling words. Um so in the culture again, especially in the US, but uh in many places, uh The New York Times Games are played by millions of people every day. Um they show up all over the place in group chats, workplaces, late-night TV, you name
it. Um there's celebrities talking about it in Instagram. It's people share their Wordle scores between each other. Uh the Wordle the 1,000 and others have appeared on the Empire State Building. And um they they essentially are a lot of uh uh the daily habit of many people, um which include their social behavior. And it's not just a solo activity to just play the game on your own
by yourself. So, yeah, um here's just a a bunch of screenshots of some of that. So, let's go to why we built Crossplay. Well, uh there was a player need for it because people of who are fans of a lot of classic word games of different varieties uh realized that the mobile app game ecosystem had a a little bit too much going on in terms of extra
cruft and uh things getting in the way of um you know, focusing on the gameplay. Uh so, uh we wanted to do that and build a game that avoided a lot of that extra material and focused mostly on the gameplay experience. Um uh also, people wanted more ways to connect with each other through the puzzles. So, not just compare their grids. A lot of our games right
now, again, people compare their Wordle scores or compare um their Connections boards or other, you know, things uh in isolation. So, they wanted to kind of play with each other. And that's uh where we evolved our games ecosystem to be going. Um There's also a market opportunity with a a large category dominated by high monetization mechanics. Um and uh you know, our opportunity came in the form
of a trust-first alternative, where people trust us to provide a gameplay experience that's fun on its own without all the extra details and making the game experience enjoyable for people as as an application as a standalone. So, um and again, it fits into our portfolio strategy where we're developing and moving into the multiplayer asynchronous gameplay space. So, that's a lot of what we're intending to do and
how our direction is evolving and so therefore we made the game in that manner. And why a standalone app? Because most of our other games, if you haven't played them if you are intending to, they are all in the context of a single application. So, they're mostly built for asynchronous, you know, the synchronous play in their own context. But a single app allows us to do a
lot of different things including live turns, multiple turns between players, live chat, notifications, matchmaking, a whole slew of different functionality that wouldn't have necessarily been possible in the context of a single application with the rest of our games. So, little bit of context for that. And we just also wanted to make sure we stood out in the app store, mobile app store. So, we're going to talk
about Now, I'm going to get into the mechanics of the games and so this is where it gets a little bit deep, but that's what you're here for all you all developers and engineers for the most part. So, we'll start off with our pillars of how we, you know, go about developing things. And the first one is let them play, meaning what is the game? the first
thing is our game, Crossplay, and if you download it, you'll see, is the basic board structure is a 15 by 15 board with bonus tiles which include double letter, triple letter, triple word, double word scores which are score multipliers. Every turn you get seven tiles which you can play and from a set of 100 characters that come from a tile bag. There's only three actions, core actions
are play, pass, or swap. So, you can play a turn, pass, or swap to another player. The other player then will be able to you know play with their turn. And if you you can also change your tiles in your tile bag, but you'll skip your turn. The tray itself, which is on the bottom here, that can be shuffled, rearranged, and you can also resign the game.
Then you have a final round. So, on the last round when the tile bag score is down the contents is down to zero, then you'll both players will be notified that they'll now is the it's the last opportunity to put down a word to get a maximal score. So, the board mechanics are you know where it's a lot of the complexity comes into play. It's again 225
cells, 15 by 15. So, what you see here is the mechanic of the actual board under function. So, your picking up a tile, moving a tile across the board. So, this is the in the I'm going to be speaking from the Android ecosystem perspective. So, some of my terms are specific to that. The tile itself is represented by what's called a drag shadow. Which is a shadow
replica of the tile which you actually interact with. The board and tray are full screen overlay and they are complex and I'll go into that in a bit and they listen independently to each other on whether to accept a tile. And you can zoom in and zoom out and pan around the board. And that's one of the really complex pieces of the game and the way that
we architected the game to be very smooth really needed to take into account the the fact that all this multi-planar and multi-dimensional interaction was required to be put into place. So, again, from the user perspective this looks pretty straightforward, but from a development perspective there's actually quite a bit of wiring that goes under the hood to make this work smoothly. So, our game is full of different
kinds of logical algorithms for different sequencing and different properties. One of them is our drop detection algorithm. So, when you drop a tile on a cell that's already occupied, it won't just go back to your tray. It will actually go somewhere on the board that is logically a nearby where a person might intend to put the tile. Uh it tries to place the tile in the most
obvious nearby cell, but sometimes if it can't find that, then finally it will revert to the position it was before. And then cells that are off the board are already occupied, they're excluded from consideration of the algorithm. So, just going over the details a little bit, but not going too deep into the algorithm, but again, any of these you want to talk about later, we can. So,
just for a visual display purposes, what is a tile exactly? A tile is not just a simple, you know, piece of UX that you move around. A tile is actually in the game quite a complicated data structure of multi multiple levels where there's several different pieces interacting with each other, which include this drag shadow, then a special overlay container which does coordination between the tile and the
board, a special overlay hidden tile which allows state to transition properly across the tile as it transitions from the tray to the board, and so on and so forth. So, the point of this visualization is that when you're moving a tile around the board when you play the game, think of it as not just moving a single piece of UX, but this entire stack along with it,
this large communication layer. then that leads to more visuals, which include our animation system. So, the animations again are meant to be very functional in nature and are meant to emphasize the physicality of the gameplay. So, a player submission animation, as you can see, the animations are highlighted in the right, has several different phases. When a player submits a word, the valid word highlights disappear slowly. Um
there's a little score circle that flies to the actual uh score itself. The total score animation is accumulated. Uh and then the a transition occurs so that the header goes to the next player uh who you're playing against. Um in this case, it's playing against the computer and it has a thinking animation. Uh the opponent animation has tiles fly in from uh somewhere on the right side
of the screen where your avatar is located to place them on the actual tray. The coordination of these animations, again, once you get used to them, you don't think about them much as a player, but uh from a developer's perspective are quite involved. Um and then you have uh more things about border disappearances and then fade outs and other highly coordinated pieces that go into this overall,
uh the next piece I'm kind of flying through is our distributed communication system, which uses something called server-sent events. I don't know how many people have heard of server-sent events before, but uh in if not, they're an advancement uh to uh the usage of WebSockets uh because they allow for uh half directional communication, uh which is what we really needed uh for a lot of different things,
including chat. Uh so it essentially works by opening an open uh a persistent SSC connection to Fastly's edge servers. We use Fastly for this uh service called Fastly fanout. Uh Fastly handles the pub/sub routing and sends a heartbeat every few seconds to make sure the connection is alive and consistently sending data through it. Um the server-sent events supports many, many, many functions in the game, which includes
the chat, the the switching of turns, um the uh actual play underneath the hood, the accumulation of scores, whether a player is notified, whether they're banned, etc. There's tons of different things. Um and just for a visualization on how the fanout system works, uh the fanout system again is sent from the game server to Fastly and then our streaming client on the mobile applications then forwards it
to the correct section of the mobile app, whether it's chat or whether it's the friend section, in order to um uh make sure uh the the game functions. And if there's a sort of a break in the chat channel or in the communication SSC channel, then there will be a recovery and self-healing process, which allows the break to be recovered from. Uh so, that's this visualization is
basically uh demonstrating that and you can see the queue of events that piles up and gets um uh resolved uh as the uh event stream continues. So, um and then finally to the game uh actual mechanics, uh once you win a game, essentially uh banner shows who won and a banner shows who lost on each device that you play against. And you can play against many, many
people or computers. Um but either way, you'll know whether you won or lost. You'll know whether you're what your best moves are, um and you'll know uh that you can replay a game. Um and you can also have a history view, so you can see all the words that you played during the game because one of the core things we want people to do is use our
game to actually learn uh words, right? Um and then you have a special tool called a crossbot, which I'll go into in a bit, which is a part of the AI piece that we'll be talking about. And yes, I'll be talking a little bit about the AI that works here cuz that's the theme of this uh whole thing. Um So, and then just a basic uh note
on notifications. We have a lot of game alerts for multiple games, and we have social updates that when players join the app or leave or you accept a friend request because there's an entire friend request and acceptance system, then you'll know and uh you'll have a new your notification set up, pretty standard mobile uh setup. So, and now let's get to more I think of the deeper
interesting work on the uh the thought level, the learning growth pieces. So, um we as I mentioned, we have you can play against humans or you can play against computers and the computers have a special kind of on-device AI which we built, um, and it's much different than what you might think about as like neural network architecture. It's not that, um, so, uh, we use we start
off with something called a dog, a directed acyclic word graph. So, if you're familiar with word mechanics and linguistic mechanics and computation, it's one of the standard, uh, highly compressed representations of linguistic space. Um, uh, it they the dog al- algorithm allows us to efficiently search the board space, uh, for the words, for complete whole valid words, and we use additional algorithms under the hood to make
sure that the, uh, word space is connected so we can search quickly using that algorithm. And then we generate plays so that the computer will generate a play each turn that is optimal to the, uh, difficulty level that's set for it, whether it's easy, medium, or hard. And so, uh, the whole the the bot itself is implemented in in JavaScript so it can be cross-platform from Android
to iOS, uh, so because we need to play between both devices, uh, and the input is the entire board, um, and the output is a play notation because, uh, play notation is the standard way of the game understanding, um, you know, where words should be placed on the board. And at this point in time we have three difficulty levels, uh, the easy, medium, and hard bots, and,
uh, you know, they all have different levels of complexity. Some people are really good at even the hard bots, but they are a challenge. So, uh, if you play, just, you know, be interesting what your feedback is on that. Um, so, essentially, going without going too deep into the way the directed acyclic word graph works here, uh, there's, uh, it's essentially in the category of symbolic reasoning,
as I mentioned earlier. Um, the reason for this construction, a little bit of history on this, of such an algorithm is to ensure that, uh, brute force mechanisms, uh, aren't relied on on selecting word spaces because brute force is really slow and people used to do that until the 1980s when faster word search mechanisms were developed because people that brute force is too slow. the whole way
it works is that a dictionary you have a dictionary of words. We have we use the Oxford English Dictionary and NASPA dictionaries. That dictionary of words then is constructed into this intelligence space which is turned into a searchable prefix and postfix graph. the important thing about this is that automatically prunes invalid word choices and that's where the intelligence part of the intelligence comes into play. The invalidation
of words that are not playable is is very easily done in super fast time using data structure similar to this. And we have our own custom versions of this and other pieces of intelligence that feed into the bot mechanics of the game. So the basic idea of thinking about all of that is quickly the dictionary turns into the brain. That's that's pretty well one way of thinking
about how this all works if you want a quick heuristic. let's go to the next piece of the what we call the AI. We have something called a cross bot. So people love in our games to evaluate how they are playing overall because they want to know how to get better. The cross bot is a tool that is connected to our application which was maintained by our
team our up shot team which is one of our really great editorial teams at the company because editorial is our main business. They also maintain this piece. And it's essentially a game analysis that runs after the match so people can analyze how well they're doing as the match progresses. So the move quality goes from like if you did a basic move, a novice move, a solid move,
an amazing move or you might have done a genius move and you know beat your opponent like really effectively. This bot tool will help you analyze how well you're playing overall. Um, how does it work in details? Some of the high-level details, uh, it evaluates a lot of inputs to similar to the the opponent bot that I showed you there previously, but it takes the quality of
your uh, tile tray each turn. Um, generates a set of strong candidate moves on the board uh, based on the existing board mechanics. Ranks the moves by combining the immediate score with the leftover tiles. So, it's doing a computation to ensure that the the next play um, or what are what be the optimal play would be if you were playing through the game again. And then there's
a few simulations it does each turn to to account for different possibilities because you can put many possible words. So, in order to find an optimal word sequence that advances the game, you need to essentially go through a few candidate runs. And so, that's essentially how this bot mechanic works. This analysis bot work mechanic works. so, uh, we also again, uh, our game is a lot about
lot to do about learning. So, we have a dictionary where players can tap into any tile on the game and you can see all the words that you play. You can actually go through the dictionary uh, for those. And so, you um, you know, it's a great learning mechanic so, we've heard and people really love the fact that they can uh, see at a glance what they
uh, have put on the board and search. If they don't If a word looks esoteric, you can easily validate through here. Um, uh, players can search for any word in the dictionary and we also have a word of the day to help you learn that. That just appears on our gameplay screen. In this case, that word of the day is refract and that's an editorially chosen word
that um, is is defined by the New York Times and then is uh, piped into the application to be displayed. We also have your uh, personal um, profile which is your like meet It's called our meet app. It helps you see how you've played overall uh, with your stats and um, and the the stats will give you your best scores throughout all of your games and uh,
there's lots of places where you can see this profile looking because people really want to know how they're doing. And so we've put it all over the application and there's lots of social features including if you need because we have chat to block or mute a friend or somebody who you might be talking to. And so the finally we get to the smarter social elements of our
games. So we start off with matchmaking. So again one thing people really wanted to do is play with other people. That's one of the core premises of our game. So the matchmaking component actually has a has a lot of parallels to how matchmaking might work in games you're familiar with like chess or what not. an Elo score. So people are familiar with the concept of Elo. It's
a rating is relative to how you're doing against another person. So the matchmaking algorithm tries to match you against somebody who's playing equivalent to you based on how they play against other people. So you for example this you might have an Elo rating in in chess like 1400 and then another player might have an Elo rating of 1400. In theory you all are close to being a
good match for each other but you know the scores can go higher and as you win more games your Elo rating goes up. The addition to the Elo rating the matchmaking system is intelligent in other ways where it we want you to make sure that you play against people that are finishing games because many people could start games and then just leave them and we don't want
them. The whole point is actually playing games. And so therefore that algorithm takes frequency of play into account. And we are looking to many you know using AI and other pieces to figure out how to improve the matchmaking process but so far you know it our matchmaking process seems to be of interest to people at this point. we have real-time messaging, uh the chat messages. Uh now
this is a whole of the huge component, which I'm not going to go all into every single detail here, but um chat is a very complicated component to maintain, and we built our own entire chat system that's based on this uh server-sent events. Uh so the chat system essentially the messages go through a that separate channel. Uh you have a chat history. Um you know, a lot
of straightforward stuff, uh but still a lot of under-the-hood things to keep in consideration. Unread messages show as a badge. All All basic stuff that goes into chat. Now, the more interesting piece of this is that the uh system that moderates chats, remember we have millions of people who play our games a day, and we need millions of We need that scale in order to moderate chats
because um you know, we have a platform of record, and we need to make sure people are essentially adhering to our um uh terms of service. So, essentially we built a system uh which we called our automated content moderation system to score uh these chats uh against each a stranger-to-stranger chats to make sure that people are not violating uh the chat uh if they're talking to other
people. And there's different categories of violations, which include um uh you know, uh I'll show you in a bit, but essentially the violating messages uh are are validated against uh through the chat context, our entire trust and safety system, which contains this uh you know, uh the this analysis piece, this A11 piece. And uh the model outputs are validated against a golden data set to make sure
our uh our ACMS piece is is adhering to what our terms and services are. So, if you're familiar with model training, you'll understand that a golden data set is sort of the the sort of adherence criteria for any model that you want to make sure that it is performing well. And so uh that leads to our reporting flow. So, there's a chat analysis piece and analysis piece
and a reporting piece. And in the reporting piece, a report can originate from the chat or the or it can originate from anywhere where somebody might want to like file some kind of report. Um and there's a several reasons codes, 18 structured reason codes. So again, any system like this requires evaluations because model evaluations are important to catch failures and weak spots before users do. We also
want to make sure our model is staying consistent. So this is a snapshot of a piece of the evaluation report. And we compare different models with different context and different system versions using inconsistent using consistent metrics. And I can talk about that at some other point. But again, if people are validating or people are acting in a certain way, or you know, you can ultimately rely on
a ban-based system, and a player could get banned from the server for many different reasons. Um And there could be a temporary ban or a permanent ban, and we have this mechanic to help enforce that. So again, in the future, what we we did learn friction kill social play. So we want to make sure the game built the game in such a way that it is a
differentiator and doesn't introduce too much extra. But we want players to learn and grow. The dictionary is important and the score analysis is important. And great multiplayer and matchmaking is really important to the game because again, we're evolving our ecosystem into a very social ecosystem. And playing games that, you know, you can play against friends and and dear and have memories and all that good stuff with
people that you know. Um And again, if you our ethos is now, if you respect players' attention, they'll reward you with their time. And so here's the games app. This is not the This is the actual what our other games app. So there's a QR code if you want to download that. And then the crossplay app is the QR code here. So yeah, that is the end
of my presentation. Um if there are any questions, uh yeah. I guess I can take them. If I have time. I don't know.