This is my Final Year Project (FYP) exploring an AI-powered dynamic narrative system for RPGs. The project investigates how Large Language Models (LLMs) can be constrained to produce coherent, thematically consistent narratives in real-time game experiences.
Department of Informatics, University of Sussex
Glorious Deliverance Agency 1 is a 2D RPG about a reluctant hero in a dysfunctional team whose attempts to save the world with "positive energy" keep making reality worse. The game uses a Reality vs Positive Energy framework as a satirical critique of toxic positivity and hustle culture.
The repository contains the Godot project, source code, assets, automated tests, CI/export configuration, MCP agent integration, and academic report materials. The project targets Godot 4.7-beta1.
-
Clone the repository:
git clone https://github.com/dun4law/Final-Year-Project.git cd Final-Year-Project -
Open the project in Godot:
- Open Godot.
- Click Import.
- Select the root
project.godotfile. - Run the project from the editor.
-
Or run from the command line:
# Launch the game godot4 --path . # Open in editor mode godot4 --path . --editor # Run the full test scene godot4 --headless --path . --scene "res://1.Codebase/src/scenes/tests/all_tests_runner.tscn"
The configured startup scene is res://1.Codebase/src/scenes/ui/splash_sequence.tscn. The main menu scene is res://1.Codebase/menu_main.tscn.
Final-Year-Project/
├── .github/ # GitHub Actions configuration
│ ├── actions/
│ │ └── setup-godot/ # Custom action for downloading Godot and export templates
│ └── workflows/
│ ├── build_game.yml # Manual export and release workflow
│ ├── codeql.yml # CodeQL analysis
│ └── run-tests.yml # Unit test and asset import workflow
│
├── 1.Codebase/ # Godot game code, assets, tools, tests, and MCP server
│ ├── generated/
│ │ └── embedded_skill_registry.gd # Generated in-game skill registry
│ ├── localization/ # CSV and compiled Godot translation files
│ │ ├── gda1_translations.csv
│ │ ├── gda1_translations.de.translation
│ │ ├── gda1_translations.en.translation
│ │ ├── gda1_translations.zh.translation
│ │ ├── intro_story_pages.csv
│ │ ├── intro_story_pages.chapter.translation
│ │ ├── intro_story_pages.image.translation
│ │ ├── intro_story_pages.text.translation
│ │ └── intro_story_pages.title.translation
│ ├── mcp/ # Python MCP server for external AI-agent control
│ │ ├── README.md
│ │ ├── connection.py
│ │ ├── pyproject.toml
│ │ ├── server.py
│ │ └── tools.py
│ ├── src/ # Runtime game source and resources
│ │ ├── assets/ # Game images, fonts, music, sound, and UI media
│ │ │ ├── achievements/
│ │ │ ├── backgrounds/
│ │ │ ├── characters/
│ │ │ ├── font/
│ │ │ ├── icons/
│ │ │ ├── music/
│ │ │ ├── rebirth_challenge/
│ │ │ ├── sound/
│ │ │ ├── ui/
│ │ │ ├── home.png # Home screen screenshot
│ │ │ ├── logo.png
│ │ │ └── game_name.png
│ │ ├── scenes/ # Godot scene files (.tscn)
│ │ │ ├── tests/ # Test runner scenes (all_tests_runner, audio, ui, etc.)
│ │ │ └── ui/ # 35 UI and game-flow scenes
│ │ │ ├── splash_sequence.tscn
│ │ │ ├── start_menu.tscn
│ │ │ ├── story_scene.tscn
│ │ │ ├── settings_menu.tscn
│ │ │ ├── journal_system.tscn
│ │ │ ├── prayer_system.tscn
│ │ │ ├── trolley_problem_overlay.tscn
│ │ │ ├── night_cycle_overlay.tscn
│ │ │ ├── hmd_chat_overlay.tscn
│ │ │ ├── gloria_intervention_overlay.tscn
│ │ │ ├── fsm_challenge_overlay.tscn
│ │ │ ├── fsm_rebirth_explanation.tscn
│ │ │ └── ...
│ │ ├── scripts/ # Typed GDScript source
│ │ │ ├── core/ # Core systems and autoload-backed game services
│ │ │ │ ├── agent/ # In-game agent server bridge
│ │ │ │ │ ├── game_agent_server.gd
│ │ │ │ │ ├── agent_action_executor.gd
│ │ │ │ │ ├── agent_protocol.gd
│ │ │ │ │ └── game_state_exporter.gd
│ │ │ │ ├── ai/ # AI providers, prompt building, parsing, routing, and voice support
│ │ │ │ │ ├── managers/ # AI config, context, request, usage, voice, and build-secret managers
│ │ │ │ │ │ ├── ai_config_manager.gd
│ │ │ │ │ │ ├── ai_context_manager.gd
│ │ │ │ │ │ ├── ai_provider_manager.gd
│ │ │ │ │ │ ├── ai_request_manager.gd
│ │ │ │ │ │ ├── ai_usage_stats_store.gd
│ │ │ │ │ │ ├── ai_voice_manager.gd
│ │ │ │ │ │ └── build_secrets.gd
│ │ │ │ │ ├── gemini_provider.gd
│ │ │ │ │ ├── claude_provider.gd
│ │ │ │ │ ├── openai_provider.gd
│ │ │ │ │ ├── openrouter_provider.gd
│ │ │ │ │ ├── ollama_provider.gd
│ │ │ │ │ ├── lmstudio_provider.gd
│ │ │ │ │ ├── xiaomi_provider.gd
│ │ │ │ │ ├── ai_router_provider.gd
│ │ │ │ │ ├── ai_prompt_builder.gd
│ │ │ │ │ ├── narrative_prompt_builder.gd
│ │ │ │ │ ├── narrative_response_parser.gd
│ │ │ │ │ ├── scene_directives_parser.gd
│ │ │ │ │ ├── voice_session_manager.gd
│ │ │ │ │ └── voice_bridge.gd
│ │ │ │ ├── cli/ # In-game developer CLI commands
│ │ │ │ │ ├── cli_command_parser.gd
│ │ │ │ │ ├── cli_ai_commands.gd
│ │ │ │ │ ├── cli_game_commands.gd
│ │ │ │ │ └── cli_save_commands.gd
│ │ │ │ ├── game_state.gd
│ │ │ │ ├── ai_manager.gd
│ │ │ │ ├── save_load_system.gd
│ │ │ │ ├── audio_manager.gd
│ │ │ │ ├── achievement_system.gd
│ │ │ │ ├── teammate_system.gd
│ │ │ │ ├── trolley_problem_generator.gd
│ │ │ │ ├── skill_manager.gd
│ │ │ │ ├── mission_scenario_library.gd
│ │ │ │ ├── butterfly_effect_tracker.gd
│ │ │ │ ├── event_bus.gd
│ │ │ │ ├── localization_manager.gd
│ │ │ │ ├── tutorial_system.gd
│ │ │ │ └── ... # Additional core service scripts
│ │ │ ├── tests/ # Script-level test support
│ │ │ └── ui/ # ~88 UI controllers, overlays, menus, and story scene modules
│ │ │ ├── story_scene.gd
│ │ │ ├── start_menu.gd
│ │ │ ├── journal_system.gd
│ │ │ ├── settings_menu.gd
│ │ │ ├── prayer_system.gd
│ │ │ ├── hmd_chat_overlay.gd
│ │ │ ├── night_cycle_overlay.gd
│ │ │ ├── trolley_problem_overlay.gd
│ │ │ ├── gloria_intervention_overlay.gd
│ │ │ ├── ai_settings_menu.gd
│ │ │ ├── butterfly_effect_panel.gd
│ │ │ └── ...
│ │ └── skills/ # Prompt skills used by the narrative/agent systems
│ │ ├── character-profiles/
│ │ ├── choice-followup/
│ │ ├── consequence-generation/
│ │ ├── entropy-effects/
│ │ ├── force-mission-complete/
│ │ ├── game-recap/
│ │ ├── gloria-intervention/
│ │ ├── hmd-chat/
│ │ ├── honeymoon-phase/
│ │ ├── intro-story/
│ │ ├── mission-generation/
│ │ ├── night-cycle/
│ │ ├── prayer-system/
│ │ ├── scene-directives/
│ │ ├── teammate-interference/
│ │ └── trolley-problem/
│ ├── tools/
│ │ └── test_agent_client.py # Manual MCP/agent test client
│ ├── Unit Test/ # Godot unit, integration, and regression tests
│ │ ├── integration/
│ │ │ ├── test_achievement_unlock.gd
│ │ │ ├── test_ai_narrative_parse.gd
│ │ │ └── test_story_flow.gd
│ │ ├── all_tests_runner.gd # Main test entrypoint
│ │ ├── prompt_tests_runner.gd
│ │ ├── quick_verify.gd
│ │ ├── ui_tests_runner.gd
│ │ ├── test_achievement_system.gd
│ │ ├── test_ai_context_compression.gd
│ │ ├── test_ai_prompt_builder.gd
│ │ ├── test_ai_providers.gd
│ │ ├── test_butterfly_effect_tracker.gd
│ │ ├── test_game_state.gd
│ │ ├── test_journal_save_load.gd
│ │ ├── test_player_stats.gd
│ │ ├── test_save_load_system.gd
│ │ ├── test_teammate_system.gd
│ │ ├── test_trolley_problem_generator.gd
│ │ └── test_*.gd # 56 top-level test scripts
│ └── menu_main.tscn # Main menu scene
│
├── 2.Report/ # Academic report and supporting materials
│ ├── github_action_unit-test-results/
│ │ ├── summary.md
│ │ └── test-output.log
│ ├── Final_Report_281967.pdf
│ ├── Interim Report_281967.pdf
│ ├── Poster_281967.pdf
│ ├── Presentation_281967.pdf
│ ├── appendix_f_ai_generation_examples.pdf
│ ├── ai_usage_2026-04-02_04-12-03.csv
│ ├── ai_usage_2026-04-15_02-03-38.csv
│ └── ai_usage_2026-05-01_10-54-41.csv
│
├── 3.Pre-Built V1.0/ # Pre-built game binaries for v1.0
│ ├── GDA1-linux-amd64.deb
│ ├── GDA1-linux-arm64.deb
│ ├── GDA1-web-game.zip
│ └── GDA1-windows-game.exe
│
├── .gitattributes
├── .gitignore
├── 281967_submission_info.txt # Submission metadata
├── LICENSE.md # MIT license
├── export_presets.cfg # Godot export presets
├── project.godot # Godot project settings, autoloads, and main scene
└── readme.md # Project overview and structure
Run the full test scene locally:
godot4 --headless --path . --scene "res://1.Codebase/src/scenes/tests/all_tests_runner.tscn"The GitHub Actions test workflow also imports assets, checks generated .import and .translation files, audits that test_*.gd files are covered by CI entrypoints, runs the Godot test scene, parses results, and uploads test artifacts.
The repository uses GitHub Actions for automated builds and releases.
build_game.ymlis manually triggered withworkflow_dispatch.- The workflow exports Web, Windows, Linux x86_64, and Linux ARM64 builds.
- Linux builds are packaged as
.debfiles. - Release artifacts are uploaded to a generated GitHub Release.
- The Web build is deployed through GitHub Pages.
Export presets are defined in export_presets.cfg for Linux, Windows Desktop, macOS, Web, and Linux ARM64. The current automated workflow exports Web, Windows Desktop, Linux x86_64, and Linux ARM64.
This project is licensed under the MIT License. See LICENSE.md for details.
