Hacker News new | ask | show | jobs
by mLuby 1506 days ago
I'm curious if it's reasonable to push more processing to the browsers to save on server costs.

I know multiplayer games generally need a server to "referee" (and to matchmake) but I wonder if games ever offload most of that work so the client does the heavy lifting (e.g. find a path from A to B) and then submits its work for the server to validate (e.g. this path from A to B works) and broadcast rather than the server doing all the game simulation work. My understanding is that multiplayer game clients generally just do graphics/sound and user interaction processing.

(yeah yeah distributed consensus don't say the B word)

4 comments

There are games that run exclusively on the clients by being deterministic. Like Starcraft 2. Server is just proxying packets back and forth, but doesn't actually know what's going on with the game.

It works really well with RTSes because of the number of things moving around. Unfortunately the drawback is that the client knows everything that's going on in the game. So fog of war is entirely client-side too. Another drawback is that rejoining a game (or a new player joining) is much harder (need a way to encode/decode the entire game state, or client needs to replay the game inputs up until that point to be able to play).

It has some really elegant side effects (tiny replay files, easy to reproduce most bugs, easy to check if a bug is fixed by playing a replay file with a new version, etc.)

A client-solves-server-verifies model introduces an interesting metagame that you'd have to be prepared to embrace. To run with your pathfinding example: odds are the stock client's pathfinder isn't ideal for every circumstance. You'd inevitably see alternate clients emerge with better or specialized pathfinding that would still check out with the server but would accomplish the player's goals better.

As far as I can tell there's no way to have the server prevent this while still saving any compute time, so you would have to design your game around the idea that this metagame exists. It could be really interesting for a certain type of player, but frustrating for many others.

This showed up a few months ago, but I never got over the "activation cost" to actually try it out: https://blog.zkga.me/announcing-darkforest
That is a super cool concept, thanks for mentioning!
That's true. I don't think it would matter much, other than it being easier to make superhuman micro-capable bots in RTS or aim-bots in FPS games. For the former, a limit on actions per minute might work.

On the other hand, once such bots exist it might just mean the game needs to evolve.

This is a common vector for cheats, so most developers eschew some sort of P2P lobby system.
This is the idea behind prediction. It’s used to reduce delays between client inputs and seeing the actions happen. More important in high reaction time things like fighting games.