Hi,
I’m currently in the planning stage for the user created content in my game.
I was hoping to allow users to add comments to levels they’ve played. I’m trying to decide how best to handle this server side as it’s not my expertise.
I’m thinking the best thing to do would be a new table in the database for each levels comments, then each row in that table would contain the comment data.
Is this the correct way to handle it? Seems a bit overkill, but not sure. What’s the best practice to handle discussions in a database?
You should probably store all comments in the single table. Basically, add “levelName” or “levelId” as database column.
This way you won’t need new tables when you add new level.
So, basically, “create table Comments ( commentId int, levelId int, text varchar(2048), creationDate datetime, modificationDate datetime )” or something along those lines. Alternatively instead of “levelId int” it could be “levelName varchar” or something similar.
Also, I’d recommend, if you have to consider things like moderation, giving players a specific wordlist they can chose from, like in Dark Souls, etc. This not only makes communication without localization easier, but it makes it so you don’t have to worry about people logging in to see somebody has decided to spam the comments section with “kill all finns” or whatever.
Great shout, that makes more sense!
Oh yeah, hadn’t thought about moderation. I’ll look into the dark souls method, sounds interesting.