Given the following tree structure, where each player logged in can have data for current and completed levels, quests per level, NPCs per quest, and multiple tasks per NPC... I'm trying to figure out the best way to store the current and completed data per player.
I asked the question before, albeit with too much detail. It was requested that I generalize the question... So if you'd like more context, see here:
https://stackoverflow.com/questions/23587430/rpg-storing-player-data-for-semi-complex-tree-structure
Some information about my RPG structure:
- Levels, Quests per Level, and Tasks per NPC are completed in chronological order.
NPC dialog and task dialog data is stored in a js object in a
npc_dialog_1.js
file in the following structure:var dialog = { quests : { questName : { NPCName: { TaskName: { "english" : [ "Hello, here is some dialog", ],//more items per task }, //more tasks per NPC }, //more NPCs per quest }, //more quests options per "quests" }, //more options in dialog besides "quests" if I want };
I am storing each
dialog
object in a separatenpc_dialog_n.js
file per map, that I'm retrieving withrequireJS
. This will reduce clutter in a single npc_dialog file.NPCs per Quest, however, can be started in any order... this is trying to mimic a GTA-style quest queue, as the game follows a general linear progression, yet for each quest you can talk to multiple NPCs and start, pause, and resume the NPC's tasks at any point.
Since the player can start, pause, and resume tasks per any NPC at a given time, I'm trying to figure out the best way to store the current and completed data per player.
mfirdaus recommended the following DB table with M:M relationship b/t user & npc... yet this would add up quickly as each player can have multiple NPCs per quest, and multiple tasks started per NPC... Any way around this set up?
My current db schema:
Thank you