←back to thread

93 points BSTRhino | 9 comments | | HN request time: 0.885s | source | bottom

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.

Show context
traverseda ◴[] No.44000131[source]
If I created a game in this, what gurantee do I have that someone will be able to play this game in 100 years?
replies(1): >>44000146 #
1. actionfromafar ◴[] No.44000146[source]
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.

replies(2): >>44000176 #>>44000198 #
2. traverseda ◴[] No.44000176[source]
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

replies(2): >>44000617 #>>44006908 #
3. BSTRhino ◴[] No.44000198[source]
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.

replies(2): >>44000210 #>>44001400 #
4. traverseda ◴[] No.44000210[source]
Consider just releasing it under a BSL license forbidding commercial hosting? If that works with your business model.
5. ChadNauseam ◴[] No.44000617[source]
FYI, the person you're replying to is not OP. Their answer is here: https://news.ycombinator.com/item?id=44000198
6. TechDebtDevin ◴[] No.44001400[source]
I believe Github has tools built for leaving a successor in the event of the developers death thats relatively straight forwars.
replies(1): >>44001845 #
7. BSTRhino ◴[] No.44001845{3}[source]
It seems that Github's successor feature only allows your successor to re-assign ownership for your public repositories. I'm currently using a private repository so this sadly does not work for me. Otherwise I would grab this feature with both hands!
8. setr ◴[] No.44006908[source]
Online multiplayer games? AFAIK they’re all dead unless the server has been reverse engineered like WoW.

Offline games continue being playable only because of software/hardware emulation — it’s not a product of the game design/engine/language or anything else really.

replies(1): >>44021269 #
9. traverseda ◴[] No.44021269{3}[source]
For a long time most PC games came bundled with a server. Consoles being the exception, but many games were released on PC as well.