Chat With Your Friends While Gaming With Discord
Name: Discord (Visit Discord)
Type: Messaging and Voice Chat
Best Website For: Chatting with friends while gaming.
Reason it's on The Best Sites:
Discord lets you chat with your friends no matter which device they are gaming on. It's super convenient and functions really well. It's even really useful if you don't use it while playing video games.
The Time Is Future
- Introducing the Games tab! See what’s going on in your Discord universe — games being played, news on games you play, Spotify listening parties, and more. Read our help article to get the full scoop.
- Invite links for Group DMs now exist because they should.
- You can also make empty Group DMs and start tossin out invites like you’re a promotor to a an indie concert that no one really wants to go to but will because what else are they gonna do on a Tuesday night out in the BIG CIIIITTYYYY.
- @everyone messages will now warn you and ask if you really want to send that message. I believe this is a famous psychological experiment where people who reserved @everyone for truly important reasons had greater success later in life.
- Colorblind mode begins! User statuses are no longer a secret for humans with different configurations. Turn this feature on in User Settings -> Appearance. You asked for this!
- When set to Japanese, Korean, or Chinese, Discord’s font will look more consistent and better like my three pointer. Jake didn’t know what a three pointer was so here’s a wikipedia link for Jake.
- Changing input or output device now makes a BEEP bEEP beep.
- B1nzy did not have anything to add. Smh.
The Future Is Now
- Wanna see behind the curtain? Follow our Instagram.
- DISCORD IS HIRING TALENTED BEAVERS!.
- Our HypeSquad needs Event Coordinators! If you run LAN events, University Gaming Clubs, or the like, sell your soul to us here.
Discord is now three years old! According to three year old developmental milestones, we are capable of correctly naming familiar colors, drawing circles, and getting a headshot as Hanzo — feel the dragon — and yes that was a link to a tweet with the exact same joke. So joke I used it twice.
IT'S OUR BIRTHDAY!!! Discord is officially three years old 🎉 🎁 🎈 🎊 🎁 🎉 🎊 🎈 🎉 🎊 🎊 🎉 🎊 🎁 🎊 🎉 🎈 🎊 🎊 🎉 🎊 🎁 🎊 🎁 🎉
Really though, birthdays are a sacred opportunity for us to look back in time and see just how much love and support all of you have given us. It’s part surreal and part why am I crying?
We want to say thank you to everyone who wished us happy birthday! Thanks for all the fan art, kind words, and good vibes~~
@discordapp HAPPY BIRTHDAY. TYSM FOR ALL OF THE WONDERFUL MOMENTS SHARED WITH MY FRANDS
Happy Birthday @discordapp!
@discordapp I love you Discord! 💖 You changed my life in a lot of ways, and I'm not even kidding. Found friends, had unforgettable experiences, great memories on Discord.
Happy birthday @discordapp! Here's one unoriginal piece.
We also asked our HypeSquad to share their favorite Discord memories with the hashtag #discordmemories. Our hearts were collectively warmed by all your reminiscing. There’s so many laughs and so much love that it feels like shopping at a boutique pillow store. Live, Laugh, Love — My Dudes.
My Favorite memory on discord had to be staying in touch with friends and making new ones. Staying up till dawn playing games and just having the time of my life thank you @discordapp #DiscordMemories @HawthorneFox @Quasar_Fox @SurxRosso @Momobeda @BeezlyOfficial @Lukasmcd14
I started looking for some people to play @Titanfallgame, and I stumbled onto @Cownt_Chocula Twitch channel who pushed using his Discord channel. I joined a great community in multiple ways that day, somehow became a mod and chat way too much. #DiscordMemories
DiscordMemories My favourite memory of all was November 4th 2017, the day me and my boyfriend started our relarionship. I cant thank discord enough for giving me the chance to meet the person I hold so near and dear to my heart. Thank you @discordapp, and happy birthday <3
Honestly, probably one of my favorite #DiscordMemories was when I had 300 people in a voice channel and played spooky scary skeletons on loop for an hour. #SorryNotSorry
Check out the #discordmemories hashtag to see all the love.
Furthermore, Discord itself has grown a tremendous amount since our birthday in May of last year. Let’s take a graphical look at how Discord has evolved since then.
As you can graphically digest, year three was pretty amazing for us. We’re consistently blown away by how much support all of you give us. It’s a wind tunnel of love. We look forward to the wind that comes in year four.
PLEASE INSERT DISC 4,
The “Crying Happy Tears” Discord Team
BETTER FASTER STRONGER LOUDER
- We did some heavy tinkering on Discord’s core infrastructure. Most of the following bullets are related to this. Queue the Daft Punk track.
- We’re not joking, please listen to this while reading for maximum impact.
- Large servers perform better in general. CPU and network usage is about the same regardless of server size (whether a hundred people or a hundred-thousand people).
- Offline members are no longer hidden after you cross one-hundred members. We turned this off long ago for tech… and it is back. Offline lists in large servers are still hidden, though.
- Discord uses a lot less data now. Long live your data plan.
- Discord uses a lot less battery now. Longer live your battery life. Also, the iOS app loads faster. Android imminent.
- Large Discord servers can now grow much larger. This one’s for you, Fortnite.
- Select Xbox Insiders can now connect their Xbox account to Discord. Will be available to the rest of us mere mortals sometime in the very very very near future.
- Audio files can now be played directly in Discord to minimize the time it takes for people to listen to your toasty mix tape.
- Screenshare now includes audio! Now your friends can yell at you to kill the Genji behind you.
- New authentication screens are sexy af. Go check out how wavy they are.
- Added a volume slider to the inline media player because that llama video someone sent me was loud and confusing.
- The instant invite pop up now has user suggestions for speed running server invites. UX BOOOOOOST :rocket:
- Turned off a few lights in dark theme. There’s more dark now. That’s how that works.
- If you’re a YouTuber or a streamer and love Discord, you should apply for the Discord Partner Program and increase your coolness factor by at least 16%.
- We need external validation, so please follow us on Twitter, Facebook, and Instagram.
- Jobs Jobs Jobs Jobs Work For Us Please We Need Help So Come Get A Job Job Job Job Job Job
Years ago, when starting the company that became Discord, I wanted to build a workplace that was rewarding, challenging, and positive. To achieve this, I started with a simple question, “How do you create a place where people can thrive doing their best work?”
My goal for sharing this philosophy is to give everyone a glimpse into how we do things — especially those of you who may be considering joining the team.
Upside Down Leadership
The answer begins with the way leaders see themselves. We have a tremendous impact on the shape of the workplace and I believe that traditional top-down management fails to bring out the best in people.
At Discord, our leadership philosophy is bottoms-up, meaning managers act as support and guidance for individual contributors. I remember loving the jobs where my boss would coach me and give frequent tips on how to do better. I remember hating the jobs where my boss would micromanage me while giving feedback once a year.
Small & Mighty Teams
Contrary to popular Silicon Valley belief, hiring slow and maintaining a small team has tons of benefits. Hiring slowly allows us to take our time to find excellent candidates who truly understand Discord’s mission to bring gamers together. It means our team has a greater opportunity to gel and develop meaningful relationships. Best of all, it means that each employee has a deeper opportunity to learn and grow with the company.
Furthermore, a small team forces us to choose the work that brings us the greatest results — the path of highest compounding leverage. It forces us to say no to good ideas and yes to great ones.
With all that said, over time I’ve come to settle on four values (inspired by a variety of sources including this talk) which I believe create the kind of environment that talented top performers thrive in: autonomy, mastery, purpose, and compassion
People want the freedom to be creative in their approach to solving problems. I’ve found the conditions needed for someone to be creative boil down to two questions and the space to answer them — what outcome am I trying to achieve and why does this outcome matter?
The entirety of our planning process is about clarifying the what and why of someone’s work. The entirety of our management process is about supporting people to actually do the work which ties into our leadership philosophy as written above.
One of the most motivating things for a high performing person is making sure their work is important and challenging. Their projects should let them stretch beyond their comfort zone, but not so far that they aren’t successful.
To make sure they succeed, everyone provides constant, real time feedback. We don’t do drawn out performance reviews every year. Instead, we shatter the typical feedback process into hundreds of digestible bits. This structure creates an incredibly fast learning cycle that allows everyone to grow and improve in real time instead of accumulating feedback into a grueling annual review. Over time, I’ve seen junior folks grow into strong senior contributors — and even managers — through this approach.
Feedback is a dialogue at Discord and we recruit everyone to participate regardless of position. Team members are encouraged to give their feedback to leadership as much as leadership is encouraged to share feedback with their team members.
Many of the best relationships in my life were built playing games. I have such great memories playing all sorts of games with the people closest to me like my wife, brother, and best friends. Some people here appreciate games through time spent playing with their kids or see it in their spouse’s close relationships.
Whatever the specific connection is, the point is to deliberately hire people who can connect with our mission. When they do, it means they sweat the details. It means people put in the extra oomph to make something great. So many things just “happen” because people care.
It’s not possible to manufacture this — we look for it during our hiring process and only hire people who care about why we’re doing what we’re doing.
At Discord, people don’t leave their personal life at the door. We expect people to show up to do great work. That said, some days you’re just in a bad mood or having a rough time with something at home. We respect each other as people and have come to realize that acknowledging people’s emotions and keeping feelings in the open creates a much more supportive and effective environment.
I remember a day when one of our executives noticed a team member was on the verge of tears at their desk because of a personal issue. At a moment like that, work doesn’t matter — they put it aside and took a walk to chat about what was going on. Not only did it give the team member the opportunity to talk through what was going on in their personal life, it also gave the executive an opportunity to understand what that team member was going through. These kinds of emotionally reflective and vulnerable conversations happen often at Discord.
It’s a marathon, not a sprint
Sustained productivity comes from healthy work-life harmony. Each person has their own lifestyle and circumstance which informs their work schedule. For example, many employees at Discord have children and keep family hours — working a solid 8 hours every day and then off to have dinner and tuck their kids in.
Everyone does what’s best for their own situation and their team to ensure sustainable productivity. We respect and accommodate what each person needs to be most effective.
Through these foundational principles applied each and every day, we try to thoughtfully create an environment where talented, diverse people from all walks of life feel supported and encouraged to do great work.
Along the way, we make sure to have fun, to celebrate our victories, to eat good food, and to share pet pictures, of course. Take a look:https://medium.com/media/4a7b9f5acc955c7bae0f592f685fee1b/href
If this looks and sounds like the kind of place you’d like to work, come apply for one of our many jobs and join us on our mission to bring people together around games.
Thanks for reading,
Founder & CEO
ROLL THE DICE
- Randomly select someone at random with Discord’s all new @someone. It’s like playing @ roulette.
- Discord will now crash at random to keep you on your toes at all times. Your calves will thank us later.
- While in a voice channel, typing owo in any text channel causes Discord to let out a cry of distress.
- @supereveryone is here! You can now bypass @everyone permissions for when you need to say something urgent or important. We trust you’ll respect other people and use this feature only when needed.
NO MORE MEMES
- Fixed a bug that caused something you didn’t want to happen. Now it does something you want.
- Removed all those heckin’ memes. Who thought any of that crap was funny?
- Fixed a bug where this weird lonely creature was all over our app. It’s in a better place now (specifically, Boise, Idaho).
- We’re definitely not hiring, so don’t even think about applying for one of our extremely attractive positions.
- Discord Nitro is being downgraded to Discord Stop! Drop calls, prevent your messages from sending, and reduce your file upload limit by half!
You’ll learn how Mike leveraged Discord to:
- Get vital player feedback
- Build an excited community
- Support the game on launch
We dig the decision to bring the in-game factions inside of Discord. It’s an awesome way to keep people engaged and connected with the community. We’re also stoked and surprised by how players helped flip negative reviews to positive after launch.
If you’re looking for some more beginner-level server set up, check out this old community building post we dug up and dusted off from 2015. It’s still relevant. Mostly. Kinda.
Anyway, now for Mike…
When we were planning the announcement for Descenders, we knew that we wanted Discord to play a huge role in what we were cooking up. We’ve all been Discord fans for a while now and have watched how influential the platform has become — but on top of that, building a community for your game has become one of the best ways to ensure success, especially with the sheer volume of games being released every day. As a result, it made way too much sense for us to build our Descenders community through Discord from the very beginning.
But, simply throwing up a Discord server and hoping people join isn’t how we roll. We wanted to offer potential community members real reasons to join us on Discord, via beta access, exclusive content, meta-games, ARGS, the works.
What we didn’t realize at the time was just how integral our Discord community would be in shaping how Descenders has evolved. From community feedback, to language translations, to realizing the key strengths of the game, to supporting our game sales and ratings on launch, our community has helped to mold our vision into the game you see today and set us up for success moving forward.
That’s Cool, I Have No Idea Who You Are
I’m Mike Rose from publishing label No More Robots and I’m working with Dutch studio RageSquid on an extreme downhill biking game titled Descenders. The game launched last month on Steam and is coming to consoles very soon.
Descenders is a mountain biking game featuring procedurally generated worlds and roguelite elements through which your bone-crunching mistakes have real consequences on your progression through the ranks.
How about h!gh voltage hitting that sweet spot in Descenders 😱👌 https://t.co/nJARNAgT8I
From early on in development, it became obvious to us that Descenders was going to benefit heavily from community involvement. We had this whole explosion of features we wanted to add to the game but weren’t sure which features would be most sought after. Rather than trying to guess what people wanted out of a mountain biking game, it made more sense to, you know, ask people!
How Do You Start a Video Game Community?
The biggest question for me was: What makes someone want to join a community? Why would someone choose to join my Discord server? What could I possibly offer that would make sense for them to not only join, but then also stick around?
The answer, it turned out, was kinda simple:
- People want free stuff
- People want exclusive stuff
- People want to feel like they’re part of something
Here’s how I aimed to fulfill these desires:
- Give everyone who joined our Discord server free access to the Descenders beta
- Post exclusive Descenders stuff regularly for Discord members
- Create an entire meta-game within the Discord server
The first two points are fairly self-explanatory. Everyone who wanted to try the game earlier had to join our Discord and throw some simple details into a Google form. Once they had, we’d give them exclusive screenshots, updates, livestreams, GIFs, videos, etc. Everything they could possibly want from the game.
The meta-game aspect excited me the most. What sort of game could I build within Discord that would not only make people want to stick around but also bring them together as a community?
The Meta-Game Begins
In Descenders, you pick one of three teams to join. Team Enemy are all about slick stunts while Team Arboreal focus on off-road action. Meanwhile, Team Kinetic are the game’s speed demons. Once you pick your team, you’re given exclusive missions, gear, and colors based on that team.
Using Dyno, the popular Discord bot, I created a series of custom commands that would introduce each newcomer to our server into the meta-game. When you initially join the server, your username is white and you’re only granted access to a small number of channels.
When you visit the #pick-a-side channel, it asks you to type either !enemy, !arboreal or !kinetic to pick a team. Once you choose, the #pick-a-side channel disappears and the rest of the server is opened up — including channels that are exclusive to your team. Your name also becomes the same color as the team you picked.
The plan was then simple: Each week, we would pit these three teams against one other in a variety of challenges, ranging from custom kit design competitions to “which team can write the best Descenders haiku?”
When we announced Descenders last summer, the server was an immediate hit and we quickly built up a community of over 4000 members. The weekly challenges worked great and each team enjoyed politely trash talking each other in the #trash-talk channel we’d created.
There were even community members who stuck team stickers on their bike helmets and filmed themselves trashing the other teams.
We created custom emotes for each team and gave them exclusive prizes in their team channels when they won a weekly challenge. The meta-game worked out pretty damn well!
It Gets Even Beta
Soon afterwards, we ran the Descenders closed beta through Discord. We announced the beta date via an ARG that we distributed in the server. We expected our community to take a few days to decipher a riddle that we dropped into the server, as it involved pretty damn obscure solutions like looking through Google Maps images and playing RageSquid’s previous game — but they’d solved it two hours later which was kinda mind blowing.
Everyone in the server was sent a Steam beta key and for one weekend we let them all go wild. Thousands of people signed up and our Discord server was in a constant meltdown the entire time — the good kind.
The community posted thoughts, screenshots, GIFs, videos, fan art… we ended up putting together a supercut of some of the best beta footage.https://medium.com/media/3bfe38a9376c0ca3d7db9885a98859b4/href
We also ended up with tons of valuable feedback from the Discord community. We had a #bug-reporting channel, a channel for requesting features, a channel for players to show off their skills via videos and GIFs. It allowed us to connect directly with our players throughout the beta and get their immediate, honest feedback at all times.
As a thank you after the full launch, we gave everyone who was a part of the beta a special beta kit within the game to say thanks for taking part. It was the least we could do!
The benefits to having a Discord community for Descenders go on and on. Members of our community have created kits, banners and boards for the game, while giving us a variety of ideas that we have eventually followed up on and added to the game.
Furthermore, certain aspects of game development became a whole lot easier thanks to our server. For example, we asked which languages our community would like the game to be translated into. Within a few days, we’d found multiple members of our community who wanted to help translate the game, and after providing them with the English text via a Google Sheet, we had all the text in the game translated into a variety of languages, including French, Dutch, German, Spanish, Italian, Chinese, Russian… We’re so happy that these players will be able to enjoy the game in their native languages.
One of the biggest pros has been having a direct method for finding out exactly what players enjoy about the game and where we should be expanding the game. For example, within a week of the game launching, our Discord community was clamoring for a way to generate levels based on a specific seed.
We had no idea this would be such a popular request! It was actually relatively easy to add, so three weeks after launch, we added this feature as an entirely new mode and our community exploded all over again.
Speaking of launch, it’s worth stressing that all of these positives definitely carried over into the launch of the game. From the moment the game launched on February 9th, our Discord community started buying it in spades and we rocketed into the Top Sellers list within the space of 30 minutes.
The 10% launch discount didn’t activate for 25 minutes after we hit the live button, so we told our community to wait until it kicked in. Tons of them purposely ignored us and bought it full price just so that they could be the first to play. We love them all a bit too much.
It wasn’t just sales that came out of our community — there were plenty of other cool side-effects that we hadn’t considered. For example, our community piled positive ratings onto the Steam page, quickly leaving us with a 90% user rating that hasn’t gone away.
And whenever someone does leave a negative review or a bad comment on the Steam forums, someone from our community spots it immediately and tries to resolve the player’s problem. This has actually lead to multiple negative reviews being flipped into positive which, as you’d imagine, has been rather amazing for the game.
Our Discord has been a buzz of activity since the game launched last month, and it hasn’t showed any signs of slowing down. When someone new pops in to ask for help or simply to give their thoughts on the game, our members welcome them, suggest they pick a team, and then bring them into the fray. It’s a wonderful atmosphere for new players to be introduced to and we don’t have to lift a finger — our community does it all for us.
Our experience with building a Discord community for Descenders has been incredible and I now have plans to incorporate Discord into every game I publish.
In fact, No More Robots announced our second title today called Not Tonight, and the Discord server for Not Tonight is even more ridiculous, with tiered roles and “jobs” that members can do to earn higher accolades and special prizes.
Community has always been a great device to build a video game around and that is more true now than ever before. You should be thinking about how Discord is going to fit around your game launch — it’ll be one of the best things you do.
Thanks Mike for sharing all the cool ways Discord can be used to empower a game’s community. We’re super excited to see how his next server plays out!
For similar reading, check out How to Build an Active Indie Game Community With Discord by the developers of Tooth and Tail.
Looking for more ways to use Discord with your game? Verify your server so people know your server is legit. Furthermore, make your game standout with Rich Presence integration — let people join, spectate, and share your game in Discord.
How we used Discord to build a dream community for our game Descenders was originally published in Discord Blog on Medium, where people are continuing the conversation by highlighting and responding to this story.
Discord’s chat messages support both markdown and direct mentions of users, roles, channels, and various other entities. Detecting and rendering rich content in messages is a more complex challenge than it may appear on the surface.
This post will detail how our clients detect and render markdown and entity mentions in messages. In particular, the Discord Android app required a homegrown solution to maintain parity with the Desktop and iOS clients. As a result, we’ve open-sourced SimpleAST, our Android parsing and rendering solution. Read on to learn more about Discord’s approach to rich messages, and how we solve this challenge on Android!
simple-markdown to the rescue
One issue of particular interest is the case of entity mentions, i.e. direct references to users, roles, or channels. In these cases, we want messages to reflect name changes. For example, a message may mention me: @AndyG. If I decide to change my name to xXSSJ4AndyGXx, this old message should now render as @xXSSJ4AndyGXx instead.
To accomplish this, we avoid sending @AndyG as raw text in the message. Instead, we send <@123456789>, a reference to my user ID. This puts the burden on the receiving-end Discord clients to detect mentions in messages, and transform them back into the appropriate username when rendering the message.
In order to do so, our clients need a parsing + rendering system that that satisfies three major requirements:
- Extensibility: the system must detect basic markdown (like *italics* and **bold**) as well as artisanal strategies like the @User mention described above.
- Structure: the system should lend structure to the otherwise unstructured raw text. With structure, the messages can be inspected and post-processed as we see fit.
- Performance: gotta go fast.
The simple-markdown process looks like this:
- Clients define a list of rules which define the various formatting and entities (like an @User mention) that can appear in text. This meets our extensibility requirement.
- The simple-markdown parser uses that list of rules to transform raw text into an Abstract Syntax Tree (AST). This meets our structure requirement.
- The generated AST is then passed into a renderer,where it is transformedinto some format that the client can display and interact with.
By adding our own rules, we can support various types of rich content in messages:
Do Androids Dream of Feature Parity?
simple-markdown worked great for the Discord desktop and iOS clients, but left our Android app out in the cold, since our Android app is built natively, not React Native (as discussed in a previous blog post). Without a parser of our own, we could still easily replace entities like @User mentions with a find/replace to detect <@123456789> occurrences when rendering the message.In fact, the Android app functioned like this for some time in 2016. Certain problems proved extremely difficult to solve, however:
- With our naive regexes on Android, there were many rendering inconsistencies between the Android app and our other clients. For example, formatting (like **bold**)worked inside of **code blocks** — it shouldn’t.
- We were not able to directly port the parser rules from the Desktop client. Any time Discord added a new rule, we had to worry about introducing weird edge-cases on Android, or at least losing parity.
- Discord’s desktop search feature allows for structured query parameters like from: AndyG#0001 (among others). We were about to implement search on Android and we knew that leaning on a robust parser would make it easier to detect and use such structured parameters.
The writing was on the wall: if we were going to maintain parity without excessive engineering effort, we were going to need our own version of simple-markdown that ran on the JVM to power our Android app.
The One Where Chandler Explains Parsing
Remember that the system we wanted would need to do two things:
- Parse raw text into an Abstract Syntax Tree
- Render that AST as text on Android
We’ll focus on parsing for now. Remember the three components that constitute the parse step:
- Node : a node in an AST which can have children. This defines how we represent an AST in code
- Rule : a rule which defines what types of nodes are generated by what types of text
- Parser : using a list of rules, takes raw text and turns it into a collection of nodes
For the code-inclined, an example Rule looked like this:https://medium.com/media/24dae6723e310b55c87172f07b94e4d8/href
Note that theParser processes the input left-to-right as rules are matched. To support that, a Pattern that defines a Rule MUST only match with text at the BEGINNING of the source. This is why we include the ^ character at the beginning of all of our Rule patterns!
This was our initial Parser implementation:https://medium.com/media/257aebdc2279ae202d25a88354ea19be/href
Hello StackOverflowException, My Old Friend
Our Rule interface required each Rule to return a Node with all its children already parsed and populated. To accomplish this, many Rule instances were calling parser.parse() on the text they were inspecting. This algorithm was simple to understand, but meant we could recurse arbitrarily deeply if we nested formatting. In other words, nest enough formatting in a message, and you could trivially crash the app by causing a stack overflow!
We needed Rule instances to contribute their information to the AST without recursively parsing their content. We solved this by having each Rule return only a single top-level Node. If it was a non-terminal Node (like a bold or italics node), it would also specify start and end indices that inform the Parser what slice of the original input needs to be parsed to supply that node’s children. In other words, our rules now return both a Node and a potential “deferred parse” specified in a ParseSpec class:https://medium.com/media/ab5c42022f6191b6d9d0d19ccbead810/href
This allows us to change our parse strategy to use an explicit 🥞 stack 🥞 that tracks what parsing still needs to be done. The stack typically does not grow larger than a few elements in practice, as new ParseSpec instances are used immediately. For implementation details, see the source code here.
The app functioned with this parser for a very long time. We still noticed a little chug on older phones (which represent a significant portion of our user base), but it wasn’t immediately obvious where any performance improvements could be squeezed out of the parser.
We used the Android Profiler (introduced last year in Android Studio 3.0), which provides a flame chart that aggregates method calls into a readable form that makes it easier to see where you are spending your computational time. We noticed that a lot of time was spent in the method Pattern.matcher(), which creates a new Matcher instance:
It appeared that most of our time during a parse was actually spent inside of Matcher.<init>, in particular in Matcher.usePattern, with some time in Matcher.reset. It was strange to spend a lot of time here — why were we creating so many Matcher instances? We looked around for initialization points of Matcher, and the culprit lay in this line of theParser:
// Create a new Matcher instance for the source being inspected
val matcher = rule.pattern.matcher(mutableSource)
Instantiating a Matcher every time we want to use a rule to inspect the text was expensive and, as it turns out, unnecessary:Matcher has a method that is specifically designed to allow a single instance to be reused multiple times on different sources.
Up until this point, we had bundled Pattern instances inside our Rule objects. Thanks to the Android Profiler, we identified this issue and began bundling prebuiltMatcher instances instead:
// Use the existing Matcher, just point it at the new source
val matcher = rule.matcher.reset(mutableSource)
Using this strategy, we were able to see as much as a 2.4x speedup on certain real-world messages, depending on the complexity of the parse parsing needed to be done.
Warning: If Rule (and by extension, Parser) instances are shared across threads, multiple threads could reset the same Matcher to different source texts. Therefore, usages of a given Rule or Parser instance should be confined to a single thread.
Will it rend?
We’ve got an AST now with nodes that represent various pieces of text, styles, and other entities like user mentions, emojis, etc.
Rendering is a simple process compared to parsing. Android has a mechanism for building text with various styles: a SpannableStringBuilder. We create a SpannableStringBuilder and pass it to each node; they operate on the builder in turn. To facilitate this, a Node<T> in SimpleAST has the following method:
fun render(builder: SpannableStringBuilder, renderContext: T)
- In simple cases, nodes may simply append text to the builder, apply styles to the text in the builder, or make the text clickable or otherwise interactable.
- In more complex cases, nodes may specify a type T that provides information that they need in order to render themselves, ie.e. their renderContext. This could be something as simple as and Android Context so that the node can resolve resources, or it could be a data structure that, for example, facilitates the node looking up usernames for a given user ID.
Marching Ever Onward To Tomorrow
SimpleAST currently powers the Android app’s message rendering, and we’re happy with its performance, robustness, and extensibility. It also lends us the power to keep up with the fast-changing requirements of Discord as a product, since porting parser rules to Android is such a breeze.
That said, there are some opportunities we see with both SimpleAST and its use in our app going forward:
- Parse off the UI thread: We parse and render each message on the UI thread on-demand as the message rendered on the screen. This means that during fast scrolls, there can be a noticeable frame drop, especially on low-end devices. Instead, we could parse the messages at an earlier stage in the pipeline, on a thread pool dedicated to parsing these messages. The upside isthat this would make the scrolling experience butter-smooth on all devices. However, if implemented naively,it could manifest as a longer load-time for batch messages loading. Intelligently implementing message parsing off the UI thread is one of the most exciting opportunities for performance improvements in the Android app today.
- Further SimpleAST performance improvements: We will continue to push more performance out of the SimpleAST library, with a helping hand from the Android Profiler.
We’re always looking for the next great addition to our engineering teams at Discord. If the problems described here sound interesting to you, and especially if you are a gamer at heart, check out our available positions here.
If you would like to use or contribute to SimpleAST, check out the open source project here.
How Discord Renders Rich Messages on the Android App was originally published in Discord Blog on Medium, where people are continuing the conversation by highlighting and responding to this story.
As engineers ourselves, we deeply respect and value the open source software community. Discord is built out of hundreds of projects. To our surprise, many open source communities have adopted Discord for their own discussions. Today we are launching a site highlighting the open source communities who live on Discord.
When Reactiflux came to us years ago saying they were being kicked off Slack due to scaling reasons, we were skeptical that non-gaming communities could thrive on Discord. We were wrong: Reactiflux has grown to over 13,000 users, with 2,000–3,000 active at any one time, more than most other chat app communities.
And they are not the only ones: we have also seen Vue.js, ReasonML, Elixir, and Yarn become vibrant and communicative groups on Discord. They have tried using other chat apps, but have run into the limits of those platforms.
It turns out that not only is Discord easy to use, but many open source developers already have Discord accounts because they play games. One Discord account gets you access to every open source community, so the invite link is all people need to begin participating. Discord also has robust moderation and blocking tools which serve open source projects well. We also support webhooks from GitHub as well as Slack.
Discord has features that both gamers and developers value:
- Core features are free forever
- Infinite message history
- Unlimited members
- Unlimited search
- Familiarity of Discord (100m+ people use it)
- Syntax highlighting
- Tool integrations
- Voice and video chat
- Screen sharing
- Moderation, roles, and permissions
- Private ad-hoc groups
We hope you’ll give Discord a shot for your open source community! Let us know if you have any feedback on our twitter @discordapp. You can add your own group to the open source list by making a PR.
Want to help build Discord? We’re hiring!
Why Reactiflux, Vue Land, Yarn, and other open source communities use Discord was originally published in Discord Blog on Medium, where people are continuing the conversation by highlighting and responding to this story.
It’s Thyme Four Updates
- Weave added a spell checker two Discord sew you can no when you’ve spelt things wrong.
- You can now turn off the spell checker because we know you were going to ask anyway.
- Backup SMS Authentication now available for two-factor authentication. We heard you like backups, so we built some backups for your backups. Set it up on your account settings screen.
- Play video files directly in Discord instead of not Discord. Audio soon! This feature was requested by you guys!
- GIFs will now autoplay when Discord is focused so you can watch a car launch into space without hovering over it with your mouse. 2018, man.
- You can now turn off GIF autoplay because you’re so freaking predictable. Mix up your game ;).
- Uploads can now be cancelled in case you didn’t mean to send that fan art to your mom.
- Added the Verified Server icon to Android and iOS because it should be there.
- Overlay should no longer cause lockups or issues on League of Legends or Overwatch.
The Second Section
- Love Discord? Support us with Discord Nitro and get some benefits for your account.
- Send help. And by that, I mean send yourself. And by that, I mean we’re hiring.
CAN YOU SPOT THE CHANGES
- Spotify is now available on Discord. See and play what other people are listening to. Spotify Premium members can listen along with their friends. Also, more! Check out our help article to get started.
- Increased voice server capacity in Hong Kong and Singapore! More reliability than a mid-sized SUV.
- Added an Oxford comma when 3 users are typing, cuz good grammer and sintacks is importint!!
- Server owners now get a super cool icon in the members list. Your ego needs this. Will not show in servers with obvious admin roles.
- @mentioning in large servers is now super smooth like grass-fed full-fat butter.
JUST SOME ELBOW GREASE
- Friends list is now smoother if you have a lot of friends. Buffs for the cool kids.
- Large servers should be much more performant. The never ending quest to make the Fortnite server work better.
- After giving mic access, browser Discord will not turn on your mic automatically.
- Fixed a bug where Discord would crash if you clicked the download update button too fast like a Mario Party mini game.
- Fixed a pesky bug that broke Discord sometimes when you tried uploading a file, then changed your mind and canceled. Discord didn’t like that. Discord likes commitment.
I DON’T KNOW WHAT TO CALL THIS
- Love Discord? Support us with Discord Nitro and get some benefits for your account.
- We’re now accepting music artists and record labels into our server verification program. If you look in the mirror and say to yourself “I am one or both of those things!” then check it out!
- Are you involved with a gaming club at your university? Ask your club president or supreme leader to apply as an Event Coordinator in the HypeSquad and we’ll hook your club up with a box of awesome!
- Send help. And by that, I mean send yourself. And by that, I mean we’re hiring.