Join us in Outworldz at www.outworldz.com:9000 or follow us:

[Table of Contents]

Characters Matter: The Power of NPCs in Opensimulator

Opensimulator offers a vast and beautiful landscape for exploration. Until recently including interactive characters in a build was so time-consuming and complicated few builders bothered. A growing set of easy NPC tools make it possible for anyone to add unique characters to their builds without knowing anything about scripting. Nara Malone and Fred Beckhusen talk about the tools they used in the Immersive Edge Hypergrid Story and how they are used in the Outworldz regions.

Slide 1

We’ve spent a several years working together on NPC scripts, trying to make things non-scripters. Here’s a few of the ones I’ll talk about in more detail today. We’ve spent a lot of time on the all-in one script, bit even it isn’t right for a lot of uses.

NPC controller scripts range from pose ball that hold an animation and a NPC. These have grown up, and now support multi NPC uses, such as NPC dance floors. You can even use NPCs in presentation HUD, like the one that Nara is using today that make NPCs and objects appear on stage when she clicks a button.

There are a lot of special NPCs that are open source. Followers are critters that follow people, attackers are used in simple games, then there are the fun toys – like ridable tigers and elephants. NPCs make great vehicles, too, such as a dinosaur.

They are obviously great for gaming. We’ll show a bit of the Pirate game and some flying dragon uses.

NPCS are very general purpose. In regular gaming, a NPC can be a 2-D pop up box on a HUD , as in a classic video game like Grand Theft Auto - or maybe a painting like in the Harry Potter movies. I have used NPCs for years for talking, interactive signs. I digitized Nara Malone over in the Plaza 3 where you can talk to her and she will chat back with facial animations and text to speech. .This type of NPC has also very been useful for me in making speaking translators since about 2008. I have also also used as as a text to speech engine for vision-challenged individuals, who cannot easily read the screen.

Aine Caoimhe has made several very interesting and easy to use NPC controllers. Her poseball is probably the most popular NPC controller of all time. You just add animations and touch it and it just works. The dance floor is multi-NPC capable, and the PMAC system she made for animating people works just as well on NPCS.

The all in one is where I spend most of my time. I took a lovely script from Wizardry and Steamworks and refactored it into an NPC engine. You need one script, a walk and a stand animation, and you have a very flexible NPC engine. It is both an engine and a recorder, so you can just wear the prim on your HUD display, walk or fly around and click the prim to save your new NPC path. After recording the program, you click Save and then Start, and your NPC will appear and follow all your instructions. Its really easy to use.

The latest rev 4.6 also added some new commands for the Hypergrid story project so NPCs can open doors and teleport, and it got expanded into a interactive story telling engine. A link message can change the NPC behavior, just like calling a subroutine. A script can compute a new note card, and then execute it, so programs and data are no longer separate. You can add on code tro do almost anything – like use a web page or a external database to store your NPC actions, then fetch thaty via HTTP, write a note card and execute it.

Here is a sample “Wander” – very similar to what I use for my cows and zebras in our virtual Africa.

It spawns a NPC, makes it wander around a 20 meter radius, and repeats over and over 10 times.

This is the All-in-One’s most useful function.

Here is just a few of the many things I use it for in the Outworldz.

But they do not interact with people. Nara and I worked with about 25 people in the Hypergrid stories project to come up with ways to make NPCS interact with people.

There are now several NPC controllers that interact with the All In one to control it and interact with people. Typically you bump into an invisible object and a collider sends a single line of code to the All in one to make the NPC do something. Usually it says to play a notecard.

A sequencer can be used to control many NPCS in parrael, all in sync with each other, with one script. They have a who what when like syntax.

Here is a simple notecard when someone bumps into an invisible prim, the NPC would walk 5 meters North, type for 2 seconds, and then say Hello, like a person would.

Mirrors were just something I dreamed up to see if it could be done. The original NPC mirror showed a copy of the person that sat on a pose ball. Then Nara ran off with it all excited and got designers like Avia Bonne to turn it into something beautiful.

You need a few tools to use it. Here is a web site that can mirror your BVH to make the exact same animation in a mirrored format. The Immersive Edge HyperGrid Story project expanded this to handle multiple mirrors, and added a NPC controller/sequencer to shape shift the NPC dancers.

http://tali.appspot.com/bvh/bvhmirror.html

https://www.outworldz.com/cgi/freescripts.plx?ID=1023

Long-Term Memory & Gossip: Bots on the Personality Forge will remember things about people and other Bots they converse with, and bring them up in later conversations. Bots will even gossip- they'll tell whoever they're chatting with things they learned about others.

Emotions: They understand the difference between insults and compliments and will react accordingly. Bots will also remember how you treated them and form emotional attachments or aversions to you.

Sentence Fragments & Spell-Correcting: Corrects common mistakes, run-together words, scrambled words, and phonetically spelled words. The AI Engine can also fill in most sentence fragments.

Sentence Structure Comprehension: Bots now comprehend the structure of a sentence- how words relate to each other. This underlies a lot of the new features. The AI Engine also understands phrases of direct address, such as "How are you?" and "Hey jerk, get a room!" 

"What Noun" Question Answering: Bots can now answer all questions phrased in the form "What noun...". For example, if you were to ask a bot "What sort of dessert do you want to sit on?", the bot would answer something like "I want to sit on an apple dumpling." 

http://www.personalityforge.com/

I have some “I Love Ewes” that love to follow you around There is also a pair of cats floating around the sims. These were originally designed to be herded into a pen for a now-obsolete game, but they are still fun to have around. These were modified into attackers like crocodiles and snakes for the HyperGrid Story by adding a teleport script to them. I use these with abominable snowmen to keep people out of the ice castle.

https://www.outworldz.com/YoFrankie/ 

This picture sums up the Diablo game in one graphic. This is now possible in Opensim and is mainly what I am back to working on. Outworldz has snakes and crocodiles that will attack you. We also used these in the Hypergrid story to zap people away.

https://www.outworldz.com/cgi/freescripts.plx?ID=1085 

This an old SL game I ran for years in SL. These were crudely sculpted, prim-animated creatures that rode around on an invisible car. The car wa autonomous – self directed.. It tried to steer in frint of you and stop. It prim animated the gadget on top to whack you or zap you in some way. The sword animated you when you fought, or got hit.

It is converted to NPCs in Opensim

https://www.outworldz.com/secondlife/demons/ 

This is my first draft of that I just set out at AvatarFest. It has fully articulated, boned skeleton NPCs. Well they are skeletons with an armature, so they are boned bones. They are animated with BVH files, and thus are much more realistic and better animated than is possible in Second Life.

Anyone that gets near gets attacked – as many as I want to can attack, as fast or as slow as I want.

This is not Second Life, so I can animate you and teleport you away when you die without asking for permissions or needing the avatar to cooperate and attach a sword. Basically, Opensim combines the equivalent of Experience Keys from Second Life with the old libOpenMetaverse bots but without needed either. And it’s a LOT easier to do this in Opensim.

Lets talk about the next level of NPCs… Rideables Who would not want to ride a tiger? A couple of years ago I made a tiger avatar, and Nara, who wrote a book called the Tigers Tale about shape shifting tigers, really wanted a rideable tiger. So it evolved into half-atars. The bottom half was a Pantherian tiger avatar, the top a fake person. That wasn’t what we really wanted which was a truly rideable animal, but the only way to make a rideable tiger was by using a bot, and two people vehicles didn’t work here. That evolved as Opensim got better at multi-passenger vehicles and the bulletsim developers fixed the vehicle issues. So this tiger is basically a car with two passengers. One is a NPC. And speaking of evolution…

https://www.outworldz.com/cgi/freescripts.plx?ID=996 

Has anybody here ever had this dinosaur place mat? Dinosaurs with two legs are easy to make into NPCs. Four legged ones require different animations, but that’s not that hard these days once you know Blender. We made Dinotopia-like sim to mix my NPC doinosaurs, like the T-rexes and Velociraptors with people. And since we have the tiger rider...

We added more seats and now there is a scale 5 passenger Argentinosaurus dinosaur rider. It’s 30 to 40 meters long, and weighed maybe 80 tons.

I was thinking about Spock in the the Wrath of Khan episode one day – the scene where he realized that Khans pilot was flying around the Mutara nebulae in a 2-D pattern. I immediately realized I could make flying creatures. Dragons. Oh boy oh boy.

This is based on a script Shin Ingen gave me for a nifty helicopter script, and tada! We have a ridable dragons. You can fly around and catch sheep and cows to feed them. They since been extended by Vegaslon Plutonian to have flames, scorekeeping and can walk or fly. This makes it Player Plus NPC versus Player Plus NPC.

What's Next?

I am working on autonomous behavior in the dragons. This means they drive the vehicle they fly on, without a passenger. So we can play higher level games, such as defend the castle, or have dragon versus dragon wars. The trick is that they self direct themselves which requires a new layer of NPC control.

This could also be used in cars to make racing games, but ideally you want to have a non collidable surface such as water or air to work in in case the NPC gets stuck on something.. So think of airplanes piloted by NPC pilots that can dogfight you.

Links

Presented by Nara Malone and Ferd Frederix

Web sites: http://www.NarasNook.com

Back to the Best Free Tools in Second Life and OpenSim.