views:

79

answers:

1

I'm building a game and I'm looking for a good way to implement multiplayer. It is a sandbox game with Box2D physics. I was thinking of making it so the client only sends input to the server and receives which sprites to draw and where. Would this be a good idea? What might be ideal for a game with Physics like this?

Thanks

+4  A: 

There's a few approaches you could take.

The one you mention is what I think of as a "thin-client" style aproach - the server is responsible for most of the processing, and the client is responsible for only basic user input and output. This has the advantage of making cheating difficult, since the client has no access to the algorithms defining the rules of the game, and thus will have difficulty subverting them. The downside however is that it places a great burden on the server in having to do essentially all of the processing for each client - potentially a lot of work.

The opposite approach is to have each client do all of the game processing, and the server essentially just be a means for the clients to inform each other when their state changes due to user input. This relieves the server of a lot of work, but makes cheating easier.

Given it's a sandbox style game, I'm guessing cheating isn't such a big issue. In which case I'd personally go down route 2, but there's absolutely nothing wrong with doing it the way you suggest.

Mac