Creating a real-time battle system

Hello.
I am experienced PHP developer and I want to start creating real time apps like RPG battles, and communicating without a page refresh.

Where I can learn this kind of staff?

Hi.
There are variety of technologies for that.
If you want to create web-based games running in browser then you can take a look at web sockets with Node.js and socket.io. Here is an example of simple online RPG created using these tools: Browser Quest.

If you don’t like Node.js for some reason you can choose from many of another multiplayer servers with Javascript clients support. For example, Union Platform.

1 Like

Thank you for your message!
the example looks very nice, But I didn’t understand - I need to learn about Node.js and socket.io together?

I’m gonna check them out.

Just websockets. PHP can do them, but it’s basically a bunch of hacks. Not to mention, if you want a real real-time system, then you need a stateful server. PHP is not stateful. On the other hand, socket.io is probably the easiest and most straightforward implementation on it and it runs on Node.js. Your “combat” server could run along side your main server that runs the rest of the site in PHP, if you wanted.

Here is a recent tutorial series on SitePoint walking you how to create a chat application in socket.io. The principles for your combat system would be the same.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.