Skip to content

A Python script to monitor the Elite Dangerous journal files and provide data analysis and audio feedback using OpenRouter free AI services.

License

Notifications You must be signed in to change notification settings

druellan/ED-AI-Companion

Repository files navigation

ED:AI Companion

A collection of Python scripts to monitor the Elite Dangerous journal files and provide audio feedback using OpenRouter services.

This script is a work in progress, primarily for personal use, as a learning experience, and to have fun with LLMs and ED. For something more complete and polished, I recommend checking out the COVAS:NEXT project.

Goal

The idea is to provide audio feedback for the most common events in the game, such as jumps, combat, docking, etc., while using the small and free LLMs from OpenRouter. Unlike COVAS:NEXT, this project does not provide interactivity with the AI, and the intention is to have an intelligence that can provide really useful information to the player without any input.

Features

  • A minimal but descriptive prompt tailored specifically for the game. The AI can decide to analyze the events and provide feedback or just remain silent.
  • Works well with free and small models (check the list inside the config.py for recommendations)
  • Each event can have a personalized parser that can be used to add more instructions, preprocess and enrich the information with web content and third-party APIs.
  • Grouping of consecutive events to send them in bulk to the AI.
  • Damage system, the more the ship is damaged, the more the AI voice degrades.
  • The AI can make use of tools; not all the models support this, so, results can vary.
  • Memory bank:
    • ship-state.json - (fuel levels, last place visited, etc)
    • missions_memory.json - active missions
    • event_memory.json - list of the last 20.000 events in the game
    • response_memory.json - list of the last 20.000 AI responses
  • Automatic retrieval of the last events and AI responses on each prompt. Access to 100 more via the tools.
  • Average token count of 4.000 tokens per API call, can vary depending the event and the size of the memory blob.

Demo Videos

Reacting to undock, new destination, radio chatter, and system arrival (Edge TTS without audio filters)

Reacting to mining: core found (Edge TTS with audio filters)

To make it work

You might need Python 3.x installed in the system and a free OpenRouter account

  • Clone or download the repository.
  • Install the requirements with pip install -r requirements.txt
  • Copy or rename the config.py.example file to config.py
  • Open the config.py and paste your OpenRouter key on the LLM_API_KEY variable. The script should work without any other change, but take a look at the settings in case you want to change something.
  • To run the script use python main.py You can run the script right from the start or when ED: Dangerous is already running.

Cortana native voice:

If you are using the native text-to-speech Windows system (check the config file for that) and you want to have the Cortnana voice, use the registry patch file included: Microsoft-Eva-Mobile.reg to make that voice available.

Modify or create custom parsers

Just look for or create a new file in the /parsers directory using the exact name of the event you want to parse. I recommend copying another parser that provides a similar functionality to use as a template.

About the config file

I'm changing the configurations a LOT, so new versions of the project might require update the config.py file.

Inspired by the work of:

Third party APIs used:

About

A Python script to monitor the Elite Dangerous journal files and provide data analysis and audio feedback using OpenRouter free AI services.

Topics

Resources

License

Stars

Watchers

Forks

Languages