Jump to content
  • Advertisement
Sign in to follow this  
Namiar

Data storage on server

This topic is 4470 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, I am currently programming on a client-server game. There is a great amount of data like attributes to store, so I decited to manage it with MySQL. Programming with it is not the problem, but whats the best way to store the data while a player is playing? Is it better to load the playerdata in some kind of structure or should all go over the SQL? For example: Is it good to load every time I need his healthstatus (for combat, healing,...) from the database or is it better to load the data only once and then store it somewhere(within an array or a struct)? Hope you are more experienced with situations like that.

Share this post


Link to post
Share on other sites
Advertisement
The database is a LOT slower than main memory. However, the database is durable.

Thus, typical designs will load the data once, and then mutate it in memory, check-pointing back to the database at opportune times. "opportune" can mean different things -- every 10 minutes of play time; everytime you loot a mob; one player per second in round-robin fashion; the approaches vary.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!