Live data from Hacker News

A physics engine with incremental rollback for multiplayer games

easel.games

31–40 of 46 posts

Re: A physics engine with incremental rollback for multiplayer games

#31

Earlier quoted context omitted.

One cool trick you could try (although you are probably doing it already) is to include all inputs for some long period (like 1-2 seconds!) in every input packet the client sends to the server. This way if one input packet gets lost, the very next one getting through will have all the inputs for the last 1-2 seconds, and this greatly improves how well your game will play under packet loss. When you do this, you can e…

No need to resend inputs with seq IDs <= the last one acknowledged by the server, right? 1-2 seconds sounds like overkill. Unless the server updates themselves are lower than 0.5-1 Hz, but what kind of game is that? A very sparse world where chances of misprediction are very low?

I’ve found that sometimes p2p connections will have large lag spikes when communicating across the country (and on WiFi networks, that’s likely the true culprit).

I would see rare bursts of packet delay for ~1 second, that would quickly resolve. In a rollback game where inputs are predicted well, often times this would be unnoticeable.

I send up to 2s worth of input history every frame to handle these lag spikes. I also confirm inputs received, so in practice usually players are only sending a handful of recent unconfirmed inputs (with the 2s buffer available if unconfirmed inputs pile up due to lag).

My guess is their 2s window is for similar reasons, as buffer for rare connection issues. Even if lag spikes are incredibly rare, they need to be handled for a reliable player experience

Re: A physics engine with incremental rollback for multiplayer games

#32
post #2

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 y…

How big is the state that you want to rollback?

Re: A physics engine with incremental rollback for multiplayer games

#34
post #26

Is this a demo? A hobby? How long have you been at this?

I’ve been working on this for four years. I’m trying to make this my full time job!

Let me know when you have enough demand to make it multiple full-time jobs. I’ve been making notes for a few years now about all the best patterns and principles for designing complex systems and your language + engine more or less hits all the right notes.

Declarative state and reactivity, lexical lifetimes and ownership, etc. Really curious how you set it all up and what prior art was your primary inspiration.

Re: A physics engine with incremental rollback for multiplayer games

#35

Earlier quoted context omitted.

I’ve been working on this for four years. I’m trying to make this my full time job!

Let me know when you have enough demand to make it multiple full-time jobs. I’ve been making notes for a few years now about all the best patterns and principles for designing complex systems and your language + engine more or less hits all the right notes. Declarative state and reactivity, lexical lifetimes and ownership, etc. Really curious how you set it all up and what prior art was your primary inspiration.

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.

Re: A physics engine with incremental rollback for multiplayer games

#37
post #29

Earlier quoted context omitted.

What you're describing isn't uploading the game, then, but uploading a stub with a transclusion of the game. I'm not the same commenter, but surely that doesn't answer (what I see as) most of the implications of the original question?

Vendor lock-in with a monthly subscription where the price can change at any moment or the company may disappear along with your product. I wouldn't build my business on that.

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.

Re: A physics engine with incremental rollback for multiplayer games

#38

This looks great - how much of it is open source, could I host it all myself? wouldn't be interested in investing any time learning if I'm locked in to hosting on some else's hardware.

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.

Re: A physics engine with incremental rollback for multiplayer games

#39

Earlier quoted context omitted.

How does it compare with deterministic physics engines, given that their appeal for multiplayer is that they can perform 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 th…

Planetary Annihilation did it and wrote and gave talks about it.

Re: A physics engine with incremental rollback for multiplayer games

#40

As a long-time web/app developer getting into game dev, it feels like I'm entering "the big leagues" of software engineering. Tougher problems, more problems, more _interesting_ problems, and problems without prebuilt solutions. Much more fun than making yet another dashboard. Combining player control, multiplayer, non-player control, and physics is one of the tougher problems. I got it handled (enough) for my projec…

I’m in the same boat. Been learning 3d game dev past few years seriously after dabbling for half a decade. I even released my first few tiny 3d games in the last 6 months and they’ve made hundreds of dollars! That alone was a dream come true. I picked game dev specifically because I wanted to build some things I had envisioned and found it challenging. And in the beginning each new concept within 3d modeling, optimis…

I know there’s a ton of resources out there for this sort of thing but is there any particular sites/books that stood out to you while learning?
Post reply on HN