GameSense is an AI-powered dynamic commentary generation system designed to bring real-time, insightful, and engaging commentary to games, sports, and other interactive experiences. Leveraging Generative AI, GameSense analyzes gameplay or events and crafts high-quality, adaptive narratives, enhancing audience engagement.
Project built as part of the Qualcomm EDGE AI Hackathon, Bangalore.
Team Members : Hemang Mohan Vivek Kumar Yadav Archana M Ponathipan Jawahar
Socials:
| Hemang Mohan | |
| Vivek Kumar Yadav | |
| Archana M | |
| Ponathipan Jawahar |
GameSense runs on Snapdragon® NPU that delivers live, AI-powered cricket commentary using a large language model (LLM, e.g., Llama 3.2 3B) accelerated by the Genie SDK.
- Snapdragon® Platform (e.g., X Elite)
- Windows 11+
- Visual Studio 2022
- Download from Visual Studio
- Ensure "Desktop development with C++" is selected during installation
- QAIRT SDK: Qualcomm AI Runtime SDK
- See QNN SDK for older versions
For the Flask middleware, install the required Python packages:
pip install -r ChatApp/requirements.txt-
Clone this repository to obtain a local copy of
GameSense. -
Follow the LLM on Genie tutorial to generate the
genie_bundlerequired by GameSense.- If you use a Llama 3 model, GameSense will work out of the box.
- For other models, update the prompt format in
PromptHandler.cppas needed.
-
Copy the generated bundle assets to
GameSense\genie_bundle.- You should see files like
GameSense\genie_bundle\*.binandgenie_config.json.
- You should see files like
Ensure the QAIRT (or QNN) SDK version installed matches the version used by AI Hub to generate your context binaries.
You can find the required version in the AI Hub compile job details.
-
Download and install the Qualcomm AI Runtime SDK.
-
Set the global environment variable
QNN_SDK_ROOTto the root path of your QAIRT SDK installation, e.g.: "C:\Qualcomm\AIStack\QAIRT\2.32.0.250228" -
Verify your installation by running:
ls ${env:QNN_SDK_ROOT}/libIf this command lists the SDK libraries, your setup is correct.
- Ensure
QNN_SDK_ROOTis set globally before building. - Open
GameSense.slnin Visual Studio. - Build the project.
- Click the green play button to build and run.
- The project is configured with these command-line arguments:
.\ARM64\Debug\GameSense.exe --genie-config .\genie_bundle\genie_config.json --base-dir .\genie_bundle\cd {Project directory}
.\ARM64\Debug\GameSense.exe --genie-config .\genie_bundle\genie_config.json --base-dir .\genie_bundle\- Run with
--helpto see all options:
.\ARM64\Debug\GameSense.exe --help- Use
\\or/as path separators, not a single\.
Correct: C:\Path\To\Model\Config\llama2_7b.json C:/Path/To/Model/Config/llama2_7b.json
Incorrect: C:\Path\To\Model\Config\llama2_7b.json
For languages requiring Unicode, see:
UTF-8 support instructions
The Flask middleware handles audio streaming and commentary generation. It accepts game objects from the game, sends them to the backend, and converts the generated commentary to audio.
-
Navigate to the
ChatAppdirectory. -
Install the required Python packages:
pip install -r requirements.txt- Run the Flask middleware:
python SocketStream.pyThe middleware will start a server on http://0.0.0.0:5000.
- Send POST requests to
/get_audiowith a JSON body containing the game object. - The server streams audio commentary in WAV format.
Example:
curl -X POST http://127.0.0.1:5000/get_audio -H "Content-Type: application/json" -d '{"game_event": "Player scored a goal!"}'The VR Cricket Game is a Unity-based virtual reality application tailored for devices like the Meta Quest. It leverages advanced physics engines and VR controller integration to deliver a realistic cricket batting simulation. Key features include:
- Physics-Based Ball Movement: Simulates real-world cricket ball trajectories, including spin and bounce, using Unity's physics engine.
- Controller Grip Mechanics: Enables players to interact with the bat dynamically, providing precise control over shots.
- Dynamic Scoring System: Calculates runs based on ball trajectory, timing, and shot accuracy, ensuring an authentic gameplay experience.
- 6-Ball Over Format: Implements a structured gameplay mode with a live scoreboard for tracking player performance.
The game integrates with a Flask-based backend to:
- Evaluate player scores using AI-driven analytics.
- Generate real-time commentary powered by GameSense's LLM capabilities.
- Enhance immersion by delivering context-aware narratives during gameplay.
This project exemplifies the seamless integration of VR technology with AI-powered commentary systems, creating an engaging and immersive experience for cricket enthusiasts.
Demo Video: Watch Demo