how do I create a small multiplayer game?

Started by
10 comments, last by Orymus3 9 years, 10 months ago

beej guide is pretty good. I havent found any resources specific to games yet though.

[size="5"]http://innercirclegames.freeforums.org
Email me at: innercirclegames@hotmail.com
Advertisement

Backend engineering is really not my forte, but my understanding, from a frontend perspective, is that your backend code should:

- Receive requests

- Process requests

- Return results (and save them in your DB assuming persistence)

Now, let's assume you're translating your frontend code from your usual code to server-based code. What you'll want is to have an independent entity effectively poking your server with queries. You will be pooling this entity from your usual classes. Our personal approach is to make an API class and include all of the message types we could be sending to the server, effectively allowing other classes to poke the API with a request (and letting the API build the request from the arguments, encoding, and sending)

You'll also need a standalone entity listening for server messages, and populating them into some form of local database replica, which other classes will be able to get from.

I personally went to PHP because this is what my partner knew the most, and we're using JSON format for all data.

Note: This is a turn-based game, may not be ideal for real-time.

This topic is closed to new replies.

Advertisement