Making A MMO Database - PHP - MySQL - Random Session Cookies - Servers - etc...

RyanC

Member
Hi everyone, I have a game that I would like to include multiplayer in the sense that users can store there variables online and conquer and steal bases from one another etc.

From my understanding I need to link my GMS application to an online MySQL data base via a PHP script.

Anyone know how difficult this actually is, and if it's easy to test or not?

I really think this could take my game idea to the next level if it had MMO interactivity with friends etc.
 

FrostyCat

Redemption Seeker
The fundamentals aren't too difficult, just basic request handling, database access and JSON parsing on the most part. And if you use a framework like Laravel or CakePHP, they can be unit-tested with relative ease. The main challenge is designing the API and mitigating latencies.

Also, don't stick with PHP just yet. Way too many people in GM circles automatically equate all online networking with PHP, that's rather parochial. Research your alternatives such as Node.js, Rails, Java, just to name a few. Some are better at real-time work while others get to a working state faster.
 

NightFrost

Member
For transferring data across the web, you'll want to format it in JSON. Setting up a SQL database and a PHP script to do DB transactions is not a complicated process. Properly securing the data takes a bit more effort, like making sure players cannot alter each others' data (secure their data with a password) and even more effort into making sure players don't just lie to your DB by creating a script on their server that sends made-up stuff. A common measure is to reduce the client software into a dumb client that only communicates player commands, and every process and math operation is performed server side.
 

RyanC

Member
That's exactly my concern. I've never even programmed an online database, let alone make it tamper proof. Maybe this is a bit too tricky without some form of documentation from GMS on security.

As for the MMO programming part, I'd only need to store level data and things like coins and gems under usernames and that's it really.

I want to save levels that users make, exporting the instances and their positions to a text file but I can't see how I can store lots of text files for levels that users have created under their usernames in a MySQL database?
 

FrostyCat

Redemption Seeker
That's exactly my concern. I've never even programmed an online database, let alone make it tamper proof. Maybe this is a bit too tricky without some form of documentation from GMS on security.
GMS is not directly used to develop web application backends, why do you expect coverage of these security issues in documentation for GMS?

First read up on how to use your server-side language of choice. Then look up common web application security flaws such as SQL/parameter/command injection, CSRF, XSS, plaintext passwords, MITP, etc.. There are tons of articles on what these look like and how to avoid these.

As for the MMO programming part, I'd only need to store level data and things like coins and gems under usernames and that's it really.

I want to save levels that users make, exporting the instances and their positions to a text file but I can't see how I can store lots of text files for levels that users have created under their usernames in a MySQL database?
If you can't see how it's done, read up on how to do relational data modeling. Here is a starter.
 
Top