Luke100000 / minecraft-comes-alive

Replaces Minecraft's villagers with humans, who can be interacted with.
GNU General Public License v3.0
71 stars 49 forks source link

Inworld Character AI Integration #906

Closed CSCMe closed 1 month ago

CSCMe commented 2 months ago

PR to add Inworld character AI as a supplement to the regular chatAI in Singleplayer.

Now ready for review!

Why add this? Should allow for some more varied responses from different characters.

How to use? Users need an Inworld account to use, similar to the Inworld Skyrim mod. There's a free plan with 5 000 free interactions per month, which, with ~1.1 API interactions per message and 31 days per month, equals ~140 messages per day. Character Setup is fairly uncomplicated. It only needs a name and description, more advanced stuff can be auto-generated.

What exactly? Changelog:

What does the AI know?

What's left?

Not adding:

Luke100000 commented 2 months ago

UI looks nice! 1.20.1 is fine as 1.19.2 is now LTS and wont receive updates.

Regarding my future plans so we could sync somehow: I also wanted to add heart/mood changes (this is usually synced) but I'm still unsure about its implementation.

Related to this I may want to add commands (go home, wear armor, ...), depends on whether this works reliable enough.

I wanted to add user configured system and per-villager context, which may work very well for inworld as well. It probably makes more sense to align this more with inworlds requirements.

CSCMe commented 2 months ago

Thanks for the comment! Are you planning to change how hearts and mood work in general or do you mean how it's sent to the AI?

Basic commands should be possible with Inworld, they have a goals system which you can configure to listen to certain phrases/expressions and send an event, which could then be used to trigger villager actions. Automatically setting this up, however, is linked to in-game character creation and in the far future for me.

But normal villagers wouldn't be able to use them, so maybe some other system for non-inworld characters would be useful.

Is it alright if I refactor GPT3 and related files to avoid some code repetition and make integration easier?

Luke100000 commented 2 months ago

No, just how hearts are estimated by the AI. Early experiments had issues with understanding human humor lel.

Sure, feel free to pull out common code snippets and refactor where needed.

CSCMe commented 2 months ago

Pushed the refactor. What do you think? Do you think this is something you can work with in the future?

CSCMe commented 2 months ago

That should be it for now. Feel free to review and suggest changes ^^ I can also write an entry to the wiki to explain character setup if you'd like.

CSCMe commented 2 months ago

Just noticed some conceptional issues with the way trigger event throttling is handled. Gonna fix that so InworldAI.java and SessionModule.java will change a bit