project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4
project screenshot 5
project screenshot 6

Galadriel Enigma

AN AI DRIVEN SCENARIO BASED CRIME SCENE SIMULATOR GAME TO ENHANCE INVESTIGATIVE SKILLS AND PREPARE LAW INFORCEMENT FOR REAL WORLD CHALLENGES

Galadriel Enigma

Created At

ETHOnline 2024

Project Description

Project Name: Galadriel Enigma Built On: Galadriel Blockchain Deployed Smart Contract Address: 0x0bd0f2eC1281C2678F98557FF725b572aFf91cE0

Important Files to look for: GitHub Repo -- https://github.com/Pranav9931/ethonline-galadriel

EXE File For 3D Simulation Playground -- https://mega.nz/file/eiwRlQKT#3aTzXAza14XPxo58tm2EmWc7-QGQPJqsMzUshiw_skU

Contract File: https://github.com/Pranav9931/ethonline-galadriel/blob/main/webapp/src/contracts/crimeDetection.sol

Explorer: https://explorer.galadriel.com/address/0x0bd0f2eC1281C2678F98557FF725b572aFf91cE0

Overview: Galadriel Enigma is an AI-driven, scenario-based crime scene simulation game that combines the Galadriel Blockchain and AI to create immersive, interactive crime scenes. It features a React.js web app for customizing scenes and generating evidence, along with a 3D simulation powered by Unreal Engine. Convai AI enables real-time character interaction, making investigations dynamic and lifelike. The project consists of three essential components:

  1. Blockchain Infrastructure: Powered by the Galadriel Blockchain, this ensures the decentralized, secure, and immutable generation of game data and AI-powered assets.

  2. Frontend (Web Application): A user-friendly platform where players can create custom crime stories and plots. It allows users to generate scenarios based on pre-built templates or create fully customized storylines that drive the simulations.

  3. 3D Simulation App: The crime scenes are brought to life using the combination of Convai's AI-based interactions and Unreal Engine's 3D rendering capabilities. Players can immerse themselves in a detailed and interactive 3D environment, investigating clues, examining crime scenes, and solving cases.

Key Features:

  1. AI-Driven Scenario Generation
  2. Decentralized Data & Security
  3. Interactive 3D Environment
  4. Dynamic Character Interactions
  5. Customizable Plots
  6. Smart Contract Integration

Use Cases: Galadriel Enigma can offer diverse real-world use cases beyond gaming. It can serve as a training tool for law enforcement professionals, providing AI-driven crime scene simulations in a risk-free environment. Educational institutions can integrate it into criminal justice programs, allowing students to practice investigative techniques. Researchers can utilize it for psychological studies, analyzing behavior in high-stress scenarios. In entertainment, Galadriel Enigma can be adapted into interactive crime-solving games or TV shows. Lastly, it gamifies criminal justice for casual users, offering an engaging, immersive experience where players become virtual detectives solving crimes and uncovering mysteries.

Vision & Future Potential: Galadriel Enigma transcends the boundaries of traditional games and hackathon projects. The platform is designed to evolve into a comprehensive tool for education, law enforcement, and entertainment. With its unique combination of blockchain, AI, and 3D simulation, Galadriel Enigma has the potential to disrupt multiple industries, making complex simulations accessible, engaging, and interactive.

How it's Made

The key technologies used:

  1. React.js (Frontend development)
  2. TypeScript (Frontend typing)
  3. Context API (Global state management)
  4. Galadriel Blockchain (Smart contracts for AI interaction and on-chain evidence storage)
  5. OpenAI (ChatGPT Plugin) (AI-driven story creation)
  6. DALL-E Plugin (Custom visual evidence generation)
  7. Convai (AI-driven character interaction)
  8. Unreal Engine (3D environment simulation with procedural generation)
  9. WalletConnect APIs (Wallet integration and smart contract interaction)

Explanation: How It's Made: Galadriel Enigma?

Web Application: React.js with TypeScript The web app is built using React.js with TypeScript, ensuring a scalable and type-safe development environment. It serves as the platform where users can create custom crime scene plots.

-- Plot Creation

  1. Scene Customization: Users begin by selecting a preset scene like "The Building." They can customize parameters such as width, height, and the number of floors. These parameters are stored using React's Context API, which efficiently manages state across components. This ensures that any customizations are globally accessible throughout the application.

  2. Evidence Selection & Generation:

    1. Preset Evidence: Users can choose from predefined evidence like blood stains or a knife. 2.2. Custom Evidence Generation: For custom evidence, the web app calls the Galadriel Blockchain's smart contract, specifically the initialiseImageGeneration function. This integrates Galadriel's DALL-E plugin to generate on-chain evidence images in real-time. These pieces of evidence are also stored in the app’s context.
  3. Character Selection & Creation: Users can either choose a character from presets or create one using Epic’s METAHUMAN Creator. Each character includes details like name, complexion, crime records, and judicial bail status. The character creation process is dynamic, allowing seamless integration with the METAHUMAN platform to bring realistic avatars into the game world.

  4. Context Management: As users define their scene, evidence, and character, a floating box appears in the top-right corner of the screen. This box tracks and displays the current selections for all three variables. The Create Story button within the floating box triggers the next step.

-- Story Generation (via Smart Contract and OpenAI): Once the user finalizes the context, the web app interacts with a Galadriel Smart Contract by calling the sendMessage function. This function uses OpenAI’s ChatGPT plugin to generate a relevant story or plot based on the user’s selected scene, evidence, and character. The generated plot is then sent back to the frontend and displayed in a dialog box, along with the user's chosen variables.

-- Convai API for AI-Driven Character Interactions: Next, the user submits the generated plot and associated context, triggering an API call to Convai. Convai is a platform that combines Speech-to-Text (STT) and Text-to-Speech (TTS) capabilities, enabling realistic character interactions. The API call sets the character’s name and the plot as its backstory, making the character respond contextually during interrogations.

3D Simulation: Unreal Engine After the plot setup is complete, the experience transitions to a fully interactive 3D simulation built in Unreal Engine. The simulation uses procedural generation tools to dynamically construct the scene based on the variables selected in the web app.

  1. Scene Customization: The same parameters defined for the scene (e.g., the number of floors, width, etc.) are passed to Unreal Engine to procedurally generate "The Building" environment. This creates a tailored 3D space that reflects the user's customizations.

  2. Character Integration: The character created or selected via METAHUMAN is imported into the simulation. Users can see the character within the environment and engage with them in a game-like setting.

  3. Investigative Interactions: Players can roam around the 3D environment, searching for clues and interrogating the character using Convai’s AI-driven responses. The interrogation becomes more immersive as players can ask relevant questions, and the character responds based on the backstory set earlier.

Hacky Yet Notable Integrations

  1. Context-Based Story Creation: The seamless combination of web-based context storage and blockchain-based smart contracts allows users to generate customized crime plots in real-time, a unique integration of multiple cutting-edge technologies.

  2. On-Chain Image Generation: By utilizing the Galadriel Blockchain and DALL-E, the project generates custom evidence images and stores them on-chain, which is an innovative approach in merging AI image generation with blockchain immutability.

  3. Dynamic API Orchestration: From evidence generation to AI-driven character interrogation, the project orchestrates multiple APIs (Convai, OpenAI, and Galadriel Smart Contracts) to create a cohesive and immersive user experience.

Galadriel Enigma brings together blockchain, AI, and 3D simulation technologies to deliver an interactive, customizable, and procedurally generated crime scene experience, demonstrating the power of modern tech stacks in gaming and real-world applications.

background image mobile

Join the mailing list

Get the latest news and updates