Lightweight client for NPC


#1

Hi,

I’m not sure if this has been discussed previously (i couldn’t find anything searching) but is there a lightweight version of the client to use for an NPC or a bot. I’ve noticed that some people seem to be using NPC avatars for audio streaming in domains and wondered if they are having to use a machine running the full client for this or if there is a less machine performance demanding version of the client being used.

Essentially, I don’t need to render any of the graphics but do want to be able to stream 2-way audio and access positional information about avatars in the domain.

Thanks, Martin.


#2

Perhaps you might find this helpful?


#3

Thanks, I’ve watched that video already and it contains great info but the NPC in question is simply a model with animations. For regular quest or environment NPC this would be fine, I could create and attach an AI script and have the NPC interact via text chat. I’m wanting to go a step past that, and integrate the NPC with audio as well. So I need inbound and outbound audio streams which I don’t think would be available to an entity script. Think of an NPC with Alexa or Google Assistant built into it.

I’m sure I could get this running with the main client fairly easily but don’t have a spare machine of good enough spec to dedicate to running the full fat client just for a bot.


#4

I agree with this - great idea for a low power PC…or maybe create a task try app where you could set basic avatar entity parameters - like position in the domain, audio source, visibility of the npc avatar, etc. You could log into “Interface Light” (or whatever), and set the account type to ‘NPC’ so they are not counted as human controlled avatars in the GoTo app.

Even better (and more efficient?) - I would love to be able to set a global audio stream or source audio file per zone entity - similar to how a parcel of land in Second Life has a global audio stream and video stream. Another way could be the ability to assign a streaming audio source to an entity. I would love to be able to create a virtual speaker system - assign an audio input or URL to an object. Imagine being able to set L and R channels for a source onto two cubes and place them exactly where you want the audio to project from.

While were wishing - visitor count, visitor time spent in the domain, notification options for when a visitor enters a domain and video as a texture would be great :sunglasses:


#5

Yes, that would be an incredible AI feature! I’m not sure you actually need a NPC client for this. What you need is a way to hook into the audio mixer.

The Audio Mixer mixes all sounds, whether it’s voice or environmental. And it does this not just for avatars, but also for all the entities in a domain. The Audio mixer can customize a stereo mix for you based on your position relative to the audio source.

I would think this is the only way for you to achieve what you are after. I believe that NPCs are just entities with animations as you inferred. You might want to dig into the scripting API and figure out what you need to hook the AI you desire. If the logic is there to provide text responses already then you should be able to use the same logic to provide speech if you have some rest service. You would of course need access to a Javascript API that would provide access to the rest service but I’m guessing you already have thought this part out. I think the bigger question is whether or not the rest API will run on HiFi.

https://docs.highfidelity.com/api-reference/namespaces/audio

What a NPC client would provide however is a way for someone to script a bot that could traverse domains. This might be fun but a bit dangerous because it could open ways to do malicious things. Other than that I cannot think of any advantage of having a separate client for your bot.


#6

It boils down to finding out anything regarding the assignment client’s extra function: the ability to act like an avatar.

The issue is finding said ‘anything’ since it’s barely documented that you can define an Assignment client’s properties in the first place.

So to save one part of that mystery:
assignment-client -t 2

-t defines the type of assignment client and 2 is the “agent” type code.


#7

Unfortunately, if someone was so inclined this sort of thing could already be achieved using the full client

Thanks for the pointers. I’ve started digging into the assignment clients code, but will take me a while to reacquaint myself with c++. Does look like there might be some promise there though, or I could get adventurous and either write a custom client or an extension to the audio mixer. Some of this will need to go on my futures list though as I’m looking into some others scripts for in world games, as well as brushing up on my 3d modelling.


#8

Haha, perhaps, but that doesn’t mean that someone won’t try now the cat is out of the bag… ?;O)