In my text adventure I'm making, I store the story data in a hashtable (I'm using unity's javascript/unity script since I'm more comfortable with the syntax than C#).
The problem is, the way I structure the hashtable means that it gets incredibly bloated very quickly (I've used the same structure in all of my text adventures across multiple languages. It quickly grows to nearly 1k lines long) which makes it hard to edit in the future (especially if I need to go back to edit certain parts later on)
Here's the hashtable as it's currently structured:
public static var story = {
"0":
{
"text":"",
"choices":
{
"response1":
{
"text":"",
"nextPart":"1"
},
"response2":
{
"text":"",
"nextPart":"2"
},
"response3":
{
"text":"",
"nextPart":"3"
}
}
},
"1":
{
"text":"",
"lastPart":"0"
},
"2":
{
"text":"",
"lastPart":"0"
}
};
If anyone could help me optimize the structure of the hashtable that'll make it so it's more easier for me to edit it in the future, that would be great
Quick information for parts that may not be self-explanatory:
"lastPart" indicates to the hashtable parser that the player has died and the number refers to the part where they chose the response/choice.
"nextPart" refers to the part of the story the response leads to.