- Home /
What Method is better for Creating a Guild
I'm developing a MMORPG based on the popular anime Sword Art Online. I'm programming the functionality of creating a guild and don't know what method would be best to store the information in a MySQL database. The values I need to store are as follows:
public string guildName = "";
public string guildDescription = "";
public int guildFunds;
public List<string> membersInGuild = new List<string> {"Bill, Bob"};
public Color emblemColor;
public Texture2D guildEmblem;
public List<string> guildInventoryItems = new List<string> {""};
public List<string> guildInventoryItemStats = new List<string> {""};
I'm thinking of storing the guild name, description, funds, and emblem color in one database that holds this information for every guild in the game, may just name this database "Guilds".
For the members in guild, should I just use the database that holds all the users of the game and add another variable holding what guild they are in or if they are not in one? Or should I create a seperate database with a list of all players in a guild and what guild they belong to and then determine they are not in a guild if they are not in the list?
And what of the emblem? Players are able to upload there own emblem, which is a much larger file size than a string so should I create a seperate database stating each guild then a variable (or cell) holding the emblem information?
Lastly the inventory items and stats in a guild. Should I create yet another database holding every item currently in a guild and then add variables for its stats and what guild it belongs to?
Thanks for the advice, and if you think of a method I have not stated that may be easier than any of the other I'd love to heat it.
Answer by Bunny83 · Jan 05, 2014 at 02:39 PM
I'm pretty sure this question is some kind of follow-up question of your other question.
In general you have to seperate two things:
How an object is represented at runtime in your game
and how it is stored in a database
There's usually a big difference. Any data stored in a database is stored in a way you can easily access and search for any parts of the stored information. In game you usually structure the data in way it's easy to use (for whatever you need it). Since MMOGs are usually mainly developed on the server, the client just displays information. Most actions a user can do are executed on the server and change / affect data in the database. The clients just get informed or they update themself by reading the new information from the server.
All your sub-questions can't be answered in a clear way since it all depends on the usage (how often is certain data read, what's the relation between certain data, the average size of the data).
It seams you have only little or no experience in database design and server programming. May i ask why you decided to make an MMOG? MMOGs require a lot specific technologies / knowledge about databases, bandwidth, traffic, server load, security, data validation, ...
If you start with no experience in those fields it's probably going to fail.
ps: What is "much larger than a string"? A string in .NET / Mono can store up to 2GB of data. In a mysql database the type "LONGTEXT" can store up to 4GB. So i don't think your image is much larger than a string can possibly be ;)
I would suggest to read a lot about relational databases, how they work and how they are used. Look at different examples and try to understand why they designed it that way.
As final "hint" ;)
Thanks for the reply Bunny83, you've been a big help.
I've been using unity for a couple years and just built a server and pair of data-gloves from scratch not to long ago and decided it would be a good learning experience to tie them all together on a little VR project starting with the server. By no means do I plan making some enterprise class server system running a huge environment with thousands of players, just a personal "proof of concept" project.
Did I say larger than a string? Opps, I meant combining each separate string in the list into a single "longer" string in order to store it all in the same row. I just decided to go with using multiple tables as that seems the simplest, and it's working just fine now. As your "hint" states about the "top down RPG", I've already got a prototype functioning so I'm working on expanding it (:
Again, I'm just going for proof on concept and thanks for the advice!
Your answer
Follow this Question
Related Questions
WWWForm Question 2 Answers
Not allowed to connect to my database. 1 Answer
MySQL Funktionen Hilfe 1 Answer
Downloading data from MySql database not working on Android. 1 Answer
MySql C# compiler error 0 Answers