Skip to content

feat: AI integration - #132

Open
jack5github wants to merge 1 commit into
peppidesu:mainfrom
jack5github:ai
Open

feat: AI integration#132
jack5github wants to merge 1 commit into
peppidesu:mainfrom
jack5github:ai

Conversation

@jack5github

@jack5github jack5github commented Jul 29, 2026

Copy link
Copy Markdown

This pull request adds the ability for Elementipelago to generate element names and icons (other than the starting elements) via a local AI model from Ollama using a queue system, and saves the generated names and icons to the multiworld storage so they don't need to be re-generated when reconnecting. The generated names and icons are different depending on where an item is coming from, where it is going to and what its item name is, and there is a small amount of randomness that goes into each prompt as well.

Note that as it is currently implemented, items sent to other players that are not ingredients (useless to the Elementipelago player) are spoiled since the AI does not change their names, and for all elements, the AI is allowed to choose from both normal element icons and substitute icons (which are both normally reversed for specific types of elements). I like these things about it.

The benefit of this new feature is that it makes element combinations and recipes more discernible, as well as more personalised to each multiworld, traits that Elementipelago currently lacks with its entirely random names and icons.

The AI integration should be disabled by default and is enabled from a new checkbox in the Settings menu. It uses the Ollama model 'gemma4:e2b' by default (the latest most-performant Google model available), but can be changed to any other model of the user's choice. Importantly, no means of changing the endpoint is provided, meaning that all generation requests will only ever be responded to locally, and there is no threat of multiworld data being sent to third parties.

Disclaimer: The code I have written was produced with the assistance of an AI agent, but know that I rewrote much of its output myself and have thoroughly tested it in multiple multiworlds, hosted both locally and online. All the comments are my own and are there for a reason. Regardless, I wouldn't mind a review of my contribution to ensure it is ready for the public. I'm also kind of sick of prompt engineering for a few days straight.

On a side note, if AI integration is enabled, the notification toast will display the item name, not the element name, as the element name takes time to generate. This was mainly just me doing the bare minimum to keep the notification looking nice. I haven't tested what happens when AI integration is off and the notification appears, so I wouldn't mind somebody check that out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant