-
Notifications
You must be signed in to change notification settings - Fork 3
Dialogue System, Character Profile and Item Inventory
Our game has a completely original dialogue system coded from scratch. The mechanism behind it is to have one central dialogue manager which is responsible for displaying dialogue boxes and their corresponding texts. The dialogue manager holds only one box and therefore only one set of dialogue lines at a time.
Each NPC character has a dialogue holder script, which has a set of dialogue boxes. It determines when to move on to the next dialogue box internally, and updates the dialogue manager with the currently active dialogue box. The NPC also sets itself as the current active NPC in the dialogue manager, when the player collides with them, and sets the current active NPC back to null when the player exits the collider, so that the dialogue manager does not update any dialogue lines when the players accidentally press [space] but is not talking with any NPC.
Finally, each dialogue box has a text holder, which holds the dialogue lines for the same NPC. i.e. using the same NPC name and same NPC image.
The item inventory is originally taken from the Asset Store (see Acknoledgement), and further modified to fit the purpose of our game. Specifically, the item description that originally shows up on a tooltip (can be seen in prototype) is taken and replaced by a item description box at the bottom of the inventory (as seen in final). Players can click on each item to bring up their respective descriptions. Other scripts have also been modified to integrate with the random item spawn manager, so that when given a range of items from the database, they can be spawned randomly at various pre-defined positons.
The character profile is also from the ready-made asset, with heavily-modified UI and completely original scripts. A button prefab is made on-the-fly as each NPC gives their statements, and put into a scroll pane. The statements are made into buttons so that onClick events can be easily called when players later select item and statement pairs to find contradictions in the NPC conversations.
Statements that have to be stored in the character profile are tagged. When the dialogue manager comes across such a statement, it would update the character content manager to store the statement in the corresponding NPC's page.
Character content manager holds the NPC statements in an ordered dictionary data structure. Each key in the ordered dictionary is the NPC's name, and each value is a KeyValuePair object, with the key being the NPC's image, and the value being a list of strings consisting of its statements. As the dialogue manager updates the content, it would give its current active NPC information, e.g. NPC name and NPC image, with the corresponding statement store. The character content manager uses this information and updates its dictionary structure.
Game Overview and Required Features Selection
Mapping Critical Thinking to Game Aspects
Prototype Team Development Log