- Posted May 5, 2012 by
This iReport is part of an assignment:
Stories from Second Life
Lindens Launch 100 Pathfinding Sims
Artificial Intelligence (AI) has gone viral on Second Life's main grid. A new technology called pathfinding embeds AI in SL servers. On over 100 sims, AI characters can navigate intelligently among avatars, terrain, walkways, and obstacles, with behaviors such as pursuit, wander, evade, patrol, and navigate to location.
Any of these behaviors can be invoked with 2 lines of Linden Scripting Language (LSL)… to automatically move mesh or classic prim objects… possibly replacing hundreds of lines of vehicle animation code. Is this just a reduction in user code or something more? Yes, much more.
Pathfinding is a new mobility ecosystem. Pathfinding can calculate all feasible pathways across land and prims (e.g. bridges), generating a navimesh (picture 5). Pathfinding characters (aka Non Player Characters or NPC) use AI searches to find navigable pathways to their target avatar, object, or location. Throw up a roadblock? No problem, they will find another way round. There is enough randomness and simulated nervousness in the solution, that NPCs have distinctively organic motions.
Yeah, but what about lag? Everyone asks. Okies. I ran stress tests with my animated NPCs on the Snack Sandbox regions. Kitty is a 4 legged animated critter that walks; Funky Munky is a humanoid NPC that strides and does a funny skit (Pictures 7, 8, 9). I took baseline performance stats, then starting rezzing wandering NPCs simwide; hundreds of them.
As I watched the lag numbers; a startling result! At first, only 2 numbers trended with added NPCs, Physics Time went up and Spare Time went down. All other numbers flatlined... no lag effect! Just over 100 NPCs and Spare Time hit zero; the first noticeable lag. Amp that up to 200 NPCs, and yes, we are driving frame time up as well, but linearly, not aggressively. Even more surprising, virtually no NPCs crashed. After rezzing 200 kitties, I only lost 2 and the population held steady for several hours. Conclusion: multiply your Spare Time by 5 and that's how many animated NPCs you could rez on your sim without any noticeable lag.
That means, Lindens created a very reliable and efficient infrastructure, but only for NPCs. Of course, all this AI is beta test, and sim crashes happen often outside the sandbox. You know this when you can't move or chat… you've got crash! The sim does an auto-rollback, including your inventory; and sometimes you relog to a place you left hours ago! Time Warp! Coolies!
The Lindens should be congratulated for these achievements... but that's not enough. User generated NPCs should support animations, in other words, NPCs with moving limbs that walk and gesture. I used the very popular prim animation script by Ferd for my NPCs. Works great! Especially since Lindens fixed PATHBUG-110. Thank You Lindens!
It's so easy to build these animated characters that I am teaching people how to do that in a New Citiziens Inc class. If you have basic scripting and building skills, you are qualified to take this training! In 90 minutes, I'll teach you all about Pathfinding, and show you how to make chatbots and animated characters. Then you will build awesome characters yourself in our pathfinding sandbox! CLASS is 2:30pm SL Time (US Pacific), Every Tuesday at New Citizens Inc SLURL - Click to Teleport. Yes, that's correct, you will learn hands-on Artificial Intelligence (AI) skills.
To date, Lindens test pathfinding with the default cubes that you rez when you start building (Picture 10). This testing scales to other non-articulated NPCs such as rubber duckies, plastic bunny toys, and snails. Clever use of flexiprims gives you a few more options (Picture 6). Let's see, hmmm, NPC can only travel on land and float but not animate… maybe ghosts? daleks? spaghetti monsters?
To fill the vast depopulated regions of SL with engaging content, citizens of SL need animated NPCs… i.e. NPC people and realistic, animated NPC critters. I'm just saying... pathfinding has tremendous potential. Linden Prayers that it lives up to expectations!
PICTURE CAPTIONS AND RESOURCES
Picture 1 Maestro Linden, Any, and Oskar Linden
on Aditi test grid
Picture 2 Any, Lorca Linden, Maestro Linden, and Falcon Linden. The Pathfinder Users Group (PUG) meets Thursdays at 4pm SL time on Aditi test grid at the PathTest megaregions (use the Map to find us!).
Chat log from this meeting: http://wiki.secondlife.com/wiki/Pathfinding_in_Second_Life/2012-05-03
Picture 3 Falcon Linden, the genius behind pathfinding AI. Dude! ... You ROCK!
Picture 4 Any at New Citizens Inc (NCI Dream Seeker region) with some NPCs: Animated Kitties and Ladybugs - NCI Dream Seeker is dedicated to teaching and pathfinding research. We are now teaching pathfinding and related skills to everyone for free! Every Tuesday at 2:30pm SLT at New Citizens Inc SLURL - Click to Teleport
Picture 5 Any's test range on Snack Sandbox. The smaller ramp is rezzed and is in the navimesh at NCI Dream Seeker. The large spiral staircase is a prim-tortured torus. I measured the Linden staircases on Aditi, and the minimum diameter appears to be 10.25 meters with a 7 meter rise. Shown here is a 7 X 12 X 12 spiral, easily navigable, as shown by the navimesh lines.
Picture 6 Any with the dragon NPCs. Not animated, but they have a wonderful flexi-tail which moves beautifully in pursuit.
Picture 7 Three positions from the stand animation, I made Funky Munky do. Guess what she's saying?
Picture 8 When Funky Munky moves, she starts striding, left and right animations, with smooth transitions. This sophisticated NPC only needs these 5 positions recorded from Pictures 7 and 8, to fully animate. Easy!
Picture 9 Linden Prize Winner …. Gentle Heron comes round to chat about pathfinding. She is wonderful and amazing! Girl Power! Eeeeep!
Picture 10 Any on Aditi grid, PathTest4 region, with some pursue cubes, the Linden's primary test area for NPCs. Throw a barrier down and these cubes will go the long way round to refind you. Walk a little to signal your presence on the navimesh! Hmmm... pursue cubes… majorly lacking in cuddle factor! ;-)