Creating a server to arbitrate a simple game

I created a simple game in which 2 players make simultaneous choices in each round, and the winner of the round is determined by the set of rules specific to the game. It looks like Rock Paper scissors work.

I would like to be able to offer this game online, where 2 players can find and play against each other. There would be some central server for arbitration of the game, and then each player would interact with the game using some kind of game client of our choice that we provide (i.e. based on the Internet, on mobile devices, Flash, etc. )

Obviously, a player can also play against a computer opponent that we could provide. I would also like to be able to let programmers send the computer programs that they wrote in order to act as players and play against other programs in some kind of tournament.

I understand that the specifics of my game should certainly be written from scratch, but it seems that all the work that the servers had to do in order to communicate with clients and maintain the state of the game was probably done many times before. This is probably the bulk of the work.

Does anyone have any ideas how this can be done quickly and easily? Are servers with some standard interface available for displaying new games? Is there any open source game server? How would you do that?

+4
source share
1 answer

Having seen that clients only occasionally communicate with the game server (as opposed to the continuous one), the web infrastructure should be able to serve as your “base game server”. Although web frameworks can be created to provide “web pages,” they can certainly (ab) be used to process requests.

This, of course, does not force you to make the game a browser; standalone game clients can be easily made and they can communicate with your game server using basic http. I also heard that this thing called Ajax is pretty elegant for such things.

Not only will you find many ready-made http-based servers, as an added bonus there is much more documentation on how to work with Web 2.0® © ™ than "game servers". You just need to know that you want the web framework to allow you to easily manage sessions and receive / respond to requests and the client library that does the same.

As added, "maintaining the state of the game", as you put it, drops 100% within the real game logic area. But many web frameworks have good database support and will certainly be useful for this kind of thing.

+1
source

All Articles