Anyone have any experience with custom npcs?

Anyone successful at making the custom npcs have voices/noises? They are fully custom with custom behavior and animations. i have tried creating another device that has editables to audio devices. And then calling that device from the npc verse behavior, but it doesn’t seem to work.I am just trying to get some noise out of the npcs… they are completely silent… I have sounds for them just can’t get them to sound off… if we had audio in verse asset reflection it would be great. Also uefn doesn’t have the ability to bake sounds into animations

have you seen this project? : Verse Stronghold Template

I have seen that, and I could see that working if I was using guard spawners. But I have Fully custom NPCs with their own animations( no retargeting ) Unless you know how to create listenables within my npc verse behavior that mimics the Awareness/Attacking states that the guard spawner has.

interesting, but im not sure what is not working about your set up, what code do you have running to play the sounds? you said you have editables set up to audio devices and i remember that verse stronghold template has its audio devices set to play in a similar manner

the states could be created in the form of an enum in the same style as the guards have, and the custom events are not that difficult

your game is looking good btw :smiley:

1 Like

So what I did was make a device that had only editables for audio device. Then just a function for each .Play() and .Stop(). Then in the Npc Behavior device I had something like NpcAudio.PlayShreik(). It didn’t have any errors but it didn’t work either. I am going to mess around with it some more soon after I finish correcting memory spikes in my game. So it will be the last thing I will have to do. My Npc device has states and event signals but I cannot Subscribe to them for some reason. (Subscribe is unknown identifier)

1 Like

It’s a limitation of the device. You can’t play sound on a custom NPC. This only works on guards and retargeting guards (where you can’t put animations).

Memory spikes are also a bug that should be fixed by the developers. We’ve been waiting for about a month now.

1 Like

Is there a way to mute the audio that npcs have already? For example the wolf’s howl or the raptor’s bark? And then to add to this question, is there an event that is listenable for when each state is triggered in anything other than guards?

1 Like

Yes, but it will also mute other sounds in the world.

I see… So it would mute ambiance and all? Just to clarify.

And will I be able to add other sounds or would that be muted as well>?

any update on this?

I may have it resolved… Running tests later

1 Like

Hey, I’m currently working on this as well. Could you share more about what you have tried to get this to work?

For sure… So the steps I have taken…
First of all with re targeting type npcs… You cannot mute or remove the default sounds. However If a sound plays at the exact same time, it will overlap and almost mute/replace the sound. If the sound plays every time you que it. (Random bug) But for the most part, works.
Now for custom npcs… I have tried a couple methods… This is also what I am working on atm. So I will share what works as soon as i am certain what works. But i do know that you cannot build a separate device to handle the sounds, and a reference in the npc device to it… It doesn’t work. Probably because it is very specific. For example It will trigger, but not for the npc that is spawned, so it doesn’t do it at all. The way I found this information out is I was making a state device that has multiple states. Everything in the code works. States and behavior loops worked properly. But if I used another device to change the npc devices’ state. It does and prints the functions and state changes correctly. But it doesn’t affect the npc that has spawned already… I have also tried to create events that get triggered in the npc state device, But I could not listen for them or subscribe to them… So This is every thing I have tried so far. But as i said before I am trying out something different with new information I just learned. i will get back to ya’ll with the results.

1 Like

Thanks for that explanation. I am having similar issues figuring out audio for my characters.

I had a script that teleported an audio device to the character’s location as needed. It was quite an ugly workaround, but it seemed to be working until I added many characters. Once there was a lot of demand for the audio player, the track eventually jammed up and wouldn’t play any more audio. I tried to pull audio players from a pool of devices with a queue, which worked better, but my game has many NPCs, and I still overloaded the system. It may be possible with a large pool of audio players. Managing all those devices would not be worth the headache for my implementation, so I moved on from that attempt. If you don’t need to play the audio rapidly, that workaround may be a good solution. Neither the devices nor my code produced any errors, so I’m unsure what was failing.

I will move forward with no character audio for now and hope we get more support for this before I finish my game. :crossed_fingers:

So i just found out that you can put an editable, within the npc device code, that is an audio_player_device. But in order to use it you have to first place the npc device in your level. Then you would select your verse behavior in the npc device itself and link the editable that way.
But also if you have a lot of npcs using the audio device. You will get the same error you mentioned above. If you have just a few npcs using the audio device, it doesn’t bug out too much.

If you need I can post some picture references

thank you so much for this reply! I’m still having difficulty achieving this tho… Do you think you can post those pictures?

1 Like