RPG System 2
While working on a zombie RPG I realised that my Dialogue tree system was lacking in some key areas;
it was useful for visualising the paths that the players’ choices could take them down, but would quickly become overcrowded and adding more dialogue options was a pain point in larger projects.
Moreover, the dialogue tree was stored as JSON data, Which meant that I would easily be able to edit the files outside of the project, or even give the option to players to modify dialogue, however, this meant that events and other non-serializable options were unavailable to me.
Lastly, the original system was made to be as simple as possible and implementation for things such as quests or inventory was left to be tacked onto it for each game, for this reason, quests, inventory count, or any other variable could not be taken into consideration when displaying options for the player responses to dialogue queues.
RPG System 2 aimed to solve all these issues.
To solve the first issue I decided to take inspiration from a simple and effective game development software called ‘Quest’. This software is used to make text-based adventure games and while trying it out I found that the software was intuitive and easy to use with larger projects being easy to navigate, as such I based the visual style of my second RPG system on it. while this did remove some of the flairs of the previous system it made v2 a much cleaner and less complex system to work with.
The second issue was a much larger hurdle than the first one.
I wanted a system where the player could affect both In world events and quest variables. At first, this seemed like a difficult prospect as there were many things that I wanted to be affected, everything from inventory items to quests, and events such as cutscenes being triggered.
To achieve this I took inspiration from the Unity UI Buttons, this put me on track to using the Unity Event System to allow the system to affect anything and everything in-game through scripts.
The last issue was made rather simple due to how I implemented the unity even system to activate when a given choice was picked. As such I started by developing an Inventory system and Quest system, which work with or without the dialogue system, then through the use of a script called NpcExtender, I made it possible for NPCs to grant quests, change quests states, and take or give inventory items. Using this script with the Unity event system mentioned earlier, it became possible to reward players for different choices.
To achieve requirements for each of the dialogue choices I tapped into the quest system that I made earlier, firstly, I made the system observe what is in the players’ inventory, and how much of it exists, giving the dialogue system the option to do a check for item quantity ( A use-case for this would be if you are giving food in exchange for information, or if you must have a certain amount of ammunition to start a quest), using the same system the NPC can check if a player has completed a certain quest by checking for an integer value. Lastly, to accommodate this, I made it possible to not only check if the value is equal but greater or less than the stated value as it gave more flexibility.