DavidMcLaughlin208 / FallingSandJava

Falling Sand Simulation implemented in Java. Every pixel is simulated every frame and has its own state and intrinsic motivations.
151 stars 17 forks source link

Do you think it's possible to add sand simulation in online multiplayer games? #4

Open chaifix opened 2 years ago

chaifix commented 2 years ago

Very nice work, David. You mentioned online multiplayer in description. Do you think it's possible to add online multiplayer in games like Noita? I play this game a lot, and i think online co-op in the game will be cool.

DavidMcLaughlin208 commented 2 years ago

Hey sorry I missed this.

Essentially, with online multiplayer games certain objects are 'networked' meaning that their positions and state are authoritatively stored on the server and that information is sent back to the clients (individuals running the game) and is updated on their screen.

So in a game like Rocket League the only networked objects are the cars and the ball (this is a bit oversimplified). In a falling sand simulation there are hundred of thousands up to millions of individual objects that would need to be networked. There are optimizations that could be done but even then it is far too much data to network at a rate which would still feel responsive and 'good' to the player.

The multiplayer I mention is where the game is run on one computer, all the calculations are done on one computer, and the screen is streamed to someone else's computer. The person who is viewing the streamed game can send their inputs to the instance of the game which allows them to effectively play couch co-op from afar. (This can be done through Steam Remote Play and Parsec). This way the only things that are being networked are controller inputs, and the screen being streamed. And all the game objects and calculations are performed on the one instance running on one computer.

Steam Remote Play and Parsec are still sort of new and will never be perfect but can be usable in some situations.