1

I am developing a game, well have an idea for a game and have been learning the languages I thought I needed for the project. It's a simple web based 2 player text based clone of Global Thermonuclear War.

Players login via A PHP form and are automatically matched. The game logic is fairly simple. Player A picks one of Player B's territories to attack, the move goes to the server which then sends it to Player B. Player B then makes a move and on it goes until there are no territories left. I've been learning Javascript and AJAX and can get around in PHP.

The problem I'm having is I can't seem to find anything relevant to creating game servers in php.

Can someone suggest some material I could read up on, or where to go from here.

2 Answers 2

2

Some project links -

http://code.google.com/p/phpwebsocket/

http://code.google.com/p/php-websocket-server/

With APE (based on C), you could real time communication between server and client.

http://www.ape-project.org/

Sign up to request clarification or add additional context in comments.

1 Comment

Many thanks! Only looked at the first link so far but this seems to be exactly what I want.
1

Read about Node.js, it's a Javascript framework. Combined to websockets on your browser, it can do some pretty amazing things. For example, Facebook is basically using a node.js-like server to keep the user up to date about notifications, Facebook chat or messages.

You could use this to keep a connection between a client and the server who'll have to handle the actions (Interacting with database, the user and the client's browser).

It's easy to use and very quick to build a server using node.js, associated to websockets, it should do what you're asking for.

2 Comments

the title is "Creating a PHP socket server for game", websockets were a good hint, but node.js advertising was unnecessary
Thanks to everyone. I have lots to read up on now. Just needed to know where to go next and once again the stack community have helped.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.