GameMaker: Studio

GameMaker: Studio

View Stats:
NeXuS Mar 5, 2016 @ 7:48am
GameMaker MySQL database - retrieve and upload data
Dear GameMaker community,

As requested by Apple when I tried to upload my game, I need a system in place for users to be able to save their data to a server and then retrieve it if they create and account and login to that account (This would then be the way they could move their data to different devices). I have a MySQL database and have created a table with all of the variables that my game will have to load. I have also created the different buttons and icons for the user to click on ingame.

It is important to note that i was using this tutorial before: http://gmc.yoyogames.com/index.php?showtopic=535885 , but then I found out that this way was only for HTML5 games, and I need this to be able to communicate with my Android/IOS/Windows mobile game. If there is a way to tie these together, please share your knowledge.

I really need this as soon as possible, Apple and Google require this before I can post my game to their stores.

I will give that person/people $1000 worth of in app purchases value in my game's shop (Example: 1000 Gold in game is $1, so you would if wanted receive 1 Million in game gold), but if you just want to help, I really would appreciate it just as much.

Thank you,
Daniel
Last edited by NeXuS; Mar 5, 2016 @ 12:30pm
< >
Showing 1-9 of 9 comments
Daynar Mar 5, 2016 @ 10:47am 
After looking into this a bit, it's fairly complex. If you can have a completely offline save system I'd highly suggest using that instead, but I assume that isn't an option. I'm not sure why Apple and Google are requiring you to add this as I've never seen it required before, and if you can give any more info on what exactly they are requiring you to fix/add it may be helpful.

I have slight experience with deatabases, but I have not done something like this before so I could be completely wrong. However from what I understand connecting the app directly to the SQL databased would be both risky and difficult to do with gamemaker. While researching I didn't see anyone suggest doing this so I could be completely wrong, but I would suggest having the app send a normal networking message to the server, a 'handler' then reads it, sanitizes the input , doess whatever needs to be done in the database, and sends back success or failure and any neccessary info.
NeXuS Mar 5, 2016 @ 11:35am 
This is what they said the steps I should take should be:

"Next Steps

Please modify your app to include an optional user registration feature that allows users to restore their purchases to all of their iOS devices.

We recommend indicating that account registration is necessary to restore previously purchased In-App Purchase products, and providing a way for users to register later if they wish to access this content in the future."

The reason must be because I have included in app purchases and even though they are consumables, they (gold) can be used to purchase non-consumable in game items.

And about what you suggested, could you possibly put that into gamemaker code?

Thanks for your help! I really appreciate it!

EDIT:
Also, in that tutorial I provided the link to above, is it possible to use that in my game? So I would send the client to a web page and then the data is read off of the web page and the client is sent back to the game? Just an idea, but I would rather have it ingame.
Last edited by NeXuS; Mar 5, 2016 @ 11:50am
Daynar Mar 5, 2016 @ 12:08pm 
hmmm it sounds like you dont actually need to use an SQL database, although honestly that would probably save space and be a better option than what I am going to suggest. You could 'make your own' database that saves a buffer on the server containing the users purchases premium items as well as their save. In my mind this would work serverside by taking a username password command and relivant information. It checks the username and password combo and if it's false sends a password error back to the client, if it's true attempts to do whatever command. (which would basicly be update save, update premium items, download premium items, or download save) I would make sure premium items can only be added and not removed. Client side I would be lazy and save the username/password combo once they get a successful login and just send it to the server as a 'header' to any thing you want to do. I'd probably have some wait time (like 5 seconds maybe) and if it doesnt get a reply send it again. And then display a network error at 20 seconds or so with no reply.
Last edited by Daynar; Mar 5, 2016 @ 12:08pm
Daynar Mar 5, 2016 @ 12:13pm 
Originally posted by pestmeister:
"http://gmc.yoyogames.com/index.php?showtopic=535467"
That might work also here is the link without quotes. http://gmc.yoyogames.com/index.php?showtopic=535467
NeXuS Mar 5, 2016 @ 12:29pm 
This is the exact link I mentioned above. My one is the updated version of that. http://gmc.yoyogames.com/index.php?showtopic=535885 Sorry, the comma got in the way...
Last edited by NeXuS; Mar 5, 2016 @ 12:31pm
Sistermatic™ Mar 5, 2016 @ 12:46pm 
I know very little about GM and asynchronous but I'm spent years doing php/MySql web development.

My skim of this says you need a website with php script that has access to the sql DB. Your GM code simply sends data to the PAGE - not the DB - and the php script sends back the data.

You would not access the DB itself through GM, you only recieve the data from the php script when you access the actual page. (GM effectively acts like a bot)

This (also) allows people to access their account info etc. without being in the game and appears to be what Apple & Google require because of your ingame purchases etc.

If you already know this, carry on. I just saw this comment and wondered how you have it set up.
EDIT:
Also, in that tutorial I provided the link to above, is it possible to use that in my game? So I would send the client to a web page and then the data is read off of the web page and the client is sent back to the game? Just an idea, but I would rather have it ingame.
Last edited by Sistermatic™; Mar 5, 2016 @ 1:01pm
NeXuS Mar 5, 2016 @ 11:48pm 
Originally posted by Sista:
I know very little about GM and asynchronous but I'm spent years doing php/MySql web development.

My skim of this says you need a website with php script that has access to the sql DB. Your GM code simply sends data to the PAGE - not the DB - and the php script sends back the data.

You would not access the DB itself through GM, you only recieve the data from the php script when you access the actual page. (GM effectively acts like a bot)

This (also) allows people to access their account info etc. without being in the game and appears to be what Apple & Google require because of your ingame purchases etc.

If you already know this, carry on. I just saw this comment and wondered how you have it set up.
EDIT:
Also, in that tutorial I provided the link to above, is it possible to use that in my game? So I would send the client to a web page and then the data is read off of the web page and the client is sent back to the game? Just an idea, but I would rather have it ingame.

Yes, thank you, but since this is an iPhone and Android app, how would I do that in GML code, I see what you mean, but I need it in code. Thanks for the help though!
Daynar Mar 7, 2016 @ 8:11pm 
An update for anyone reading this in the future. We got the tutorial working on windows export after a lot of troubleshooting. The origional host used an antibot script which caused the demo to fail. The different host injected the webpage with a statistical script which caused some issues but we were able to clean the page on gamemakers end and remove the extra stuff and get it working correctly.
< >
Showing 1-9 of 9 comments
Per page: 1530 50

Date Posted: Mar 5, 2016 @ 7:48am
Posts: 9