Show HN: Easel – Code multiplayer games like singleplayer
39 comments
·May 14, 2025asadm
Pretty cool work, kudos!
This was exactly the premise behind the multiplayer SDK I made[1] but I moved to a middle ground (after feedback from devs) so to support existing languages and game engines single player game devs are familiar with but still easier than many other options out there.
We have now scaled it to many millions of players and it has proved worthy!
BSTRhino
Wow, playroom looks awesome! It is great that it lets people integrate with all the existing libraries like ThreeJS for example. Glad to hear it has found its audience!
_--__--__
I'm curious how your engine decides to trigger rollbacks without explicit knowledge of which parts of the game state each input can actually affect. Naively rolling back on every missed input can and will be abused - in early versions of Street Fighter V players found out that while being comboed you could churn out inputs as fast as possible to cause rollbacks for your opponent, even though none of those inputs could actually do anything (this was made worse by other issues with that game's inability to keep opponent game clocks synced and constant one-sided rollbacks).
BSTRhino
Yes, it's true Easel does rollback on every input. I may be able to improve this. One great thing about controlling the programming language is there are a lot more places I can hook into for things like this. For example, Easel does detect at compile time which types inputs are used somewhere in the codebase and only sends those across the network.
Easel constantly synchronises the clocks (there's an interesting algorithm for this which I will write up at some point). It also adaptively assigns two different kinds of delay to every client - command delay and display delay. Command delay is related to how much lag you are introducing into the game. Basically people take on their own lag. It can be different amounts for different people in the game. The display delay is where the rollback netcode kicks in. It keeps track of how much rollback your computer can handle imperceptibly. If your computer can't handle it, then you won't get as much rollback (and will just experience more input latency). But in either case, whatever number it picks, it should be smooth.
dustbunny
Theres some missing information here. A "rollback that doesn't do anything" shouldn't be noticeable to the user. It would only be noticeable if the game simulation can't keep up with the # of frames it's being asked to simulate. And in street fighter, the simulation is ridiculously simple. There should be no reason why street fighter wouldn't be able to "rollback and resimulate" dozens if not hundreds of times per frame. There's no way that game is CPU bound... Am I missing something?
_--__--__
I think you are underestimating the per frame computation cost or massively overestimating the base model PS4. Remember that all fighting games have to lock 60fps, 16ms is not a ton of time for the handoff from input interpreter (SF has to parse backwards over the past several frames to see if a forward input is completing a quarter circle, double quarter circle, dash, etc) > game state update tick > graphical and sfx update pipeline. The issue with clock syncing meant that the worse your machine was, the more your opponent would roll back and the bigger the rollback windows would be because every single frame of your inputs would come late.
Here's an example of the constant one sided rollback: https://www.youtube.com/watch?v=aSB_JlJK_Ks
and an example of how players were aware that mashing caused frequent rollbacks: https://youtu.be/_jpg-ZiE70c?t=105
Eventually PC players learned that they could "fix" this by alt-tabbing out of the game, taking away dedicated GPU processing so they could be the peer that was falling behind.
BSTRhino
I can't really speak for Street Fighter V, but I can say that Easel would assign command delay to the person who is introducing it. So if a person is somehow forcing their inputs to arrive later than they should, they would be assigned more input latency so that the other players would be unaffected. Easel also has a lag spike protection system where the server will just forcibly reschedule inputs if they arrive really late for some reason.
oakwhiz
I wonder if SAT solvers could prove the maximum "reach" of inputs into the state...
vinibrito
How do you abstract away the multi tenancy for your developer/user? As in different rooms or instances. Or similar. I'm asking because I'm building a visual development tool for web apps, and all such abstractions, as in computer powers to non developers, are interesting for me to see how they are done.
BSTRhino
Yes, all the Easel games are sharing infrastructure, which is much more cost-effective for all of us. In general it's not really something that really affects players or developers.
When a game developer chooses to publish their game, they choose either a subdomain (e.g. https://pewpew.easel.games) or a subpath (https://easel.games/@alzarath/snake). It just takes one click and then they have a URL to share with other people.
When players request to join a multiplayer game, they are matched to other players who are playing the same game, who are close to them geographically, and who are wanting to play the same game mode with the same parameters. A single game may have many lobbies running at once.
To the server, all inputs have the same format, regardless of game, so it's really efficient and just churning through relaying the inputs from one player to another. Because determinism is guaranteed for Easel, the server does not actually do any simulation at all, it just relays inputs, so I don't currently have to manage issues with one "noisy" tenant overwhelming the server and degrading the experience for others.
Not really sure if any of this answers your question!
oakwhiz
How do you handle hidden information, or "need to know"/"potentially visible set" style revelations to player clients?
BSTRhino
Unfortunately, this is not compatible with the rollback netcode model. However, all the world state is stored in WASM linear memory and so it is not the most straightforward to decode.
The rollback netcode model is necessary to make the multiplayer invisible to the developer. The other client-server/state-synchronization approach which is used in other multiplayer games, while great in many ways, requires you to assign authorities to every entity and to send a remote procedure call when attempting to affect entities you do not control. Rollback netcode was the only way for me to achieve the primary mission.
I may look into supporting the client-server/state-synchronization multiplayer model in the future though, which would enable "need to know" style revelations. Given we already have a deterministic programming language it is not at all infeasible as a future project.
From my experience running a multiplayer game, I only had 1 in every 50000 players attempt to perform some kind of hack and it was faster and more reliable for me to shadow IP ban the players. That feature is built into Easel. There is also a replays system built-in which makes it easy for people to submit evidence of people hacking. This is the current pragmatic solution that I suggest.
dustbunny
> requires you to assign authorities to every entity and to send a remote procedure call when attempting to affect entities you do not control.
You can consider every object to be server authoritative and then only send inputs from the client to the server. Other clients don't need to know about other client inputs. They only need to see state changes from the server. Clients functionally only have authority over their own input. This is a simple model of state synchronization that doesn't have the extra complexity of having authority over random objects. In this model, you only do a rollback if the server state differs from your predicted representation of the state. Besides, your game tick should be fast enough that you can rollback and resimulate every frame multiple times anyways.
DigiEggz
I exclusively make games that include online multiplayer, so this really caught my eye. Really looking forward to digging in.
BSTRhino
Woohoo! I'm excited for you to dig in!
georgeecollins
This is cool, but its hard to make a game engine full featured enough to be worth developing for. Have you thought about making this an addon for another engine like Godot or Bevy? Godot in particular is a nice engine to develop on, but the multiplayer support could be improved.
BSTRhino
You are right. I am insane. I've had many existential crises about this exact issue over the past 3 years.
I just had a very very particular idea of what I wanted to do and nothing else would do. Making automatic multiplayer was only half my mission. The other half was creating the perfect first programming language. (I talked about this in another comment: https://news.ycombinator.com/item?id=44001047 )
I would love for Easel to inspire other game engines about how multiplayer could or should be done. But I just can't personally do this any other way. It's like, sometimes I don't know if I chose this project or it chose me.
rishflab
Speaking of async coroutines, my belief is that they don't get used enough in other game engines because their lifetimes are not tied to anything - you have this danger where they can outlive their entities and crash your game.
Async coroutines in the way you are describing have terrible/unpredictable cache/memory access behaviour which leads to bad performance. Every time you switch coroutines you need load memory from (most likely) an unrelated region causing slowdowns.
BSTRhino
Yes, I do get this. I made choices to prioritise an abstraction that, in my opinion, makes you more productive. It's not going to work for certain kinds of people or games.
One of my original motivations for creating Easel came from my experience playing (and making) webgames, which in general are coded in JavaScript (or TypeScript). I love webgames as a method of delivering multiplayer because the biggest problem is getting players, and I think the low-friction zero-download really helps with that. So this is the world I am trying to target. When I remade my old webgame in Easel, I found it to be many times more performant and am now able to target much lower spec devices. Not to mention, determinism is a non-issue now.
I get that some people are going to love Easel and some are going to hate it, and that's okay.
pfg_
WASM-4 has a simiar multiplayer model. There's some things you still have to be careful with, like delaying screen transitions so you don't have a "you win" screen flash for a few frames when the other player didn't lose but their input hasn't gotten t o you yet.
reitzensteinm
Yes. I've made a dozen games using rollback and it really is magical. I built a strategy game in three weeks and didn't test it in multiplayer until the weekend of release. It Just Worked.
But it's not a total silver bullet from a UX perspective when rollbacks happen.
Showing a player dying and then come back to life and actually you're dead will absolutely happen. It's very weird if they were ragdolling.
If players don't have high inertia, like a platformer, they'll teleport around the place as you get the information that actually they aren't falling they jumped 100ms ago.
This is all fixable, but requires first class confirmation (i.e has the player you shot been dead longer than the max rollback window), and hand tuned interpolation on critical entities.
Luckily, I'm sure it's possible to add them to this engine.
I'm curious as to why a custom programming language was designed if the system uses WASM anyway - which you can make deterministic.
I wrote my system in C# and it worked great if you Followed The Rules (eg you must use immutable data structures). But WASM would have been a big step up.
BSTRhino
Great to meet another rollback fan! It sounds like you have had a lot of experience with it. I'm sure I can add those things which you have mentioned - that's why we're in the beta testing phase to figure out things like this!
Why did I make a custom programming language? Well, making multiplayer automatic was only half of my mission when creating Easel.
It's a bit of a long story but the modding tools for my previous game were surprisingly successful. It became the first experience of any form of coding for a lot of people. The tool used JSON, which might sound primitive, but actually if you look past the JSON what it was really doing was defining a hierarchical declarative language for behaviour. There's something magic about that shape which allowed first-time coders to tinker without much help or documentation. (I have many theories as to why, one of them is that the hierarchy eliminates a lot of indirection that you might see in normal game programming, which means you can just kind of look at it and figure it out without jumping around. Everything is direct and in-place.)
The thing that irked me for years was, the limitations of that modding language limited not just what could be made, but what people could learn. I kept wondering what would happen if people were presented with a programming language in the same shape, but with unlimited power. Could it lay down a path for non-coders to follow all the way until they became expert coders, almost accidentally? Easel is my attempt to marry that magical hierarchical-declarative style with imperative programming in order to make a powerful language that still is extremely accessible.
I hope that, the accessibility and power of the programming language, combined with its ability to make multiplayer games automatically, will make it a super engaging choice for a first programming language for many people. I would love to see it used in schools to teach programming.
reitzensteinm
That makes sense to me!
Experienced developers are probably better off targeting WASM with Rust, but an easy on ramp to programming is definitely something that can justify a new language.
BSTRhino
WASM-4 is great, I remember hearing about it when it was released. It is a similar model where it makes the multiplayer basically invisible to the programmer, which is cool :)
traverseda
If I created a game in this, what gurantee do I have that someone will be able to play this game in 100 years?
actionfromafar
I think a chess board is more what you are looking for. :)
But seriously, it wouldn't hurt to have some kind of escrow service for products like this.
BSTRhino
Yes, I think it is super important that Easel games last forever and that has always been the plan. My long term plan is to create a standalone version of Easel that you can run on your server forever, regardless of what happens to Easel itself.
I'm not yet sure of the details of how an escrow service might work, but honestly, I would be willing to look into it, that could be a good answer. I really do plan on Easel as a platform lasting forever. This is my life's work as much as it is yours.
TechDebtDevin
I believe Github has tools built for leaving a successor in the event of the developers death thats relatively straight forwars.
traverseda
Consider just releasing it under a BSL license forbidding commercial hosting? If that works with your business model.
traverseda
No, like 90% of video games could in theory be played 100 years from now.
If you can't answer that question, why should I trust your for 3 years? Or 10?
Here's a list of lost video games. Hard to prove it's complete of course. https://lostmediawiki.com/Category:Lost_video_games
ChadNauseam
FYI, the person you're replying to is not OP. Their answer is here: https://news.ycombinator.com/item?id=44000198
cmdrk
How does this compare to something like BYOND? I realize it’s dated now but conceptually there are some similarities.
BSTRhino
I hadn't heard of BYOND until just then. Sadly its website seems to be down, I would like to learn more about it.
traverseda
Space station 13 was the big game for it.
actionfromafar
This is all very impressive and combines ideas I tinkered with in C on and off for years, into a cohesive product. Very impressive.
BSTRhino
Oh thank you!
null
For the past 3 years, I've been creating a new 2D game programming language where the multiplayer is completely automatic. The idea is that someone who doesn't even know what a "remote procedure call" is can make a multiplayer game by just setting `maxHumanPlayers=5` and it "just works". The trick is the whole game simulation, including all the concurrent threads, can be executed deterministically and snapshotted for rollback netcode.
Normally when coding multiplayer you have to worry about following "the rules of multiplayer" like avoiding non-determinism, or not modifying entities your client has no authority over, but all that is just way too hard for someone who just wants to get straight into making games. So my idea was that if we put multiplayer into the fabric of the programming language, below all of your code, we can make the entire language multiplayer-safe. In Easel the entire world is hermetically sealed - there is nothing you can do to break multiplayer, which means it suits someone who just wants to make games and not learn all about networking. I've had people make multiplayer games on their first day of coding with Easel because you basically cannot go wrong.
There were so many other interesting things that went into this project. It's written in Rust and compiled to WebAssembly because I think that the zero-download nature of the web is a better way of getting many people together into multiplayer games. The networking is done by relaying peer-to-peer connections through Cloudflare Calls, which means Cloudflare collates the messages and reduces the bandwidth requirements for the clients so games can have more players.
I also took inspiration from my experience React when creating this language, here's how you would make a ship change color from green to red as it loses health:
`with Health { ImageSprite(@ship.svg, color=(Health / MaxHealth).BlendHue(#ff6600, #66ff00)) }`
There is a lot of hidden magic that makes the code snippet above work - it creates a async coroutine that loops each time Health sends a signal, and the ImageSprite has an implicit ID assigned by the compiler so it knows which one to update each time around the loop. All of this lets you work at a higher level of abstraction and, in my opinion, make code that is easier to understand.
Speaking of async coroutines, my belief is that they don't get used enough in other game engines because their lifetimes are not tied to anything - you have this danger where they can outlive their entities and crash your game. In Easel each async task lives and dies with its entity, which is why we call them behaviors. Clear lifetime semantics makes it safe to use async tasks everywhere in Easel, which is why Easel games often consist of thousands of concurrently-executing behaviors. In my opinion, this untangles your code and makes it easier to understand.
That's just the beginning, there is even more to talk about, it has been a long journey these past 3 years, but I will stop there for now! I hope that, even for those people who don't care about the multiplayer capabilities of Easel, they just find it an interesting proposal of how a next-generation game programming language could work.
The Editor runs in your web browser and is free to play around with, so I would love to see more people try out making some games! Click the "Try it out" button to open the Sample Project and see if you can change the code to achieve the suggested tasks listed in the README.