I’m sorry if this is the wrong place to post to but here is what i’m wondering about. My team is making an mmorpg and I need to figure out how to have our dedicated server save all the players data to files and retrieve it when logging in, the log in happend through a MySQL database and i’d like it to save all the character data to a file in a folder in server files for an example ‘Characters’, What should i do to achieve this?
Use MySQL 5.7.8 or higher, it supports JSON format.
Google around how to send/read JSON from UE4 to server… The whole character data can be a Json object stored in the server.
For mmorpg this is worst approach. You should store all data about player’s character and game world in database. At first because of latency. Its much faster to put\retrieve data from database than from file. Second - file system limitations. If you plan to have more then few players online in same time, then your server will constantly be writing big amount of data to file system, because you can’t just put “diff” into file, or retrieve just specific data(char position) without reading\saving whole file.
We read and write data (stats, location, inventory, character details) from our dedicated server to MySQL through a separate java socket server. This is relatively easy to implement and data saves during gameplay are unnoticeable.
One should never deploy a server without a cache system to begin with.
There are games I know access/write to the database only once in a 25 minutes delay period… Meanwhile the whole data is handled by a in-memory database running attached to the server process.
MySQL before 5.78 also supports JSON. The field type is called “MEDIUMTEXT” and can store any JSON you care to use
(It doesn’t support quering structured JSON, though, which I presume was what you really meant.)
A good hybrid database schema contains certain important values (player id, character id, character name, last login date) as columns in the schema, and then contains a single additional column named something like “properties” of type MEDIUMTEXT and you store your JSON there for all the other bits of character data.
So how would i go at creating the database, should i just use the MySQL and having the server handle a lot of people (a lot of as in mmorpg a lot)? Sorry if these are newbie questions
Basically the data i need to store is the id’s, skills, inventory etc so how would i go at making it happen, and we’re reserving 2000 slots of players for beta if i remember correctly so what would be a good approach at this situation?