Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by ibanezjoel

As the title says im working on an MMO style game and have only just started using impactjs. I am knowledgeable in php and MySQL but dont know how to connect to q MySQL db using impact.
What is the best way you guys have found to store player information such as level, items, abilities etc while working with impact games so that next time the player logs in he/she can continue from where they left.

1 decade ago by jswart

You can store data for the player in two ways:

1. LocalStorage - an html5 feature. This stores data locally on the users machine.

2. Server w/ most likely a Database.

For an MMO you will want to use #2.

In order to do that with PHP/mySQL you will most likely use AJAX. So you will set up your server to accept AJAX requests and return information dynamically. Using jQuery will be helpful here.

The other issue to consider is that with an MMO you will have multiple players on your server. So as people connect asynchronously with AJAX, you will still have to read/write from the DB with php\mySQL.

Doing so will cause blocking, which will slow down the server, which will slow down the game for player as they wait on that data.

Because of this I personally have started learning more about NodeJS. NodeJS is a server written in javascript that uses an event based IO loop. Thus, you do not get blocking from all the requests to the server. It just keeps accepting requests and fulfils them as it can. Rather than take a request, finish it, take next request, etc.

While you can certanly make your game with PHP/MySQL I would look into NodeJS. I say this a full time PHP\MySQL developer.

Hope that helps.

1 decade ago by Robodude

I'd have to agree with jswart here. I followed this tutorial series to get node.js setup and working:

http://indie-resource.com/forums/viewforum.php?f=99

the author of these tutorials plans on going through all the steps necessary to make a impact js mmo type game
Page 1 of 1
« first « previous next › last »