
How Figma's Multiplayer Technology Works - Aqua_Geek
https://www.figma.com/blog/how-figmas-multiplayer-technology-works/
======
roldie
I appreciate the technical achievement of "multiplayer," and it does work
impressively well.

However, no one one my design team likes it. I certainly don't. It's akin to
having someone breathing over your shoulder as you're trying to work. And with
design, especially, I tend to create a bunch of nonsense and "bad" designs
before getting anywhere near a level worthy of sharing or even a team
critique. Even if I don't care what others think of me or my skills, it's very
disruptive to the creative process to know that someone is watching you.

In my experience, at least, there do not seem to be very many use cases for
"multiplayer." I mean, even using Google Docs at the same time as someone else
is jarring and disruptive in most cases.

Perhaps the only use case where we've actually liked having it is for a
critique (especially when a teammate is remote) or a demo.

Personal preference aside, I think Figma is great. I still miss some things
from Sketch, but overall Figma is a great tool. My team recently
transitioned/is still transitioning from Sketch to Figma, and I can imagine
that many other design teams will be making the same move too.

~~~
virgilp
> My team recently transitioned/is still transitioning from Sketch to Figma,
> and I can imagine that many other design teams will be making the same move
> too.

I'm curious why. I would've thought that the main advantage of Figma is the
"online collaboration" aspect, but if you don't like that part, what is it
that makes Figma better than Sketch?

~~~
pjmlp
I can use it from Windows.

~~~
virgilp
In that case, why switch from Sketch to Figma and not to, say, XD? I feel like
"multi-platform" was not _the_ reason people like Figma better than Sketch
(maybe it's part of it, but not all).

~~~
pjmlp
I am all for XD, just stating a valuable reason in mixed enviroment offices.

------
ggambetta
Sounds weird to use "multiplayer" when there are no players involved, but
users. On the other hand, I guess "multiuser" doesn't convey the real-time-
ness they want to convey.

FWIW, here's how it's done for actual multiplayer games, especially the ones
where latency is critical: [https://gabrielgambetta.com/client-server-game-
architecture....](https://gabrielgambetta.com/client-server-game-
architecture.html) Arguably, their software is more similar to a turn-based
game, and formal correctness of the results is more desirable than "a smooth
experience", as is the case for multiplayer games.

~~~
coreyward
Figma's case is more challenging in some ways, too, though. In multiplayer
games, like the one described on your website, you rarely have multiple actors
independently manipulating the same object, there's a moderate tolerance for
imperfect resolution of conflicts, and the server can reject messages that are
more than a few seconds out of sync with the server state.

Figma needs to have very consistent, predictable resolution in order for users
to trust it with business-critical documents, and it needs to allow users to
operate offline for arbitrarily long periods without throwing their work away
when they reconnect. This has to happen across multiple versions of the
software, and across documents (e.g. when dependency libraries are
republished).

~~~
ggambetta
Yep, I agree the use case is somewhat different - I wrote as much after the
link. Probably why calling this "multiplayer" sounds weird.

------
gatherhunterer
I think “real-time collaboration” or “multi-user” would have been better
choices than “multiplayer”. I was hesitant to criticize the term at first
because it is so ill-fitting that I was unsure I understood what feature they
were talking about.

It’s interesting to see this on HN at the same time as the GNU article about
“Service as as Software Substitute”. I would have much more piece of mind that
my personal or proprietary information is secure if I didn’t have to trust
Figma. A peer-to-peer collaboration platform that I can run locally would be
innovative and exciting.

------
tibbon
I was trying recently to prototype a multiplayer experience, and got pretty
stalled when it came around to the networking side. My goal wasn't to make it
fast/scalable, but rather just to be able to have 4 people sit at my kitchen
table and answer "is this game idea interesting/fun". But the resolution of
movements, timing things, client/server stuff was actually a pretty steep
cliff for someone who had never done it before. There's also a lot of
interesting decisions to make upfront then about rendering, real-timeness, how
you'll split up movement collisions, etc.

Regardless of if this is for a "Game" or not, I find reading more about these
things quite interesting.

~~~
NoodleIncident
I don't know the full context besides what you've typed here, but for 4 people
in the same kitchen evaluating a prototype, it seems like it would be a lot
easier to pair up 4 controllers to the same computer.

~~~
seventhtiger
Common advice your hear from gamedevs is to never start a networked game as a
local game then "add the networking later". It's too fundamental and will
require a rewrite.

------
bhouston
Great write-up! Thanks for taking the time to do this.

This is incredibly similar to the way we did multi-user simultaneous editing
in [https://Clara.io](https://Clara.io) back in 2013/2014\. It was also a
tree-based OT-like system, but there was a few differences.

I also wonder if you guys studied how we did it...

~~~
sfobiab
I worked at Salesforce then and we had this from an acquired company:
[https://web.archive.org/web/20140625063431/https://goinstant...](https://web.archive.org/web/20140625063431/https://goinstant.com/)

A lot of folks were using it to add "Multiplayer" to our apps.

------
cryptica
I think the approach of mutating each property independently is an excellent
approach and I'm glad to see it working at scale. It's just like regular CRUD
except that instead of mutating the whole resource, you just mutate one
property at a time - And if two users edit the same atomic property at the
exact same time, it doesn't really matter who's edit arrives last because
there is no absolute right answer so long as both users can observe the same
outcome.

I also did some work in that area several years ago which I refined over time
into a sample app and a set of libraries:
[https://github.com/SocketCluster/ag-crud-sample#ag-crud-
samp...](https://github.com/SocketCluster/ag-crud-sample#ag-crud-sample)

------
preommr
> When we first started building multiplayer functionality in Figma four years
> ago, we decided to develop our own solution. No other design tool offered
> this feature,

I could've sworn I've seen people on HN say there were tools that did real-
time collaborative design before figma.

~~~
pat87
Name one?

~~~
dwwoelfel
Precursor, a prototyping tool I worked on, had "multiplayer" mode way before
figma [https://precursorapp.com/](https://precursorapp.com/)

I'm certain they were aware of it. We had a signup from a Figma domain in 2015
and I emailed them about Precursor in 2016 before they had implemented
multiplayer.

------
littlestymaar
> As a startup we value the ability to ship features quickly, and OTs were
> unnecessarily complex for our problem space. So we built a custom
> multiplayer system that's simpler and easier to implement.

That sounds like a bad reason to implement you own mechanism. There are many
valid reasons to design your own system (your requirements being different is
the most common one), but “the state of the art is too complex” sounds like a
good way to reinvent all the solutions to the technical problems the state of
the art faced and end up with an equally complex solution in the end.

This isn't to dismiss the work exposed here, and the really pleasant write-up,
though.

------
miki123211
Unrelated, but repl.it wants to do the same thing for code. It's an on line
IDE, something like Cloud9, that lets you click, write a program in almost any
language and run it on their servers. You can collaborate with others, where
you all see the same terminal etc. This seems amazing for learning and small
remote groups who want to code together. Repl.it is already becoming a place
where bright kids learn to code and produce some pretty impressive things.

~~~
lucasverra
same as glitch.com (heavy on JS thought)

------
timwaagh
I do not know how usable Multiplayer is. I sometimes had that if i had one
browser window open and opened another that i had two sessions in Figma, which
was slightly annoying. But for me the dealbreaker with Figma as a tool is it
sometimes has issues with exporting content to png. Meaning I had to import it
in GIMP before re-exporting it. The idea is really neat, but it needs some
work before I can really recommend it over more traditional tools.

------
Bombthecat
My wife just started learning ui/ux. I think the realtime aspect could help
with tutoring.

------
thallavajhula
Is there anything currently being researched around Multiplayer tech with
better efficiency than CRDTs or OT? It seems like almost all of such
implementations currently just implement CRDTs or OT.

~~~
josephg
Better efficiency? What sort of efficiency are you seeking? I’ve built the
core of a text OT system in C which can handle about 5M concurrent edits on a
single machine. (Not counting network overhead.) I don’t think the upper bound
on performance is the algorithms themselves.

------
miguelmota
Anyone know what program was used to create the animated diagrams?

~~~
Scarbutt
figma?

------
baxtr
Figma is the one web app that always forces my safari down to its knees...
even though I have a strong processor and lots of memory.

~~~
JDiculous
Well you're using Safari, don't expect the best performance.

------
marknadal
CRDTs are absolutely critical, if you don't know about them, read this article
& then research them!

If you're wanting to use CRDT tools, I recommend two:

\-
[https://github.com/automerge/automerge](https://github.com/automerge/automerge)
(immutable)

\- [https://github.com/amark/gun](https://github.com/amark/gun) (mutable)

~~~
jameslk
Not sure why you're being downvoted but thanks for the links

~~~
blunt_asshole
He's getting downvoted for excessive self promotion often without a
disclaimer. If you look at his comment history, he's non-stop spamming his own
product, gun.js. If you search for gun.js, almost all mentions are made by
him:
[https://hn.algolia.com/?dateRange=all&page=0&prefix=false&qu...](https://hn.algolia.com/?dateRange=all&page=0&prefix=false&query=https%3A%2F%2Fgithub.com%2Famark%2Fgun&sort=byDate&type=comment)

There's only a small handful of HNers who upvote OT/CRDT/sync/realtime
database submissions. So by now everyone is tired of seeing him promote gun.js
again and again without contributing any other relevant technical insights.

Which is a goddamn shame. There aren't that many others who have first hand
experience implementing these systems successfully. The other regulars who
always appear in these threads get upvoted to high heavens even if they aren't
saying much because we value these first hand accounts so much (josephg for
share.js, raphlinus for xi editor's crdt, etc). But unfortunately after seeing
gun.js hundreds of times I still have no idea how it works and his code is
completely unreadable.

I don't think he realizes that if he had just explained _why_ gun.js is
amazing in a relevant way, _others_ would help promote gun.js for him.

@MarkNadal Sorry if this was too mean

~~~
olah_1
>So by now everyone is tired of seeing him promote gun.js again and again
without contributing any other relevant technical insights.

I don't understand this perspective. Every single time Mark comments, he
offers technical insights that are relevant to his experience with gun and
distributed tech in general.

I mean look at this comment that you're bitching about. It's not just
shameless promotion. It's on-topic and relevant to this discussion...

It should be noted that he's not "selling" gun, either. It's a completely free
and open library.

------
bravoetch
The article starts without introducing what figma is. I read for a while
before discovering this is something like Google docs... Multiplayer work-sim
maybe?

------
tw1010
Figma feels like the height of over-engineered backends with corresponding
low-innovation frontends.

~~~
serpix
Figma is a marvel of software engineering. Have you used the competition? Have
you used Figma?

