Assignment 01 of 3D Games Programming | MSc Game Development (Programming) | Kingston University
This project was inspired by a 2017 video from Game Maker's Toolkit, which highlighted the design issues in detective games. One of the core problems identified by Mark Brown was that players often rely on predefined dialogue options to find solutions, leading to a lack of true player agency and independent thinking.
In his words, "They (the player) are not coming up with their own thoughts so much as simply looking at the answer that sounds most sensible. Or in some cases, just guessing.”
This project aims to address this problem by utilizing OpenAI's conversational technology. It seeks to create a narrative structure that avoids giving players clues through dialogue prompts, promoting an open-ended approach where players must ask the relevant questions to uncover answers.
The project's narrative unfolds within a captivating futuristic cyberpunk backdrop, introducing players to a high-stakes challenge. The CEO of a prominent tech corporation has met an untimely demise, and players step into the role of a detective tasked with unearthing the enigma behind this murder.
To aid and hinder the player's progress are the following NPCs:
The project's narrative elements, including the plot, setting, and character attributes, are encapsulated using SerializableObjects. This modular design approach enables the effortless generation of multiple narratives by substituting pertinent objects, all without the need to alter the code that interfaces with OpenAI.
Key classes within this system include:
This project's core challenge was imbuing NPCs with distinct personalities and ensuring meaningful player-NPC interactions while maintaining narrative coherence. To tackle this, I employed a structured approach aligned with GPT best practices.
The system message structure included:
Subsequent to the system message, the conversation history of the presently engaged NPC was presented, succeeded by a user message specifying the NPC's current objective, and concluding with the freshly input prompt.
The primary classes in my project that interface with OpenAI are as follows:
In cases where the processing limits defined by OpenAI were exceeded, a vector search was employed to segment the conversation history into manageable chunks. This approach involved a straightforward in-memory scan to extract the relevant conversation chunks. The implementation of this strategy was the responsibility of the following key classes:
To address potential extended wait times arising from OpenAI's API calls, a timeout feature has been successfully incorporated into both the GptIntegrator and SystemGoalsManager components. This addition ensures a smoother and more responsive user experience. The structure of the timeout feature is outlined as follows:
A notebook-based UI was introduced to enable users to review the conversation history with various NPCs. This choice of a notebook was due to the futuristic cyberpunk backdrop of the game. It lends an extra layer of character to the detective by reinforcing the idea of the detective's meticulous nature.
In a hyper-advanced society, where cybersecurity is a constant concern, the use of a physical notebook to keep track of information emphasizes the detective's careful and security-conscious approach, as opposed to relying on potentially vulnerable electronic devices.
Emotional Response Integration: Enhance the player experience by implementing a system that gauges the AI's response mood and synchronizes relevant character animations to convey emotions effectively.
Assistant AI for Player Guidance: Consider the incorporation of an assistant AI to offer subtle hints and guidance to players when they encounter challenges or pursue incorrect lines of deduction. This addition can contribute to a smoother and more engaging gameplay experience.
Flexible Goal Management with a Director AI: Implement a director AI to enhance the flexibility of NPC goal management. This dynamic system can adapt, improve, and adjust NPC goals to create a more fluid and responsive narrative, further enriching the player's interaction with the game.