-1
\$\begingroup\$

What's the best method to save the player's data to the server?

Method to store the game saves
Which one of the following method should I use ?

  • Using a database structure(e.g.. mySQL) to store the game data as blobs?
  • Using the server hard disk to store the saved game data as binary data files?

Method to send saved game data to server
What method should I use ?

  • socketIO
  • web socket
  • a web-based scripting language to receive the game data as binary? for example, a php script to handle binary data and save it to file

Meta-data
I read that some games store saved game meta-data in database structures. What kind of meta data is useful to store?

Edit-1
This question was to actually see what technology is better to use based on the situation. The situation is a game that will be on cross-platform, save game throughout the cloud.

Method of delivery from game client(iOS, Android, Windows Phone 8, etc..) to game server(Linux, Windows, etc.) Im using a Ubuntu server at this moment.

Method of storage of binary data Inside a database system or file system. The up and down side to it and the community options of existing structures.

Storing of meta-data Well, I'm not too sure about how to store saved game data to server at the moment. Thus, was wondering if the community can provides tried and tested methods used by the community. and their preferences.

\$\endgroup\$
1
  • \$\begingroup\$ You should clean this up a little more. What platform would this game be on? What kind of game? etc? \$\endgroup\$ Jun 4, 2014 at 12:16

1 Answer 1

1
\$\begingroup\$

There are many questions here - I'll try to answer each of them. Entire books have been written to address these, but I'll try to be brief.

what's the best method to save player's game binary save data to the server?

HTTP Post to custom server handler to persistent(DB) store.

Method to store the save game

Anything - could be MySQL, PostgreSQL, Mongo, Flat File, or whatever you want. You really have to look at the strengths and weaknesses are for each and determine which one is best suited for your game.

Given that you are new to this, I would recommend something more along the lines of Mongo or Couch DB. They store the information you send to them as a document without any hardcoded schema(which has it's drawbacks, but that is for another article).

Method to send saved game data to server

Depends on your game really. If you need second to second real-time saves, then you could use websockets, or if you only need save games every once in a while then you could use just regular http post data to a server.

Be careful though as websockets constantly updating databases can get very expensive, so try to balance how frequently you need to update with the actual cost of running the service. Load test and profile!

What kind of meta data is useful to store?

Everything! Storage is cheap, so don't be shy(but also don't waste too much of it otherwise you're just being greedy). If you think about it for a minute, ask yourself what kind of information you would want out of your data. How long the user plays the game? What the average game-play session is? Then think about what you need to store from those basic questions. Start/end-time are obvious, but what about system hardware specs so you know what kind of hardware your users are playing on? What about geolocation information coupled with average session length to give you a better idea where to target your advertising? These are all things that can be done, but you will have to figure out what you want to store and how you are going to store it.

\$\endgroup\$
3
  • \$\begingroup\$ Just about to implement my own game's save game state and what you wrote matches with what I had in mind. E.g. Use POST from client to custom PHP server end points to update information and retrieve information. Use SQL on the server end. I will salt and hash the users username on the database and store all the game data as a single blob which represents a flatbuffer. Nice. Need to think about security though. How do I verify the user is the user. I wonder if Google Auth, with the email or whatever is sufficient. Also don't forget to use SSL connection ! \$\endgroup\$
    – user24493
    May 12, 2018 at 9:45
  • \$\begingroup\$ To verify users, I've mostly just used OAuth. It helps because you don't have to worry about managing user passwords, accounts, etc. And yes, always use HTTPS(TLS, not SSL). When I said HTTP POST in the answer above, I was referring to the HTTP POST method and not the underlying socket protocol. \$\endgroup\$
    – Ken Noland
    May 13, 2018 at 12:57
  • \$\begingroup\$ Yeah, just got to the OAuth bit. Looking forward to implementing it :-) \$\endgroup\$
    – user24493
    May 13, 2018 at 13:40

Not the answer you're looking for? Browse other questions tagged .