I'm creating a single player web RPG. I was originally storing NPC dialog in a JS object. I could cycle through lengthy dialog in an array as I wanted. I can also store objects with K:V pairs.
That being said, is it easier/faster to manage, store and retrieve dialog in the following three methods:
Also, can you tell me why one is better over another for running a single player web rpg:
a JS Object:
var dialog = {
quests : {
quest1 : {
NPCName: {
"Task 1 - Introductions" :
{
"dialog" :
[
"I'm Pedro",
"Welcome to my neighborhood",
etc...,
],
"wordBank" :
{
"Hola" : "Hello",
"Como" : "What",
}
In pure JSON:
{
"quests" : {
"quest1" : {
"Lee" : {
"Introductions" :
{
"this" :
[
"Hello"
],
"that" :
Or in a database: