Barotrauma 潜渊症

Barotrauma 潜渊症

AI NPCs
RubbingMyAxe  [开发者] 8 月 14 日 下午 7:39
Sixth Update
Pretty large update that fixes bugs, adds a lot of new features, and enhances existing features. Here is the change list, I did not write down everything so it's not exhaustive:

Enabled AI NPCs Options menu in multiplayer. For the server host, it will sync their changes with the server. For other players, it will only let them edit their local copy.

Disabled ai_ configuration console commands for anyone but the server host. This way other players can't edit anything that might cost the server host money. Other ai_ console commands can be used by players who have manage settings permission.

Added new Model selection dropdown to the AI NPCs Options menu. If you want to use OpenRouter for a free model, you can quickly select one by clicking the Refresh button and selecting the model you want to use.

Fixed scrollbars on the multi-line textboxes on the AI NPCs Options menu.

Improved the fabrication order by allowing it to empty the fabricator's output slot before starting, and wait until an item has finished crafting. It also gets craftable recipes based on the Fabricator's ingredients plus the content of the NPC's inventory.

Fixed error message with "broken english" NPCs.

Fixed error with Mission text not being sanitized properly.

Changed item name references to use prefab names for better localization support.

Changed the way Orders are created and assigned to make it a lot more flexible. They are now associated with a Chat Commands order that gets assigned to the NPC and can be dismissed to get them to stop.

Changed the Orders prompt to allow two word targets instead of just one. This will increase the accuracy of many commands. (e.g. "Go to ballast A" will now go to Ballast Tank A instead of just a random ballast tank.)

Added tooltips to the Chat Commands order icon that display the NPC's current command.

Added separate API Endpoint/Model/Key settings to allow for using free, cheap, or locally hosted models for Orders.

Character information is now stored in a directory based on a unique ID instead of just by their name. This prevents NPCs with the same name from sharing conversation history.

Store and display total tokens used per endpoint.

Added experimental memory system that can record the memories of crew member deaths to all current crew members. They may recall the information if the topic comes up in conversation. May be expanded on later.

Added IncludeAppearanceInfo setting that lets you turn off appearance information (hair, facial features) from being included in the prompt.

Added experimental Speech to Text system. On pressing or holding a configurable key (defaults to V), it will record your voice, transcribe it to text, and then send that text as a chat message. This is entirely separate from the game's VOIP system, so you could communicate in text chat messages by using your voice. It also allows you to talk to or give orders to NPCs. Supports foreign languages and uses the game's Language setting. Can use a transcription API or an included program called Whisper.

Added API Endpoint/Model/Key settings for using API transcription instead of local transcription with Whisper. Only tested with OpenAI.

Added experimental Text to Speech system for Singleplayer. When enabled and provided with API information (currently supports OpenAI and ElevenLabs), it will convert the bot's AI chat message into sound that is then played through a simulation of the game's VOIP system.

Added experimental GetIngredientsBeforeFabricating setting which makes the Fabricate command gather ingredients for a recipe if the fabricator does not already have them stocked.
< >
正在显示第 1 - 7 条,共 7 条留言
RubbingMyAxe  [开发者] 8 月 14 日 下午 7:49 
Probably my favorite new feature is the Speech to Text system. This allows you to communicate and give commands to NPCs via your microphone! It can be done locally for free using the included Whisper and tiny transcription models, or via an API. API is faster, but will cost money (only OpenAI transcription API has been tested so far, others can be added by request.). Just set the key you want to use to trigger microphone recording in the AI NPCs Options menu, it defaults to V. Make sure you have a microphone selected in the game's settings menu!

Second favorite new feature is the extra information given to each order, which allows the NPCs to be much more accurate in selecting the targets of their actions.

I've also laid the groundwork for letting NPCs use a Text to Speech system in their replies. Only works with OpenAI right now and selects one of two voices depending on gender, but this will be expanded and more customizable in future updates. It simulates the in-game VOIP completely and adds radio static for radio chat, distance garble for local chat, uses the game's directional voice and attenuation settings, etc.

Try out the new GetIngredientsBeforeFabricating setting, which lets NPCs look for ingredients for crafting recipes if they aren't available in their inventory or on the fabricator (or its linked cabinet). NPCs will also clear out the fabricator's output and mark the item for cleanup, so idle NPCs will store the items. If an item has a short crafting time, they will wait near the fabricator for it to complete before continuing commands.
Daratra 8 月 15 日 上午 10:09 
This sounds awesome. Thank you for your amazing work! Gotta' test this out.
RubbingMyAxe  [开发者] 8 月 15 日 下午 2:58 
Updated with a hotfix for a couple of issues I found with outpost NPCs.
RubbingMyAxe  [开发者] 8 月 16 日 上午 2:40 
引用自 Daratra
This sounds awesome. Thank you for your amazing work! Gotta' test this out.
IMO the voice commands are kind of a game changer... You can make bots do very complicated tasks and it's very quick, especially when using a transcription API. And you can assign the tasks while doing other things, without having to stop and type or use the order wheel.

In the middle of fighting something and need railgun shells? Ask a bot to craft two of them and bring them to you. Or need ammo recycled? With the "get ingredients before fabricating" setting turned on, you can tell a bot to craft coilgun ammo and it will automatically use the recycle recipe if there is near empty ammo box on the submarine. About to go on expedition but need some meds? Ask a bot to bring them to you, they can handle a very long list and will put the items directly into your inventory. You can be piloting the sub during an attack and request information about broken devices and hull breaches, send bots to those areas to perform repairs, make bots change guns, etc. without ever deselecting the navigation console.
Daratra 8 月 16 日 上午 4:17 
Yeah, real-time orders while being otherwise busy (i.e. fighting) have been a godsend.

However, sometimes they do not bring the correct amount. I ordered an NPC to bring me 5 bandages, 4 morphine, 3 naloxone and 2 saline. It brought me 5 bandages and 1 saline - nothing else. The ChatGPT logs show that it did receive my orders properly, and AI responded that they'll bring what I asked. That leads me to believe the AI orders has some issues. It seems the AI orders translate the items to random ones sometimes "Bring me shotgun shells" somehow translates to "Bring me shotgun". I'll keep testing, though the verbose debugging is kind of confusing me how it works.

I also noticed you fixed the outpost NPC's following your orders. Now how am I supposed to get them to follow me into the airlock? :D
RubbingMyAxe  [开发者] 8 月 16 日 上午 8:58 
Are you looking at the HTTP_Response_Orders file? That's the one that should be outputting the exact commands that I parse.

The logic for finding the item to get is pretty complicated, maybe over-complicated but I wanted it to search tags and identifiers and names so that it could be as general as possible. That's why "take my gun" works if you're carrying a revolver, it's searching the tags too.

For the shotgun issue, I made ammo require two words and weapons only require one. This way "bring me a shotgun" will always find a shotgun instead of a shotgun shell. I used to exclude ammo completely from the GET command to fix this, but I enabled it now that I am passing two words because it works for most of the ammo. Maybe it would help the LLM if you specified the amount of shotgun shells? Try "bring me 8 shotgun shells".

"Bring" is basically a combination of a GET and a GIVE_ME. If you ask the bot to bring you a bunch of stuff, the LLM is instructed to output all the GETs first and then a GIVE_ME for each GET. So maybe that part is failing in your LLM's output? Did the bot have all of the items in his inventory, but only gave you 6 of the 14? Or did he only get the 6?

If you're interested in helping try to work out the kinks sometime let me know on the discord. Before I sent out the update I was testing "bring me" commands with lots of items and it seemed to work well, but it could vary depending on a lot of factors...
RubbingMyAxe  [开发者] 8 月 16 日 上午 9:00 
And yeah, I had turned off some of the checks for outpost NPCs when I was testing some things (mainly controlling pets) and didn't turn them back on before the update. I am working on a separate system for outpost NPCs, so instead of reacting to direct commands given by players they will react to actions based on their personality, job, equipment, etc.
< >
正在显示第 1 - 7 条,共 7 条留言
每页显示数: 1530 50