Barotrauma

Barotrauma

AI NPCs
RubbingMyAxe  [developer] Nov 15, 2023 @ 6:15pm
Second Update
Big update!

First, I've added new chat commands to view and edit the configuration settings so you no longer have to manually edit the configuration file! In multiplayer, only players that have permission to manage server settings can use these commands.

The commands are:
  1. !listconfig = Will list all of the configuration settings and their values (including your OpenAI API key!) in the F3 console.
  2. !getconfig <setting> = Will list a single configuration setting and its value in the F3 console.
  3. !setconfig <setting> <value> = Will set the value of a configuration setting and print the result in the F3 console.

Example usages:
  • !setconfig Language Spanish = Will set the language of ChatGPT responses to Spanish.
  • !setconfig OpenAISecretKey mykeyasdfg = Will set the OpenAISecretKey to mykeyasdfg.
  • !setconfig SessionTokenCap 5000 = Will set the max total number of tokens for the current round to 5000.
  • !setconfig SessionTokenCap -1 = Will set the max total number of tokens for the current round to unlimited.
  • !setconfig EnableForNPCs true = Will enable the experimental setting where NPCs use ChatGPT to transform their standard dialogue.
  • !getconfig SessionTokenCap = Will print the value of the SessionTokenCap setting to the F3 console.

https://i.imgur.com/PCdTXv6.png

I have added almost universal language support via the Language configuration setting. Set this to any language (real or imagined) and all ChatGPT output will be transformed. For a wacky example, setting it to "like-dr-suess-book-character" will make the NPCs talk in rhyme.

I have also changed the way conversations and backstories are saved. At the start of a round, a folder is created using the map or level seed. All data for the session is stored in there. In a campaign, the map seed is the same throughout so this allows all data for an entire campaign to be self-contained in its own folder. In a multiplayer mission or sandbox round, the saved folder will be automatically deleted after the round ends.

I have added some extra error checking throughout the code.

I have added new generic backstories to the Backstories file, and also created a new file for Unique Backstories for unique NPCs that you will probably meet during campaign play.

I have greatly enhanced the NPC chat for the EnableForNPCs setting, though it is still not as good as I would like so I have defaulted this setting to false. It is safe to enable without chewing through tokens though, because I have added a 5 second delay between when this can be triggered to prevent spamming.

I have enhanced the prompt data for outpost NPCs.
Last edited by RubbingMyAxe; Nov 15, 2023 @ 6:20pm