October 13th, 2012, 03:02 AM
I've been working on (in my opinion) a pretty solid rpg game idea but......I have a few issues...
I wanted to do it as a text based RPG with graphics, work out the code as best as possible, get the storyline down well, the races/classes stats etc. pretty much get all the key components of the game down to where I like them and see how things go.
JSON seemed like the perfect thing to implement into game data storage and from what i've seen, game development/storage with JSON isn't heavily documented on the net but I can't really see a reason why given some of it's capabilities and how light weight it is.
BUT...I want the game to rely on JSON heavily as far as data storage goes for the game and even help with some of the layout with the CSS & replacing tables for JSON objects.
I was wondering is there a way to pretty much use JSON for storing stuff like:
Races, Classes, & Factions: also stuff like for races, each of their base attributes the player starts with and for classes, the stat modifiers each of them give and for factions, the difference in types of gear and even possibly quests available to you.
Character Attributes & Profile: use JSON for holding and displaying the players stats & skills on their profile when it it visited. (wins & losses, strength, wisdom, agility, etc)
Guilds: Same concept as the 'Character Attributes & Profile' idea except for Guilds.
NPCs & Questgivers: for holding and displaying NPC characters and what they have to say & when also what quests can be given & for what level range and even their image file path. In general, the AI of the game.
Game Objects: actual in game objects the player can interact with or pick up or equip and their stats.
Saving your game: holding players data in some sort of secure JSON database if that's even possible.
Player In-game Stats: Lives, Health, mana, energy, etc.
GUI & Animation: using JSON array's instead of tables and then placing them with CSS for stuff like the players backpack window or the players run animation while moving using CSS3.
two other issues I have is,
A. is this all even possible and if so, how it would run?
B. how I could keep the code organized?
If I do it this way their's going to be A LOT of JSON objects in one document. Could I write & save them as arrays and seperate files like Guilds.json, Classes.json, Races.json and than call & store them or certain parts of them as needed like calling a function or a variable using eval()?
Also, if this IS all possible as far as making a text based browser game goes, how well could the "JSON" theory be implemented within a 3D environment like Unity?
I hope you guys can help me out with this!
October 13th, 2012, 12:02 PM
Is your goal to make a single-player / offline RPG or a multi-player / server based RPG?
JSON is an acceptable (but not great) format for storing static data, but a terrible one for storing dynamic data. Essentially, if the data is read-only you can store it as JSON; otherwise, you should not store it as JSON. JSON isn't intended to be a data storage format, it's just intended to be a data transfer format. However, it does actually work OK for serializing the state of objects as you would do for a game save file, so for a single player game it would be OK for game-save files.
If there is any ever situation in which one player could need to access any data for another player, then JSON is not suitable at all.
October 15th, 2012, 05:10 AM
I want the game to go through phases in its development that way by the time i even reach alpha testing of the 3D phase I have a steady footing and everything worked out on what I want and yeah, eventually make it a multiplayer game but that's a separate topic.
And I understand what you said about JSON, but what I still don't get is the fact that you can store functions and variables in JSON objects and call them so why would JSON be bad for storing things like The players name, stats, arena rank, etc. or guilds for example, they're world rank, honor, amount of members/limit, and a members list or the quest givers and NPCs idea, storing the id and name of quest giver, name and id of quest, quest text, incompleted quest text, completed quest text, reward for completion and stuff like that?
I appreciate any info or feedback
October 15th, 2012, 07:39 PM
Things like quest text, quest rewards, and the list of NPCs are logical to store in JSON even on the server side, because that data should almost never change (except when you perform a game code update).
You need a database engine to store data on the server side. Something like MySQL, Postgresql, MSSQL, etc. A storage solution based on JSON would have terrible performance and scalability.