[Opensim-dev] NPC Module?

John Sheridan john at pseudospace.net
Sat Jan 3 23:07:58 UTC 2009


"I can't remember seeing one off the top of my head - I'm not sure 
exactly how functional those sections of code are right now."

That seems fair enough, although I have to admit those sections do look 
pretty interesting! :)

"Perhaps you could give it a bit more detail about this. What problem 
are you looking to solve that can't be handled by prim inventory or the 
built in library? I don't yet understand why you need to take this 
approach."

Mainly we're taking sort of an Arcadia Asylum type of approach in 
regards to the in-world economy therefore nothing can be sold (as our 
grid's currency has no real value and never will as we'll never link it 
to a funding source) and should be given away for free, full or 
minimally limited permissions using a temporary in-world library which 
would be broken down and placed into the grid's inventory based library 
every so often when it fills up.  When I first started planning and 
testing for my grid the I had an aweful time trying to import into the 
inventory based library and by the time I finally got it all to import 
properly into the grid servers I found I had to repeat the same 
procedure on the rest of the servers running the sims.  After spending 
about 15 hours fighting with the perl scripts, cleaning up file names, 
and tinkering with xml files only to realize I'd have to do the same 
thing over twice more for the remaining servers I finally gave up and 
decided to just leave everything in world until a better solution for 
library management was available. 

This sort of works fine for now, just as long as the boxes are sitting 
there idle.  They still seem to eat a bit of memory while sitting idle, 
but the real problem occurs when someone tries to copy and open the 
boxes, which will usually take about 15 minutes to come up after opening 
in the case of the larger texture sets if it doesn't wind up failing or 
timing out.  What I had in mind as a solution and possibly a neat little 
feature was to create something similar to an in world client / server 
based vendor system wherein the items were stored in a user's inventory 
instead of in world inside of the server prim.  Although, this would 
require the addition of scripting functions which would allow for items 
to be given directly from a user's inventory regardless as to whether or 
not they're online.  My thoughts regarding use of an NPC were to be an 
alternative if I couldn't get a give agent inventory type of function to 
work wherein the NPC would simply act as the server for the vendors and 
give items or folders from its own inventory based on chat commands.

Mind you all of this was of course before I had a light bulb moment last 
night as to how to go about getting around the problem with the 
inventory based library where separate copies of the same library had to 
exist in different places.  Instead of having to rebuild the library's 
file structure three separate times, once for each server I found that 
all I had to do was to move the inventory and asset folders out of the 
local bin folder for each server and onto a network filesystem share.  
 From there I just had to create a few filesystem links to point the 
missing folders from the bin on each server to the network share, build 
the library structure on one server, and then fire them all up.  Each 
server (grid and sim) will now read from a common copy of the files 
therefore saving the pain of having to continually perform three or more 
separate build / imports each time we have more items to add.  Albeit 
its still somewhat painful to create the library structures on disk but, 
I'm willing to just suck it up and get used to that now that I know I 
wont have to do it three or more times over.  :)

In the end I sort of wound up solving the original problem on my own, 
however from a feature standpoint for OpenSim itself, the ability to 
give items from a user's inventory via script could be an interesting 
way of making things a bit more efficient in regards to those who are 
running economy based grids and may wind up creating a hippo-vend type 
of setup.  :)

Thanks, :)

 - John Sheridan aka Orion Pseudo :)



Justin Clark-Casey wrote:
> John Sheridan wrote:
>   
>> I've been doing a bit of digging around inside the OpenSim code these 
>> past few days and I noticed a few sections which appear to be sort of a 
>> built in non-playing character.  It almost appears to be a sim based 
>> avatar or bot.  I was wondering how far along this is and if its ready 
>> for use?  If so, would anyone happen to have a quick tutorial or example 
>> to work off of?
>>     
>
> I can't remember seeing one off the top of my head - I'm not sure exactly how functional those sections of code are 
> right now.
>
>   
>> Right now as an alternative to using the inventory based library as I'm 
>> running in grid mode (not to mention each attempt at importing directly 
>> to the library has failed horribly) I'm currently storing an aweful lot 
>> of assets in world using freely copyable boxes.  While this works well 
>> as a temporary fix until a better solution for the inventory based 
>> library can be formed, it also tends to eat alot of the server's memory 
>> - so much so that I've had to limit that one server down to three sims 
>> meanwhile another of the same configuration is able to handle eight. 
>>
>> While poking around I came up with the idea of an OS function that could 
>> be used to give inventory items out of a script owner's inventory, 
>> however I cant seem to figure out how exactly to get that to work.  So 
>> far the only functions I could find only seem to work using a prim's 
>> inventory.  While I'm still digging around for a solution on that one 
>> (my apologies as I'm a bit of a newbie to the OpenSim code base), as an 
>> alternative I wonder if an NPC / bot based method could also work 
>> wherein an NPC module could be setup to respond to certain chat commands 
>> and then give items or folders from its own inventory. 
>>     
>
> Perhaps you could give it a bit more detail about this.  What problem are you looking to solve that can't be handled by 
> prim inventory or the built in library?  I don't yet understand why you need to take this approach.
>
>   





More information about the Opensim-dev mailing list