Jump to content

Recommended Posts

Hi, I want to make a visual php mysql based multiplayer role playing game, of the Dungeons and Dragons type, I don't know if it would be tile based or what the most advanced interface I could do would be in php. But ideally it would not have to reload the page every time, could I do that with ajax?

 

Please if anyone can give me a link to a really good multiplayer rpg that has a very good interface where you can see the "monsters and players" moving upon user moves. Thank you.

Link to comment
https://forums.phpfreaks.com/topic/262136-php-multiplayer-rpg/
Share on other sites

You should write it in JavaScript, and preferably use a <canvas/> While on the matter, you should also read "JavaScript Patterns" this contains all the JS optimizations you will need to consider while building your game. Look at Command & Conquer Tiberium Alliances for a browser-based game with moving units.

 

You will also need a book/resource with explanations of how you can create a fair multiplayer when dealing with clients. The server is the referee, and clients should only be able to communicate their actions, not their result.

 

Examples of communicating their results:

attack.php?name=some-client&hp=0

reward-player.php?id=1&coins=9999999

 

Examples of communicating their actions:

attack.php?name=some-clients&spell=some-spell

 

Returns: {"results":{"player":"some-clients",'hp":80}} to update the user's screen.

 

This puts the server in control of what damage is done instead of the clients. The server should also validate each request, as you should with any normal application you build. You can further expand on this by creating admin specific requests:

admin-kill.php?player-id=1&reason=annoying

 

Obviously in admin-kill.php you should check whether the client is in fact an admin. Also any security measures you take with a normal application should also be present here, like for example preventing the obvious CSRF attacks.

Link to comment
https://forums.phpfreaks.com/topic/262136-php-multiplayer-rpg/#findComment-1343433
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.