Monday, May 7, 2012

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 1). 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. 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 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. My teaching NPCs worked for weeks… umm… until Wednesday, when Lindens rolled out a new server beta that broke all my prim animations and everyone else's. Ugh! Fix that bug!

To date, Lindens test pathfinding with the default cubes that you rez when you start building (Picture 2). 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 3). 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 4: Any, Lorca Linden, Maestro Linden, and Falcon Linden, "the genius behind pathfinding AI. Dude! ... You ROCK!

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


Any1 Gynoid

Original published on CNN 

No comments:

Post a Comment