A game programming language that makes your game multiplayer automatically. This month I’ve been developing the tutorials so it’s easier to learn.
HN user
BSTRhino
Creating https://easel.games
haha this is cool :) What made you choose to code this as a webgame? In either case, good idea much easier to share
Very cool! What was the trickiest part of coding Sätteri?
Wow! Can you tell us a bit about what the past 8 years have looked like for you?
Oh, I never thought about this, that's cool!
Yes it's great, I've never forgotten this either. It's from Rich Hickey in his Simple Made Easy talk, all credit to him!
Hi HN!
I'm the creator of Easel, a game programming language with automatic multiplayer. I've been trying to figure out what to do with the feedback that people have been finding it difficult, and this has been my analysis and my response to the situation. Maybe some of you might find this interesting?
I once had a C# server with a TypeScript frontend (this was for work, so I didn't choose the tech stack). We had one part of the code which had a lot of calculations. We wrote the code in a C# library, then used Roslyn to analyse the C# code and generate TypeScript code that matched it identically. This way the client could visualise the results on the client with zero latency, no server roundtrip, but ultimately the server would be in charge of the final calculations. It was a great solution, I would do it again.
We could have potentially used Fusion for this had it existed, but I don't know if we would. We didn't have to support 12 different languages, only 2.
Still working on my programming language which makes your game multiplayer automatically. Currently working on improving the tutorials. When writing the tutorials I followed the "focus on the action" principle from Diataxis (https://diataxis.fr/tutorials/) perhaps too much. Easel is a unique language in a number of ways and it really does actually have to be taught, so I'm trying to make it do a better job of that.
https://easel,games
A reactive programming language for games! Properties signal when they change and you can register blocks that tell the engine how to use that property, not just once but every time it changes. It’s a more declarative way of making games which I think is lots more productive.
I’ve been working on this for four years, it’s been a big project!
Great write up!
That is helpful feedback, thank you, yes all things I can work on in the future! Thanks for taking the time to write this up.
I would LOVE to one day make a source-available standalone license for Easel that you can run on your own server! I just have a bunch of problems to solve to get there before it’s ready.
1. The people who really love Easel right now are teenagers who have mastered Scratch and are looking for more. Expert game devs who come from Unity or other programming languages find it’s missing some capability they really want and tend to get frustrated right now. I’ve been solving so many issues every month, like we got multiple cameras the other month for example, but there’s so much left. If I made a standalone version now, no one would buy it because it doesn’t yet do what they need, and if you did I would probably be refunding you quite soon. We might need another 6-12 months to be ready for experts. Sign up to the mailing list and we can keep you updated.
2. I would be willing to go as far as source available to licensees but there’s are some practical issues with fully open source. First, it makes it easier to cheat at all Easel games. Easel is client authoritative for certain things. Why? So I can keep the server costs within what I can actually afford because I am one person. Maybe once I can afford 30 servers we can make it all server authoritative and I won’t worry about this anymore. Second, I expect a net decrease in my productivity if I have to argue and defend my code, and become the BDFL to the open internet all the time in an open source environment. I’ve been really really productive just working by myself.
I would love to make a license where you could export and then you can run it forever yourself on your own server! It’s not because I don’t want to do these things, it’s just I’m one person and I never get the time to do everything I would like to do.
Wow, I’m amazed someone noticed this. I’d be interested to know more about your background and interests. How much have you been looking at programming language design vs just designing for complex systems in general?
I ask because yes, I have put in a great deal of time and effort into the programming language design, and to me, I think that is the greater achievement, more than the automatic multiplayer. But the benefits of automatic multiplayer are easy for the general population to understand and the improvements programming language design is hard to convey and so people don’t normally get it. The fact that you can see what I’ve been trying to do so quickly shows you must be coming from a place which has developed that discernment for you.
While there are many inspirations, like I love coding using React for example, my primary inspiration is the last game I made, I released all the modding tools along with them and lots of non-coders loved it. The modding was JSON, which might sound primitive, but it was actually a hierarchical declarative domain specific language and it seemed to really work for people intuitively.
Easel was born from me spending 2 years trying to make an imperative programming language in a similar shape as that declarative one. I wanted it to be just as easy, but infinitely more powerful. It took a lot of iteration to merge the declarative and imperative styles into one language. There is so much to it - lexical lifetimes and ownership, reactivity like you noticed, but also weaving in concurrency and asynchronous programming seamlessly took time as well.
I really wish this is more the part of Easel that would stand out and be talked about more because I think it’s the coolest part.
Okay, in that case you can upload a stub with a transclusion of the game. If there is enough demand I would definitely work on a standalone export system!
I’ve been working on this for four years. I’m trying to make this my full time job!
Yes, sounds like you get it, Giant Wall changed so it gets rolled back to point A, then it resimulates, which might mean Giant Wall might push some other things this time around that it didn't before during the predicted simulation. It kind of uses a transaction log copy-on-write kind of mechanism, so there will be a log entry for previous value of the Giant Wall slot and it will restore that into its old slot. It's a bit more advanced than that but that's the gist.
That is a cool idea! Could be a great application of rollback!
This physics engine is a deterministic physics engine. It has to be to make sure that when it rolls back and resimulates forward, it gets the same answer on all machines.
The determinism is partly possible because WebAssembly is deterministic (except for a few known cases https://github.com/WebAssembly/design/blob/main/Nondetermini...), and partly because I’m making sure to use my own trigonometric functions, and the entire game simulation is executed single threaded with a known order of execution.
If you meant to ask how does it compare to non deterministic physics engines, I’m sure they might be faster on the physics but would be slower on the rollback, and I think on most reasonably-sized games the slow rollback would dominate and so they would be slower overall. But, you wouldn’t make a rollback netcode game with that size of world anyway, at least maybe not until now, so it’s a bit of a false comparison. They’re good at their different use cases.
Actually, it doesn’t roll back the entire game state. Everything is stored in slot maps, and if there are 1000 slots and only 10 changed, it really does only rollback those 10 only and it does not touch anything else. Slot maps are great!
Ah yes, I have heard of this method but the idea of sorting/delta encoding is new to me and now I’m reconsidering!
Maybe some people might find it interesting - I’m relaying packets from peer-to-peer using Cloudflare Realtime, which is like a one-to-many broadcast system for WebRTC. Each peer sends their input packet to Cloudflare, then Cloudflare forwards that on to the 10 other players (for example). It’s cool because (a) 10x less upload bandwidth from the peer (b) people IP addresses are not revealed to their peers and (c) Cloudflare is in 400 datacenters around the world so it adds minimal latency. Cloudflare Realtime is a really cool system that maybe more web game developers should look into!
Unfortunately, I’m paying for all the bandwidth that goes through Cloudflare Realtime and so I have perhaps over optimised on minimising bandwidth by sending only one input per packet. The other part of my equation is I’m getting my server to broadcast authoritative batches of inputs every 100ms or so via TCP, so if a packet gets lost, every peer will eventually receive the input but it might be a bit slow, and it will cause a big rollback that might be noticeable.
Reading your comment makes me think it might not be as expensive as I thought, and maybe I can play around with how long of an input period I resend for. Perhaps there is a better balance to strike between cost and reliability. So thanks for bringing this up!
Thank you so much!
Yes thank you, you understand perfectly and thank you for explaining. Also, I LOVE your series of blog posts, thank you for making them!
Just to add to the general discussion for everyone following along - rollback netcode only sends inputs around, not state, so it doesn't really have much to send. I think I'm doing about 1.5 KB per second. When you point your mouse it sends that data in 10 bytes. There's not a lot to delta compress.
You can upload to itch.io yes: https://easel.games/docs/learn/publishing/export
The export basically creates a page with an HTML IFRAME in it that embeds the hosted version of your game on easel.games so that all the multiplayer and leaderboards continue to work.
Thanks for your interest!
Hi everyone,
I'm making a game engine that uses rollback netcode for its multiplayer architecture. As far as I can tell, no physics engine supports incremental rollback thus far. This means the entire physics engine state has to be snapshotted every frame, which basically means it's infeasible to have large worlds with rollback netcode. I've made a physics engine which only snapshots the changes, and so now I think you can have large worlds, as long as most of the world is static. I think that's true in most cases, like when you're walking around a big spaceship for example, all the walls, tables, control panels etc don't really move. I wrote up a bit of a post to describe some of the cool things I discovered while making my own physics engine.
This might not work for everyone who reads this, but I put all my Obsidian files on my iCloud drive. Since they're just markdown, they sync up on all my (Apple) devices and I can see the notes on my Macbook, iPad and iPhone at any time. I'm already paying for iCloud storage anyway for other stuff so it's very cost effective for me. (Obviously this wouldn't work if you're not in the walled garden of Apple)
For the past 4 years I've been building a programming language reimagined specifically for games. It has automatic multiplayer, but also things like state, components, concurrent behaviours and reactive user interfaces baked into the language.
That is so fetch!
In all honesty though, I quite enjoyed how this article was written. Is there a listing somewhere of articles written like this, with algorithms or concepts explained using analogies to pop culture?
Oh there is a listing, that's cool! Thank you!