How to store Dialogue for an RPG game ?

Hello,

I am kind of a novice developer, I made many small game but all are “one shoot” game without story.

I would like to start with some friend a project, a mini RPG, in order for me to practice many thing I never dealed with (save, dialogue …)

I would like not to use any asset store asset, since the goal is to learn, so please don’t point me to Dialogue System for Unity plugin. A tool for making dialogue is ok tho ( like scripting dialogue language, or tool to make dialogue and export them in xml.)

Now my question is different. I know how to make what I want exepect one thing, how to store my dialogue ? What is a good architecture?

By that I mean, since 1 NPC can have different dialogue at different moment of the game, and there are many npc and non linear dialogue in RPG, how to correctly store them ?

1 file per NPC with all the game dialogue ?
1 file per world (so all the npc contained in the current map ) with all those npc dialogue at any moment of the game ?
or 1 file with everything ?

I was thinking tu use Ink which is only a scriptin language to make the dialogue ? Did you ever use it ? Do you think it’s a good choice ?

What I was thinking to do is,

My NPC has 3 types of dialogue 1) when you come close to it, a catch phrase
2) when you start talking to him, some brief sentence,
3) the real dialogue that will be like a visual novel.

I was thinking to store all dialogue of 1 NPC in 1 file, and the NPC will catch the good dialogue regarding the current gamestate

Thanks for the help and making me go toward the good path !

If you want changing dialogue depending on conditions, I’d suggest using a Finite State Machine.
About the storing I think you can either use xml (which you could use for optimization, like one file per npc for all his dialog and load/unload them as the player is a certain distance away for example). Also you could maybe use sqlite, but I don’t know how the integration in unity is.