User:Gimisa
From OpenSimulator
I am opensim user and simulator operator sharing my notes so its usefull to others. :
VOCABULARY: my understanding of the following terms.
AIML: Artificial Intelligence Markup Language is a specialised xml with defined tag for conversational bot. ARC: Avatar Rendering Cost, a relative figure that provide indication as to the load an avatar represent. BENTO: Is the name given to the extended skeleton introduced in late 2016 with 106 new bones . BULLET: Not a part of a gun, but a physic engine adapted by Robert Adams for opensim. CACHE: Software component that stores data so future requests for that data can be served faster CHILD AVATAR: A number of mirror avatar creates in adjacent region. This is the mechanism by which the viewer is aware of the other adjacent regions. CONSOLE: in opensim its the dos or linux running screen. This screen provide information and takes commands. DATA:URL: is a string that can be use instead of URL that provide a web page or part of a web page content. EMAIL: In opensim is the capablity to send/receive email from script from/to inworld objects. FITTED: Fitted Mesh is a technique in which an avatar's collision bones are used to add further deformation detail to an avatar or clothing. IM: in opensim is the abreviation letters for instant message a mean of private communication between avatar or between object and avatar. IRC: Internet Relay Chat in the context of opensim can be use to allow script communication between object of different regions. GRID: One ore more simulator (SIM) supported by one or more robust.exe instance. MESH: In virtual universe its an imported collada file that creates a 3 object instead of using sculpty or prims. LOD: Level of detail is the mechanism by which the scene object details are reduce with increasing distance. LSLWIKI: Old script page that you can still access at http://lslwiki.digiworldz.com/ MOP Media on prim: the possibility to present a web page content on the face of a prim. NPC: Abbreviation for Non Player Character. The NPC is a bot, a computer controlled skim down player that you can rez in your world. OAR: Archiving file for region. OPENSIM: short for opensimulator. In a stand alone is the service server and simulator for the opensimulator process. In the case of grid stand for simulator only. PARCEL a subdivision of a region minimum size is 4mx4m= 16 meter square PRIM: is the primitive building block of opensim virtual world . They can be created with in world building tool . REGION a 256mx256m = 65,536 meters square area in opensim. ROBUST: this is the grid specialised server that will hold all the commun services as compare to opensim that in that case holds the simulator. REZ; Stand for putting a new player, NPC , or object in a region. REZ DATE: the day you register a new avatar and rezing him in a region of the grid. RLV is the acronym for restrain love. This is a feature available in certain viewer that with client consent allow certain script controls. SCULPTY : sculpty is a hack that permit importing regular UV images maps specifically encoded for 3d object creation from RGB to XYZ conversion. SEARCH : In general trying to find something, in opensim you can find avatar , location and objects. You can also search your inventory . SIMULATOR: also call SIM one opensim.exe instance running supporting one ore more region(s). STANDALONE: The simulator and the supporting services are all run from one instance of opensim.exe TOS: Term of service. Under which condition are you proposing your services. In the case of opensim server or mainly simulator hosting services. TUTORIAL: Short course presenting how to something. In opensim see http://profil.gimisa.ca for some tutorial I did. UBODE: Is a physic engine improvement done by AJL Duarte over the original ODE physic. VARREGION: a region with variable dimension. At time of writing limited to square values of multiples of regions (ex. 4x4 = 16 region area) . VIEWER REACH: is the distance define in the viewer reach window or preference that a user will perceive object. VIRTUALBOX: A software to run virtual machine, that is a virtual machine running inside a real machine. WIFI: In opensim its a C# http interface created by Diva Cantro more details here. http://opensimulator.org/wiki/Wifi XENGINE: The opensim module responsible for of the script LSL / OSL language use in scripting inworld with opensim.
OAR.
I advocate the use of OAR for backup similarly to any other software file extension. I believe that creators in opensim shall be able to save their work as easily as someone using word or excel. Bring it back in aopensimulator.org.orgs easy. OpenSim already allow that through the use of OAR. In opensimulator.org JustinCC introduced OAR file extension and a mechanism to create (save) and upload (load) that file content inworld in any opensimulator . More can be read in http://opensimulator.org/wiki/OpenSim_Archives . That mechanism is available through operator console of the simulator. But not to the majority of creator whom normaly are hosted only and have no console access. I propose here a method to do that with a script inworld to save the region content in OAR automatically. That script command is high treat level as define in opensim. Therefor the intervention of the simulator owner is necessary to allow the function . The best is for operator to create an object and put the following script. The operator should enable the osConsoleCommand command for him in XENGINE script access control section of ini file. See here for detail http://opensimulator.org/wiki/OSSL_Enabling_Functions. Using his UUID the simulator operator can enforce the treat level for osConsoleCommand and rez the object for his guess to use while limiting its use to the script function.
What I propose is a script to automatically save an oar when the prim count change by more then 10 .OAR saving can also be initiated by touch :
//gimisa@yahoo.fr 130502 //oar saver rez on region you are owner //see read.me for instruction //130502 add interaction with hud //gimisa@yahoo.fr 130120 integer setup=FALSE;//Chnage to false to complete setup string dir="/home/gimisa/Bureau/oar/gimisa/";//the location where to sa ve the oar so your user can access it. //_________________________________ key id = "598c76d4-a9d0-2fd6-0a81-fc72dca068b5";//default key string idName="gimisa"; key dtc;//detected avatar string region;//region name string cmd;//command integer ok;//status integer pcount;//number of prim cunt integer ppcount;//previous prim count integer flag=FALSE;//save oar flag //_________________________________ integer dbug=FALSE; saveOAR(){ region=llGetRegionName(); ok=osConsoleCommand("change region "+ region); string tme=llGetTimestamp(); llSay(0,"Region: "+ region); llInstantMessage(id,"saving oar " +dir+region + "."+tme + ".tgz" ); llSay(0, "please wait a few minutes to complete"); if(!setup) ok=osConsoleCommand("save oar " +dir+region + "."+ tme + ".tgz"); osMakeNotecard(dir+region + "."+ tme + ".tgz","");//storgage is done by notecard name llSetObjectDesc((string)pcount);//count is store in object description } sayPrimCount(){ llSay(PUBLIC_CHANNEL, "There are " + primCountThisParcel(PARCEL_COUNT_TOTAL) + " total prims on this parcel."); llSay(PUBLIC_CHANNEL, primCountThisParcel(PARCEL_COUNT_OWNER) + " prims are owned by the parcel owner."); llSay(PUBLIC_CHANNEL, primCountThisParcel(PARCEL_COUNT_GROUP) + " prims set to or owned by the parcel's group."); llSay(PUBLIC_CHANNEL, primCountThisParcel(PARCEL_COUNT_OTHER) + " prims that are not set to the parcel group or owned by the parcel owner."); llSay(PUBLIC_CHANNEL, primCountThisParcel(PARCEL_COUNT_SELECTED) + " prims are selected."); llSay(PUBLIC_CHANNEL, primCountThisParcel(PARCEL_COUNT_TEMP) + " prims are temp-on-rez."); } string primCountThisParcel(integer flag) { vector currentPosition = llGetPos(); pcount=llGetParcelPrimCount(currentPosition, PARCEL_COUNT_TOTAL, FALSE); return (string)llGetParcelPrimCount(currentPosition, flag, FALSE); } default { state_entry(){ id=llGetLandOwnerAt(llGetPos()); idName=llKey2Name(id); llSetTouchText(idName); llSetSitText("-"); llSetTimerEvent(1.); } touch_start(integer num_detected) { dtc=llDetectedKey(0); if ( !(dtc==id | dtc ==llGetOwner())) { llSay(0, "sorry but only "+ idName + " can use this"); return;} sayPrimCount();//say in open chat prim counts of the sim saveOAR();//save oar state wait; } timer(){ llSetTimerEvent(1800.); ppcount=(integer) llGetObjectDesc(); primCountThisParcel(PARCEL_COUNT_TOTAL); if(pcount==0) return; if(ppcount==0){ ppcount=pcount;llSetObjectDesc((string)pcount); } if((pcount-ppcount>10 | pcount-ppcount<-10) && !flag){flag=TRUE; llSetTimerEvent(60.*15.);return;} flag=FALSE; llSetTimerEvent(3600.); if(!(pcount-ppcount>10 | pcount-ppcount<-10) )return; sayPrimCount();//say in open chat prim counts of the sim saveOAR();//save oar } } state wait { state_entry(){ llSetTimerEvent(5.0*60.);} timer(){ llSay(0,"will appear on FTP when complete"); llSetTimerEvent(0.); llLoadURL(dtc, "OAR FTP SITE", "ftp://where.to.access.the.oar.file"); llResetScript();} }
You can find a free copy along with a tutorial about oars and the object oarsaver in the little grid I operate for testing purpose call gimisaOS. You can reach it via Hypergrid using your viewer map with search for 3d.gimisa.ca:9000
MOP updated 170412
Media on prim can be very interesting. The way to add a media on the face of a prim is straightforward selecting a prim face in the build tool and then activating the media of choice in the texture tab media selector ( varies with viewer). Se tutorial in gimisa5 tutorial area for more detail and picture. You should display a picture of some kind ( you can use the same prim by texturing it) as default texture to illustrate to your visitor that you are using media on prim. Most viewer disable the auto play of media prim forcing user to seek them for display. The advantage of Media on prim is that it has no impact server side since the viewer is handling the request via its internal browser. Please note that the view is asynchronous. Specially if video it meaning that what you see is not what other will see or hear on the same prim face. Just like if you are visiting the page by yourself on the web. The web browser in viewer was Mozilla compatible with QTWebKit but has be change to chrome tool kit . Therefor it supports HTML5 tag as </audio> and </video> . The following HTML code to add has been updated for use with the codec supported by HTML5
I am using MOP to overcome the sound limit in OpenSim. A sound file play in world is limited to 10 sec per file. One Technic use to overcome that limit is to cut a longer sound file in 10 sec sections and to piggy back the set with a proper script . That has a detrimental effect on your region cause of the bandwidth required to send the sound file in this way. The advantage is that the sound is heard by all avatar in the vicinity..
The way I do that is via MOP. The sound file can be built from any mixer software you like and can have any length. The trick is to convert it to swf (flash) so it can be compatible with any operating system (mac, window, linux ) . There is a number of online converter that will be fine for the job. The file need to be accessible to the web. That is a serious limitation to causal users unfortunately comment on the later as to how to do that direcly in opensim would be nice. For now the best is either to rely on hosting providers on the net or install something like tiny. Then you need a wrapper in the form of a standard web page with the following embed tag. <embed src="http://locationOfYourSoundFile/Here.swf" width="100%" height="100%" type="application/x-shockwave-flash" loop="false" autostart="true" > Sorry your viewer does not support flash (swf) </embed>
As a useful alternate in case your user viewer does not support swf is to provide a hyperlink giver on touch of the prim pointing to the same web page. In this way a HTML5 code wrapper can be use in your web page as follow:
<audio autoplay> <source. src="myOriginalFile.mp3" type="audio/mpeg"> <source. src="myOriginalFile.ogg" type="audio/ogg"> <source. src="myOriginalFile.wav" type="audio/wave"> <embed src="http://locationOfYourSoundFile/Here.swf" width="100%" height="100%" type="application/x-shockwave-flash" loop="false" autostart="true" > Sorry your viewer does not support flash (swf) nor HTML5 tags please refer to https://community.secondlife.com/knowledgebase/english/how-to-use-adobe-flash-in-second-life-viewer-40-and-later-r1406/ for more details </embed> </audio>
Using Data:url one could refer to sound or media in general available from the web ,directly in a text string instead of having to host it in a web server of his own. One could go as far as reformatting the web page to his own liking and provide dynamic content via script using An exemple of that way of achieving this is available in gimisa5 store in the tool rack . More on that in DATA:URL .
A trick I am using to achieve synchronous MOP effect for visitors is to use scripts. I clear the media on the prim face so it does not start when avatar come into vicinity. Then I use an event like touch to create the media texture . Though the effect is not totally simultaneous test with friends has show that its close enough for use. A made a firework display that is started on touch of the control panel that appears for all people standing in the area. You can get a demo of the effect of this trick by hypergrid visiting 3d.gimisa.ca:9000 and search for gimisa4 region in map.
ARC.
ARC, Avatar Rendering Cost is an information the user should be sensitive too for a pleasant grid or hypergrid travel
The load an avatar represent in being rendered is an interesting figure to be considered by user. For local or hypergrid traveling the impact of the integration of avatar in the region scene is more or less loosely represented by that figure. This relative amount can be use comparatively as a guide for the amount represented by the avatar in rendering effort. In general the travelers should pack the avatar with as little as is needed to make a personality to minimise the load the region they are visiting. This is as much to have a pleasant experience for themselves as to help the experience of other by the same principles . They can put in their suitcase the travel avatar and the regular flashy model for convenience so they could switch while they traveling if they are in need to go to something more .
A good tool to judge the weight of one avatar is to use the avatar rendering cost display available in viewers. When activated with shortcut key ctl-alt-sht-C you are displayed a number over your head as well as avatar surrounding you . When green the avatar is good to travel. Yellow is limited while RED is no no. Its an interesting experience to make to remove part of an your avatar outfit and see the impact on that display. Good outfit part does show not only by the look they provide but also by the weight they represent for that results.
People should think about how much a traveling avatar has to transfer to the other grid (HG travel) server and how much information the region server has to handle to render the result they and other in the vicinity sees. This is all their texture, mesh and prim to be added to their scripts compiled. The few second required to render see a lot of activity both in the robust server and the region servers. This time is spent to acquiring that information (prim scultp mesh shapes , textures, compiled scripts) . The result is use to create the rendering information for the avatar and its numerous child avatars in the region and adjacent regions for the new arrival (max of 9).
More about avatar rendering cost calculation and detail can be read on "http://wiki.secondlife.com/wiki/Avatar_Rendering_Cost"
CHAT_BOT. (R170714)
I use a number of way to interact with visitor. Making the visit more interactive can be a challenge to try to make the visit more interesting. Scripting provides the tool to do that and touch is the perfect function to trigger interactivity while not causing annoyance. Its also low on lag so this is my interactive function of choice. AIML is the language to give brain to your chat bot. Its interest is in the apparent two way communication it provide much like natural languages. There is script to do that inworld in lslWiki but scripting memory is too limited to do a good job so external service is required. I have tried that and will come back to it later.
What I found more intuitive and accessible using the dialogue blue box tool also offered with scripting . It is possible to construct with it a rather easy two way communication in the form of multiple choice discussion. That way is less interactive then a true conversational discussion but can be as attractive as a story book where you are the Hero. Using OSL notecard feature one can rig a notecard to provide for extensive exchange with the visitor. The line length of the OSL card is 1024 bytes ample for supporting multiple choices and trends in the discussion. The visitor reads the story line and make one choice out for the continuation. I use three choices the story direction can take but that is an arbitrary limit. And while at it why stopping to chat lines. The same tool can be use to hand out interactively LandMark, Object texture notecard and the like by refering to them in the story notecard. Add to it sound wave files of story and choice recording and you have a voice reader to accompany you visitor. Put that in a NPC (more about that in AIML) and you have the perfect guide to your exhibit. And top it with choice of language and you have a rather interesting interactive feature pack. A demo and code of that way of using interaction in opensim is available in gimisaOS my little test grid.
gimisaOS landing welcome have two demo Brat at the gimisaOS welcome sign and Joe at the OAR loader both you cant miss them. Joe has also voice in addition to the dialogue blue box both french / english .
I have considered AIML as stated above. There is an old script in lslwiki about AIML decoding done inworld. This methode is presented in ALICE chat bot web site http://www.alicebot.org/about.html. It was also integrated in Radegast text viewer . To my knowledge it never took ground in opensim/SL . I guess its cause the feasability is not there to search notecard bank having a few 100M typical for a bot to be somehow smart . You will find in opensim a well know bar tender bot using pandora bot.( http://www.pandorabots.com/) That bot can be easly configured to use an account you would create in pandora. But unfortunately the terms of service of pandora prevent you from doing so in the following terms:
5.3 You agree not to access (or attempt to access) any of the Services by any means other than through the interface that is provided by Pandorabots, unless you have been specifically allowed to do so in a separate agreement with Pandorabots. You specifically agree not to access (or attempt to access) any of the Services through any automated means (including use of scripts or web crawlers) and shall ensure that you comply with the instructions set out in any robots.txt file present on the Services.
What I did therefor is implement an external server. Unfortunately that make it not an application that can be easly implement by causual user compare to the pandora bot solution. The server use pyAiml a python aiml interpreter that is interrogated by the inworld bot to reply to visitor. I have added to it a personalisation notecard that overide the request to the external server for specific such as gimisaOS grid. Asking about the grid bypass the external request and get the reply from the notecard. You will find walking NPC all around the few region of my test grid . For instance, the dancer in welcome first floor , the lady around pise tower in gimisa5 the firewoman , the paramedic and the two astronaut in gimisa8 nasa exibit.
I found a way to use Radegast interacting with IMs to present a chat bot discussion through IMs. And while at it I adapted a second server to pyAiml2.0 see https://docs.google.com/document/d/1wNT25hJRyupcG51aO89UcQEiG-HkXRXusukADpFnDs4/pub which has lot more tag to support a smarter bot application. I found a pyAiml2.0 interpreter here where Keith is actualy an active developper open to support and suggestion. https://github.com/keiffster/program-y
I dont know if explaining how the server is implemented is something of interest to opensim user platform but certainly an email asking for that information is something I would be glad to reply to.
You can reach the demos via Hypergrid using your viewer map with search for 3d.gimisa.ca:9000 .
SCALING.
Scale a mesh can be rather spectacular at time. Any attempt will litteraly explode out the object and fill you screen with a mess.
Any builders know how to scale a prim. You select the build scale tool grap the guides and expend or contract the prim as you like. An other way is to change the x,y,z size of the object in the prim size data block just bellow position. In opensim the prim upper size limit is set in opensim.ini configuration file. The default size is 256m. But its possible to rez object that are already sized bigger then that. Naturaly scaling them after rezzing will cause the limit to be applied. Similarly scaling down is also limited. The opensim built in limit is 0.01m. That means that any attempt to change a prim x,y,z size to lower then 0.01 will fail and the scale change will not be applied . When you try to scale that low with the guides the scaling down stop and block at that point.
Now if the prim is part of a link set the discussion above also applies and that link will limit the scaling of the whole object when one of it child prims reach either the upper or lower limit imposed. To change the upper limit is rather simple if you have access to your opensim.ini. I have successfully use 512m and 1024m as upper prim size limits. But there is no way to change the lower size limit pass 0.01. There is trick to "see" smaller prim size by using partial transparencies. But when it comes to scaling an object down any prim that one of its dimension falls below 0.01 will block that scaling downward for the whole object so proportionality is maintained.
A mesh is imported as an object of a certain size.The imported size might be far different then its creation size in the 3d software. Regardless the above discussion applies. As long as there is no attempt to scale the mesh object simulator limits applicable are NOT imposed. A simple inspection of a linked set mesh will show that some of its links might contain element that are over the upper limit and or under the 0.01 lower limit. When trying to scale the object system limits will be enforced and if the mesh contain mesh link having smaller dimensions then 0.01 the size of the object will IMMEDIATLY be resized to fit the limit. I have seen case where the a mesh link original size is 0.001 for one of its dimension x,y, or z. This kind of situation will be leading to litteraly explode out the object with 10x scaling. and fill you screen with a mess.
The solution is easy. Inspect each element for size and correct any value lower then 0.01 up to at least that. Well that is nice for a mesh object with one to few links but what if we talking about few hundreds ( yes opensim can accept a lot of links no limit unless enforce in opensim.ini) . So the justification for a tool I did . The tool is a prim that you add to you link set. Then clic /touch. It will inspect each element of the linkset for size and correct any value lower then 0.01 up to at least that. The tool will confirm complete. You can then scale down. Unlink that tool and done .
You can get this tool via Hypergrid using your viewer map with search for 3d.gimisa.ca:9000 .
XENGINE.
A strange situation happen to me on one region of my test grid. All scripts stop responding for two days. You can stop a script or a whole simulator script set from running by issuing a >> scripts stop command in sim console. This will stop all script and give you a list in console . A very useful debugging feature to know if you have offending script to pin point (more on that in following article) . You can also disable scripts in the debug tab of the estate manager window . These are perfectly normal way to have script not responding in region. That will be indicated by the missing run mark in the check box on the lower corner of the script edition window of any script in the simulator.
But that was not my problem , and I had no idea why it was acting like this . Yes I have added a few scripts more in the late days before that happen. But nothing that could explain a complete failure of xengine in my humble opinion. There was no log entry either to point me in the right direction. So here is what I tried.
1) in console script stop / script start
2) in estate window make sure script is enable
3) restart region from console
4) save oar of region and reload
5) search the net and mantis for xengine trouble
In all these case the script would run for a bit then would stop responding without warning nor indication at script level of not running state. Putty amazing is it.
In the trouble region the script will save normally with save script message appearing in both script window and blue warning. Running tag is normal on script window but no response from script and that is for any script in the region.
The main trouble to me is not a failure but mainly the lack of indication of what is happening in failure mode, at least with something in log or in console window.
I had backups I could roll back but the idea of experimenting is to take the opportunity of a failure to improve and learn so her was my solution for your benefit:
The solution is somewhere in http://opensimulator.org/wiki/XEngine
6) ; How many threads to start at maximum load
MaxThreads = 100
XEngine will not start more than this many scripts, even if that means blocking script execution
I had 15 for maxThreads value which seem to be the default of opensim install.
Changing it to 100 prove to be a bit on the high side as I had region crash on low memory.
Trying 50 these days and it seem to hold ok.
A few facts should you be interested in details:
A)3d.gimisa.ca:9000 is the a 10 regions grid running under robust stable 0.8.1.
B)Robust and simulators are all served from same machine ubuntu 14.04.
C)Simulator are running from same set of files using alternate config ini.
D)Except for gimisa5 the trouble region , anything else is running normaly.
E)gimisa5 is the only region on its simulator.
SCRIPT PROBLEM.
Debuging and mainly finding offending scripts might be hard on users. An impossible task if one dont have console access. Window / Linux provides monitoring means of reporting CPU and/or memory usage. The TASK MANAGER for window and TOP for linux are well know ones among them.
So using such a tool , I notice on one of my simulator a high CPU rate while no one was on any region. Thinking it was a script running wild I used the inworld estate manager debug window to see if it could point me to the problem. It did had a script listing and I try it to disable the few mentionned. But it did not cure my problem. Still using estate manager I disable all the scripts. That had the expected effect of dropping CPU confirming script was the cause of the situation. But which one. I was left clueless. How could I possibly find and investigate the 1600+ scripts of my simulator . Searching google left me with a lot of links but no answers.
What I found useful in that case is to use the console script stop command. Yes it stop all script just like the estate manager disable. But more over it provides a listing of all script in the region. Its easy to copy that list and paste it in a spreadsheet. Then, and that is where it become interesting, its an other easy step to modify that spreasheet to add the script start console command prefix to each individual script entries and to save that file. Next, using the command-script console command, pointing to that file just created, run that file and restart ALL script . But more over one can fine tune, individually via prefix to each line of the speadsheet , which script to start, and stop.
Armed with that tool and using a well know iterative technic by trial an error, each time narrowing the number of scripts. I found the single script among the 1600 that had my CPU jump by 60% and correct it.
AGE - STAT
We are all getting older , really and virtual. Virtually you have a rez date , that is a date you created you avatar in a grid. That rez date for that grid derive your age measured in days and show up in your profile. The other day , in my little test grid , I had a new born HG visitor. This attracted my attention cause it peculiarly young to be hg jumping when first register into a grid. If you new to opensim even if former SL resident , HG jump is not something that come natural. Your first days in a new grid will usually be devoted to getting around and installed in your new world . So it intrigued me as to what is the age distribution of my visitors. I have a 30 days rolling graphic presentation of the number of visitor per day and daily tally time done with osl draw functions that you can check and grab in gimisa5 hypergrid dome . So I though why not add a plot of age distribution on it.
On grid that have profile activated in opensim.ini / robust.ini (see this for more detail http://opensimulator.org/wiki/UserProfiles) right clic on the avatar and asking for profile will give you avatar name including ,home grid url with port and born date and age in days and general profil data via profil tabs. To gather statistics you need to have access to those figures in scripts. For local user a script can access the born date via llRequestAgentData(key, DATA_BORN) ref: http://wiki.secondlife.com/wiki/LlRequestAgentData .
The problem is that no command exist that will provide you with that data for HG visitor. All the scripts can provide about HG visitors is the name with llDetectedName() script or llKey2Name or oslGetAgent(). It is possible from the name information to get the url of the avatar home location. With a bit more gymnastic using a xml_rpc request to the home server of the visitor you will finaly get the born date of the visitor coded as unix time stamp. That time can be translated using LlGetUnixTime into age in days. TADA!!! A demo of that solution is available in gimisa3 welcome.Just touch the age cube.
PERFORMANCE
I know you probably know this . As you witness with experimented hoster for opensim they usually restart their region at frequent intervals. But how much important this practice is . Using linux top command I was able to obtain the following data after 24 days of opensim uninterupted operation of my little grid. top - 08:04:34 up 24 days, 2:54, 1 user, load average: 6.48, 5.68, 5.27
What does this mean. Well load average three numbers are for 1min 5min and 15min average of the load on the machine, The number themselves means the number of CPU cycle necessary to process the items in queue. So is 6.48 CPU cycles bad. No if you have 12 CPU to handle the task they will team up to take only 1 clock tick. But this is very bad if you only have 2 CPUs teaming as in my case . It translate into sluggish server response on teleporting to region and rezzing object. Script processing is also painfull.
Now what is happening after restarting the 4 simulator running on my computer. top - 12:00:04 up 24 days, 6:49, 1 user, load average: 1.36, 1.49, 1.66. Yes this is the same load, gimisaOS grid. Same 4 simulator with same content now takes up 1.66 15min average load a very acceptable value on a 2 CPU chips.
To restart you region you can use the estate manager window and on the debug tab you can hit the restart button. This function is accessible to any estate manager. For server system operator the console command region restart bluebox restart 15sec 15 will do a restart in the next 15 second. But these method will require your attention everytime you want to restart you region.
For an automated method one can use the above feature with a OSL script. One can enable OsRegionRestart opensim scripting function and put an appropriate timer on it to restart the region at interval (ref: http://opensimulator.org/wiki/OsRegionRestart) . An example of such a script is available in gimisa5 store.Just drop this box in any region you have estate management rights and it will restart at interval set by timer.
For an other automated method one can use remote console command. This feature has to be enable in the opensim.ini . [RemoteAdmin] enabled = true port = 221 (select a port that in NOT open to external) access_password = "passwd" enabled_methods = all . I do this setup for my 5 simulators, from port 221 to port 225. Next you need a program to run the required command. I am using python as follows :#!/usr/bin/python # Author : gimisa import xmlrpclib import sys #this is the UUID list of the region to restart g1='c794b362-fb61-4bff-90b2-5fc273df7df8' g2='30bb9b86-bae5-425b-8c55-02d788858953' g3='772c0b5e-bf67-4ace-8b34-735f102f1aff' g4='9b5c28de-5a07-4cd6-b3a6-c353d988b929' g5='1285196d-4288-4ebc-a312-cbff001a6165' g6='9d2d5dbe-2714-4df5-bfde-b2ad81505e06' g7='1285196d-4288-4ebc-a312-cbff001a6167' g8='1285196d-4288-4ebc-a312-cbff001a6168' g9='d87ad5db-08eb-4c91-8004-3a057574aaa9' gr='d87ad5db-08eb-4c91-8004-3a057574aaaa' # XML-RPC URL (http_listener_port) simulatorUrl = "http://127.0.0.1:"+str(sys.argv[1]) # instantiate server object simulator = xmlrpclib.Server(simulatorUrl) #I am using port 221 to 225 for the 5 simulator #for simulator 221 there is 4 regions for the others one simulator one region if str(sys.argv[1])== "221" : simulator.admin_restart({'password': 'pass1', 'region_id': g1}) simulator.admin_restart({'password': 'pass1', 'region_id': g7}) simulator.admin_restart({'password': 'pass1', 'region_id': g8}) simulator.admin_restart({'password': 'pass1', 'region_id': gr}) elif str(sys.argv[1])== "222" : print simulator.admin_restart({'password': 'pass2', 'region_id': g2}) elif str(sys.argv[1])== "223" : print simulator.admin_restart({'password': 'pass3', 'region_id': g3}) elif str(sys.argv[1])== "224" : print simulator.admin_restart({'password': 'pass4', 'region_id': g4}) elif str(sys.argv[1])== "225" : print simulator.admin_restart({'password': 'pass5', 'region_id': g5})
Next is to schedule that task. In my linux case this is through cron. Here is the cron file I am using to start this task every weekday as follows. 1 is monday ....5 is friday .1 1 * * 1 /home/gimisa/Bureau/python/remoteResart.py 221 2 1 * * 2 /home/gimisa/Bureau/python/remoteResart.py 222 3 1 * * 3 /home/gimisa/Bureau/python/remoteResart.py 223 4 1 * * 4 /home/gimisa/Bureau/python/remoteResart.py 224 5 1 * * 5 /home/gimisa/Bureau/python/remoteResart.py 225
After about a year of using the method above I notice that some script were hangning and a general detarioration in the simulator behavior happen even if the CPU usage was apparently good. It seem the remote restart available through the remote admin simulator command ( http://opensimulator.org/wiki/RemoteAdmin:admin_restart ) or through the estate manager window is not perferming a deep enought restart in comparaison to a cold quit command.
So as presented in the following link http://opensimulator.org/wiki/Automating_Tasks and since I am using ubuntu screen , its possible to send a direct command to the simulator via a screen -xS screenName -X stuff "alarm restart in 1 minute " to alarm, quit , and restart the simulator. So I replace the simulator.admin_restart from the python routine above with a screen command and replace that bash routine in my crontab job list.
The code is :#!/bin/bash screen -xS $1 -X stuff "alert region restart in 2 minutes " sleep 1m screen -xS $1 -X stuff "alert region restart in 1 minute " sleep 30 screen -xS $1 -X stuff "alert region restart in 30 secondes " sleep 20 screen -xS $1 -X stuff "alert region restart in 10 seconds " sleep 5 screen -xS $1 -X stuff "alert region stopping will restart in 5 minutes " sleep 5 screen -xS $1 -X stuff "quit " sleep 600 screen -X -S $1 quit sleep 5 case $1 in "go" ) sh /home/gimisa/goar.sh ;; "g3" ) sh /home/gimisa/g3.sh ;; "gi" ) sh /home/gimisa/gi.sh ;; "g4" ) sh /home/gimisa/g4.sh ;; "g5" ) sh /home/gimisa/g5.sh ;; esac
MESH
I have made a whole series of tutorial in gimisa5 about mesh , mesh and material , mainly blender importing up to rigged avatar creation see paragraph bottom of article for new addition. I also work out a comparaison between prim, sculpty and mesh as building block for your project. The limitations of each medium is spell out for each of those tool and illustrated in the different tutorials . But I lately came across this article from http://blog.nalates.net/2015/10/01/second-lifes-limits/#more-15460 where they indicate that not only there is a upper limit on material of 8 and total of triangle count per object of 174,752 for you mesh, which was already documented . But they mention there is also a limit per material of 175,752/8 = 21,969 triangles . This later limit is not documented (but would explain failure of loading a MESH even if everything else is in order). Validating this situation in loading up in my grid I did not witness any effect for a mesh with one material having a total triangle count OVER 21,969. Nevertheless the step to improve you builds in this respect is the same as the step to overcome the material count limit of 8 as suggestion in my tutorial,is to split the work in multiple objects, that you import together so they combine properly in world.
So keep an additional eye on your triangle counts if you doing object for import. My way of doing this is to do my object. Then assign material. Split my final build per material. Make sure I dont exceed the triangle count limit per material. Sometimes I recombine a maximum of 8 object into one in a logical way to do my final object(s). There is nothing wrong in leaving the object splitted which give additional flexibility with only one face ( similar to sculpty) at the cost of larger linked object set. As far as I can see UVmaps will follow properly in the recombination so that texturing will still be maintain proper inworld.
Not so lately ( 2016-01 ) I have added four new tutorial about meshes. They can be found in the import-house in gimisa5. Two are rather advance UVTexturing using clone tool and the other one is about patching holes via the blender grid tool . The other two are more accessible to none blender initiates. One is about making 3D lettering using blender text tool to import inworld. Without much knowledge of blender it is possible to intuitively create lettering text that can be converted in mesh to DAE file and import inworld. The second tutorial in the Mesh import house is about creating 3D object out of simple pictures using autodesk cloud software freely available for small project. Its amazingly simple to use and the results are awesome. The 123dcatch depot in itself is a source of very interesting mesh constructions for you to explore.
Lately ( 2016-03) I have added a tutorial on how to create mesh using regular picture set. The tutorial provide an example using a del arte mask mesh creation using as few as 9 pictures. The internet line tool to do that will created stl extension that can easily be converted and repaired using blender. The tutorial and de la arte mask can be found in the import mesh tutorial building in gimisa5 of my little test grid.
MONEY 180116
I dont think this need definition in Real World. But what about Opensim. My idea here is experimentation and play money. A monopoly of opensim sort of to have fun and play with. My idea is to use coins as point to collect statistics from visitor in my experimental grid. The money system and component help achieve that result by providing supporting data on transactions . There is a good article about it here so I dont need to repeat that information (http://opensimulator.org/wiki/Money). Money not being a core Opensim element its implementation is left to third parties . The one I use for experimentation is http://www.nsl.tuis.ac.jp/xoops/modules/xpwiki/?OpenSim%2FMoneyServer version 0.8.2.0 . Its a current installment at time of writing this article. Its not built using new mono add ins feature (see http://opensimulator.org/wiki/Developing_OpenSim_Addins ) . Nevetherless its download and build was rather straightforward in my case ( linux ubuntu box). I did follow the read.me instructions provided with the download successfully.
Basically the steps are:
1)move the file in appropriate folders ( opensim and opensim/bin )
2)create the money database
3).\build the package
4)modify the moneyServer.ini file .
5)execute the created moneyServer.exe
My moneyServer.ini is available in the dome of gimisa5 region should you be interested in that. I did not implement the helper part. (updated) I have no choice but to include a helper in order to give land to someone else. I did not implement the one proposed by NSL. Instead I use the following instruction by Fleep to implement helper.phg http://opensimulator.org/pipermail/opensim-users/2012-September/010946.html. For the rest I have direct access to database of my server which makes it much simpler to adjust money balance using sql language. Since it is only to gather statistical information from the database collection I am not too concerned about safety or incorrect transfer.
The interest for me is that now All of the LSL function related to money become available. llSetPayPrice, llGiveMoney, llRequestPermissions. Also as the object buy function and pay function with a set value. All those will trigger the money(key id, integer amount) event that should prove very interesting to explore.
I noted in my early experimentation that the money event has a problem. The event cannot handle more then one function. That is ONE line of code. A work around I found is to make the two variable provide by money event ( id and amount) global and to use a timer to operate the supporting functions to be implemented.
More important, in my case, I have an experimental grid with only me as resident. So play money is for my HG visitors. New release in progress for OpenSim-0.9.0Dev had support now for HG visitors. I am great full to developers that provides the code of their work in open sourcing. I notice a flaw on the execution when NPC are created AFTER arrival of new visitors in regions . The balance to purchase is report at zero for any transaction of existing visitors. With the help of a C# introduction book and a bit of fiddling I was able to modify the code to correct that situatiion an make that release functional to me. HG visitors rezzing in the grid are granted the initial amount set in moneyServer.ini. They can do then same as grid resident and make transaction with those coins for the length of their stay. On a subsequent visit to the grid, they retrieve their previous balance and proceed with play money fun. As usual you can test by making a visit to my test server at 3d.gimisa.ca:9000. All regions have money enable.
Someone ask me what was my sql requests command I was using. So to get transaction with date and visitors this is the one I use:
SELECT sender,objectUUID,objectName,from_unixtime(transactions.time),robustOS.GridUser.UserID FROM money.transactions,robustOS.GridUser where robustOS.GridUser.UserID like CONCAT( money.transactions.sender ,'%') ;
For per user amount this is the one I am using:
SELECT money.balances.balance ,money.userinfo.avatar,money.userinfo.serverurl ,robustOS.GridUser.UserID , from_unixtime(robustOS.GridUser.Logout) from money.balances,money.userinfo,robustOS.GridUser where money.balances.user = money.userinfo.user and robustOS.GridUser.UserID like CONCAT( money.balances.user ,'%') ;
LANGUAGE
Opensim is an international application. There is grid hosted in many countries. The viewer supports a number of language that can be set in preference either to be system language or manually entered to fit the user need. This is the same idea as a web browser. For the web browser the language information is available to servers so the user experience can be adapted for the visitor language. The same is also possible to the opensim server / viewer. A script function supports the adaptability of the interaction with the user. The function LlGetAgentLanguage (see http://wiki.secondlife.com/wiki/LlGetAgentLanguage for more detail) is actively supported since 2015 for all grid users.
Unfortunately , this function still does not support the Hypergrid visitors. The function in that case will reply with the default language set by developers ( en-us ) . So I did seek in to try to have a better look at what is going on . A little check in SL shows that this function only works for a request about an avatar that is in the region of the request for language. This would be compatible with a direct request to the client viewer. I did validate the way the code is made for this function in opensim. Its design is through call to database. The database information itself is updated when the user logs in. So there is no direct exchange from the function call that the viewer would reply to. The result is fine for local users as the information is refresh in grid database when they log in. But since Hypergrid visitors by definition belongs to an other grid their language information is store in the visitors grid database and not made available to visited function call.
So I had to jump in an see if a direct communication is feasible between the viewer and server so that the server can request information out of the viewer after connection to the opensim server. See Hacking Opensim bellow. The conclusion of this effort is that its not possible to obtain the avatar language information, from its viewer configuration settings, out of the login process.
HACKING OPENSIM
I started trying to hack opensim to answer my language question above. I got the source of opensim 0.8.2.0 here http://dist.opensimulator.org/ .Download the source and run the runprebuild.sh so that the solution file are generated.Then in order to read the source of openism 0.8.2.0 I needed mono-develop in linux or microsoft studio in window. Since I work from Linux , I use the former. MonoDevelop can open the opensim.sln file and provides access to the source code and reading of all the code files. With it I am also able to directly "build" and "run" or "debug" the opensim server solution. I can connect my viewer to it and make test as I like. Adding break point in debug mode and using some other debug technics. I had fun exploring the server code in action. But trying to make sense of all those files is not obvious to a new comer. There is this web page provided for developers http://opensimulator.org/wiki/Codebase_overview that got me going . I also found the discussion between Diva and cinderblocks in mantis 7157 ( http://opensimulator.org/mantis/view.php?id=7157 ).
For my language hacking I found that in login process the AgentPreferencesModule is call in to store the values of the login avatar language. This happen only once from the region the avatar log into. Contrary to my original belief. There is no direct communication between the viewer and the server when the script function is called. Instead the function call a database request process internally within the grid server database. A default reply is sent for HG visitor request since they have no entry in database.
I use the console command "show caps list" to get the capacity created for the AgentPreference that includes the language. Those capacities are registered every time the user teleport to a new simulator. That is happening regardless if the user is local or HG visitor in each simulator visited.AgentPreferences /CAPS/7d28b612-88ad-4d85-a47b-567d8faaa9c0
UpdateAgentLanguage /CAPS/7d28b612-88ad-4d85-a47b-567d8faaa9c0
The AgentPreferenceModule uses a delegate call on region creation. This is typically an event handling function. Every time a cap is created this delegate event is added with the appropriate variable .scene.EventManager.OnRegisterCaps += delegate(UUID agentID, OpenSim.Framework.Capabilities.Caps . This call register the capacities for AgentPreferences and UpdateAgentLanguage and provide for support by the viewer. In the login procedure, the viewer replies to that capability with some appropriate response. But when an avatar teleport to a new region the related capability is announced just the same as in the login process but NO answer is received to this announcement from the viewer. I am clueless as to how to induce the viewer to provide the information as I have no idea how this part of the job is done . In order to understand better the viewer to server communication next step is to use the pcampBot supplied with the source code of the opensim. Using a separate instance of monoDevelop I select the pcampBot solution and in the menu for that file I set the option to the run and debug that program with the argument required including the credentials of your bot avatar as follow after creating that account in local test grid:firstname Test -lastname User -password 12 -l http://127.0.0.1:9000/ -s "home" -b n -cBut deception running it fails with delegate error in openmetaverse. So the bot is not created. Doing same direcly in terminal did the same error . Downloading 0.8.2.1 and running pcampBot from stable version did same. So no luck there ...
HACKING VIEWER
Following my language tread my next stop from above is to tackel the viewer communication. I was not successfull in getting a viewer compile. But I found this C# library that contains some basic viewer code . http://lib.openmetaverse.co/wiki/Main_Page . Following instuction in this page I was successfull in downloading the source code with project file and to build and run it in debug mode with monodevelopp on ubuntu 14.04 . There is a nice little application attached to this code call testClient that you can run. In monoDevelop you select that projet folder , and in the pull down menue edit its option to add in the run argument the credentials of your bot avatar as follow after creating that account in local test grid
--first Test --last User_0 --pass xx --loginuri="http://127.0.0.1:9000"
Also tick the run on external console if you want to be able to provide inputs via terminal.
Then simply set as startup project in the pull down menu with that solution selected and proceed with running it in debug mode .
Type help in console and look in amazement your bot solution with numerous commands available for testing. Thanks to Hiro for this work . Its a great upgraded NPCs ... Naturally it requires an account for each bots. But unfortunately for my language test testBot does not seem to reply to AgentPreferences.
Fortunately and thanks to Latif Khalifa Radegast in C# with source is available here http://radegast.org/wiki/Radegast . Its a minimal viewer text base with only with a bit of graphic interface. Once downloaded and runprebuild is done it can be open with monoDevelop and compile and run in debug mode. Its a bit more equipped then testBot and to top it, it react to AgentPreferences with a predefine setting of "en". Testing for my language experimentation reveal that there was no way for a direct request from the opensim server to obtain the language configuration direcly from radegast. At least no way I could find. If someone has suggestion I will be happy to read them .
LANGUAGE SOLUTION
Well I was out of ideas to solve the language problem, and suddenly I cross the path of Ernie Serieman. He suggest to use the web kit embedded with the viewer to obtain the language just the same as one get the language from a web browser . To do that he put up a script that use media on prim. By magic his script show the user language right on the media on prim face. The point was to be able to use that information in a script same as llGetLanguage(). With a bit more work we got it to work as plan. Thanks to Ernie for this bright idea and his help with this. This solution has a lot of advantage. It works with HG and local visitors and it does not require database storage. Sole problem it only work with media on prim active . A demo version is available in welcome of my little grid.
ON LINE INDICATION
Lately ( 0.8.2) I have notice its difficult to create friend link for HG people across grid. Not that the link does not appear and the calling card does not get exchanged between friends. But some friend link seem to be broken for the online indication as it fails in its accuracy to indicate proper online status. Note you can still instant message these friend if they are online but the message will not save if they are not on line. One way to solve the issue is to move to the grid your friend is. This will show his online status correcly and will allow off line message saving. Some time ago (2012) I had made a phone system base on HTML server capability of opensim to communicate between grids. Communication using these was possible between closed and open opensim grids as well as SL . That little tool also included a online indicator which is simple enough to work rather well even under 0.8.2. Should you have an interest in that please visit gimisa5 tutorial area for you test copy .
EVENT
Event can be gathering like danse or live performance. I like srcipting so here we mean scripting events. Timer is an event in scripting . It is trigged at the end of the delay your specify in your script.Its low lag for long delays (minutes) . You have many events that can trigger scripts reaction . Touch (clic object) collision sensor html request are other exemple. There is an interesting Mantis http://opensimulator.org/mantis/view.php?id=7061 that discuss Timer limit and in general offer guidance for events in opensim .
For exemple timers are trottle to a delay not lower then 0.5 second. This makes timer very poor when use as progression clock in non physic movement as the human eye will see anything higher then 0.1sec (10fps and lower). In this tread it says if you need a faster timer, consider using the not_at_target() event which will fire every frame. Beware that might be a lagging idea.
I think that that mantis tread is offering very good guidance from Melanie and should be consulted for detail. I retake a large part here cause its sound information that should be easy to find for whom ever is interested in scripting his world. See SCRIPT PROBLEM. above for more detail on the effect of abuse of some of the event available in scripting and how hard it is to find the offending source once release inworld .
Collision is mention as one of the worst event to handle in term of lag. Collision contrary to touch can happen many times as the object bounce back on it . That is why a low lag trick is to turn everything not needing contact with to phantom. Its interesting that inworld people will avoid going through a wall even if the wall is phantom just because its a wall. Physics step size corresponds to 11fps internally, so the length for an object collision to be detected is speed divided by fps . For exemple a 30ms speed object under 11fps we will compute about 3m for the size of the object in direction of contact needed for detection. At walk speed 1ms the same lenght is compute to about anything thicker then 0.1m . That is why colision between avatar works well while firearms bullet collision is tricky and use llCastRay .
So Melanie recommands NO listeners if they can be avoided, ABSOLUTELY NO LISTENERS on channel 0. I will add that Dialogue is more approriate then channel 0 for object commands. In generale osMessageObject is better for object direct communication. But copy of object need to be specifically addressed. And for a reason I ignore object inworld have changed UUID on me so this solution is not perfect expect a bit of tweeking to gain performance.
As she says every script on the receiving side needs to wake up, even if all it does is discard the request with a IF . Stuff that uses chat commands, use specific listeners so the filtering is done by the sim, not the script. So to me in other words use many specific listener instead of many IF . Also as she says It's cheaper to wake one script multiple times instead of many scripts one time and that is true for all event I would say. So one event handler per object is probably desireable.
Same idea linkMessaging is better as more specific than listen . And the better if specific link is targeted.
Finaly she point to avoiding physics like the plague. llKeyFrame is your friend for non physic movement. Also Repeat raycast or sensor is laggy too. Use a packed message protocol, messages have overhead so of you can pack more than one message to one object do it .
Thanks to Melanie to have provided insigth into better scripting form the developper standpoint.
MEMORY
gimisOS is running on two machines. And as I am building and pilling script I get more and more slugish response. So I was wondering if my work load is properly spread. One of the thing that makes a respond sluggish on a server is if you dont have enough ram for the task . System is using swap to swing pieces of data or code not use for a while in exchange for free space to take in new stuff.That mean that if all your simulator data is not in memory the swap is call for in the rescue and cpu has to work to get that data back in memory and sent it to your user. So here is a take of my memory usage and simulator division. :
Server regions Mem size(Mb) Swap(Mb) Threads ! Scripts Prims OAR(Mb) g5 5 3,758 33 94 1,593 13,314 153 g4 4,6 2,025 396 82 1,491 17,100 107 g3 3,rose 1,856 0 95 1,008 7,085 37 gi 1,7,8,9 1,935 374 113 618 8,859 35 go 2 to the other by 256m or more of empty space 460 2 to the other by 256m or more of empty space 54 13 53 ro - 164 4 23 my - 40 17 37 total 10 10,238 826 4,723 46,411 11,064 (mem + swap)
You might notice that a bare bone simulator pick up about half a gig for running with only one region. You might also notice that the quantity of prim is not an indicator of memory load so is script number . Something more indicative is the size of the corresponding OAR . So my two machine should have 6 Gb of ram to face the load and a good spread would be g5,g3 and the remaining on the other one .
RELIABILITY
Is an important element of any server. Adding features is nice but if these features are not reliable to perform each time consistently its a problem. And if after a while the system crashes because of accumulation of micro failure its even worst. Unfortunately because of the nature of open source opensim and the creation content done unequally by users ( like me!! ) Opensim is prone to instability that lead to crashes. In average one or two crash a week is happening on my region even on weekly restarting of the simulator. Its hard to pin what exactly lead to that crash specially with the message provided in log for linux system where open file is not identified. And even if it was that message is more meaningful to developers then to casual operator like me. So for all those good or not so good reason I have added a routine in my cron job to validate if the simulator is running.
Running on linux I edit my cron tab to add that checking routine every so often ( 4 hours ) with the name of the screen session like:
sh checkRunning.sh g1 g5 with my opensim starting bash being g1.sh and g5.sh and my screens names being g1 and g5 .The Code is : #!/bin/bash for var in "$@" do if ! screen -S $var -X select . ; then sh ~/$var.sh echo 'restart' $var $(date ) >> ~/log/$var.log fi done
CONSOLE COMMANDS
Those are the commmand you can use to control and get information from you running simulator or grid server. The list and detail can be found on this web site here opensim console command list . Help can be obtain on those command by typing help then the command to get help. The reference page is not updated as it seem some command name have changed ( version 0.8.2.1) . For exampledelete object uuid <UUID> should be ''delete object id <UUID>'' show object uuid <UUID> should be ''show object id <UUID''
GRID LAYOUT
What is the impact of grid layout and what about varregion and regular region effects. Let start with viewer reach. The reach maximum value is 1024m . That set distance act like a fog that limit the perception of object. Note that for people with low graphic card reducing that value help performance by reducing the number of object the card has to handle .
That is an avatar will perceive an object and apply level of details to it from that set value down. Like in real life you perceive object detail as you move closer to them . In openism / second life the switch distances for an object are proportional to the object "radius", which is the half-diagonal of the bounding box. It can be calculate as r = sqrt(x*x + y*y + z*z)/2, where x, y and z are the dimensions of the object in meters. The first switch, high to medium LOD, is at: rvlf * r/0.24; the next at 4 times that distance, and the last at 8 times. For a 1m cube,that is 3.3, 13 and 27.
Sound complex , let try to shed a bit of light on this idea. A good representation of the level of detail of an object is its triangle count. A standard prim cube of 1m x 1m use (6 x 9 x 2) 108 triangles in all its faces as seen from a 3.3m location. At a 13 m the viewer will present only ( 6 x 4 x 2) 48 triangles and finally at 27m the viewer will present ( 6 x 1 x 2) 12 triangles.
So what does that have to do with grid layout. I might need to be corrected here but every time you log in a region you get sent all the object texture and shapes detail to your reach distance. If the scene is static and you dont move that is all you need for rendering. The proof of that is when the region lag a lot, rotating on yourself is always performed and rendered properly.
A static scene like a picture is limited in interest . Moving is what give life to virtual. Moving in the scene can be rendered by simple recalculation done at the graphic card . But moving updated information is required to present object that were previously out of your reach distance and to correct object/avatar that themselves are moving. in the scene.
Grid layout yes, we are getting there. When an avatar log in a region it creates child avatars. There is a maximum of 8 child avatar created in each of the region adjacent to the landed region. This allow the other region information to be communicated to the viewer. This is the mechanism providing perception of object at the reach distance across the region boarder. More importantly these are the ONLY region the avatar can perceive cross boarder. That is even if the reach distance is 1024m and the avatar is standing on the middle region of huge grid , he will only perceive object in the region that have created child avatar for him .
Is this fact important for Grid layout. You bet. Say I want to create a huge city . With opensim 0.9 its possible to stack varregion side by side and say make a 12,288m x 12,288m plot. We cant go with varregion size higher then 8,192 so you would be a bit short with only one varregion. You could divide it say in 3 x 3 of 4096 x 4096 varregion.. But if I am correct , in any of those case your avatar standing on the city center would have child avatar in a surface representing a huge area compare to the reach distance of the viewer. Anyhow the viewer will not handle more then the reach distance . Nor will it reach further then the neighbourhood where child avatar are created. This is important performance consideration cause on regular region of 256 x 256m viewer reach distance of 1024 is not accommodated in practice since standing on the middle of a region the avatar can only see 128+256 = 384m in any plane except height.
So if your selection is to accomodate 1024, with at minimum continous reach, you would contemplate varragion of 2048x2048 to fit that reach distance to the closes possible. In this case 6 x 6 of 2048 x 2048 varregion would be feasible. What if size is bigger. This is similar to having a reach of 64m in regular region, the cost is minimally to create the 8 child avatar. In any case the visitor will not see more then his reach capabilty.
But if you needs is not as large and performance is your concern, then you prefer people NOT to perceive scene object from you neighbors .So the trick in that way of thinking is opposite and you want to have an empty region ( no region at all ) in all direction centered on your scenery. So that NO child avatar are created around you region that will drain down uneceesary overhead and viewer bandwith when reaching boarders with stuff from you neightbourgh. Once you have establish a no man land zone around your area, selecting varregion size is up to how much of you scenery should be perceived in one glow. So one region of 8132 square would be your maximum in this respect. While standard region size of 256x256, with teleporter sending people in layer of 1024m in height is still a valid sizing to consider particularly for smaller areas in my opinion. By the way should you not know opensim supports construction over the 4096 limit. I have seen scene made at 8000m on top of a regular 256x256 regular area. So varregion already exists for a long time heightwise!!.
ROBUST
When executing the simulator as a standalone either hypergrid access or not you get two part. The grid service like login and assets and the simulator services like physic and avatar rendering functions. The simulator is using mutlitread in scripting and avatar rendering. Multi tread is the ability to execute multiple processes concurrently. The grid part is on the other hand single treaded meaning that it executes one service after next. In stand alone mode thow its normaly not intended to have multiple opensim instance running and connecting to each other. The way to run multiple region is done one one opensim instance by define as many region as one want in region directory and have only ONE opensim instance running. This is the way diva distro is proposing. Simple and efficient if your needs are limited to a few regions as the rule of thumb is one region per cpu plus one for the opensimulator process. In this way when performance degrade one have to think in speading the load differently. The way proposed by opensimulator is the robust server to split the grid services ( logging , asset ... ) from the simulator itself.
The idea of Robust is the service server of a grid. Robust is dicussed here http://opensimulator.org/wiki/ROBUST .Its possible to connect many simulator run on different computer to the robust instance run on an other machine. This is the way use by large grid like osgrid. The configuration of running instance of osgrid can be found here http://www.osgrid.org/?q=node/12 . Not all service can be run separately so osgrid is a good exemple of feasible splits. Without going to deep one can see that osgrid uses multiple robust instance and multiple opensim instance on different computers . Its configuration is through robust.ini or as explain through a file effectively named in the startup arguments.
I dont have a large grid but I use multiple computers so running robust is the way for me for a while now . But my asset is growing since 2010 as opensim assets handling is never to delete any. So each time you create or change a notecard , texture you upload even duplicate , end up cowling in the asset server ( more about FSasset in next article ) . So I though hey lets run multiple instance of robust too and separate assets service on an other computer. So my idea is to have appropriate robust.asset.ini for robust instance serving assets and the remaining service in robust.noasset.ini for the other robust.ini I found this page very usefull in helping me address this split appropriatly http://opensimulator.org/wiki/Shared_Services_Configuration . You can find my config files at this address http://ddd.gimisa.ca/config.html or by visiting my grid hypergrid dome in gimisa5.
FSAsset (Added note 170507)
In 2015 Osgrid had a major asset crash. This was an experience for all grid owner as to what can happen if database corruption or hardware failure treat you grid installation. OSgrid like any good service providers had implemented ways to overcome both these disruption by using raid mirroring as related in following article http://www.hypergridbusiness.com/2015/03/avination-helps-save-osgrid-donates-cluster-storage-solution/ .
I am not acquitted any closely with OSgrid operation more then a user is. I have no clue of the nature of the failure but the article is point to the use of FSAsset as an alternative to whatever OSgrid was doing. I am using MariaDB in for my database which is a fork of MySQL. But the problem remain that large database file size are created when using standard way of storing the asset in the database itself.
There is no magic in storing information and the compress asset data has to reside somewhere. Melanie solution is to have it stored in the file system itself instead of the database and use the database as pointers ONLY to the proper asset on disk . This makes the database itself much less subject to corruption and reduced its size to be easily dump for backups remotely.
There is more detail about FSAsset setup in http://opensimulator.org/wiki/FSAssets_Service . The article is suggesting to use FSAsset for 50G database size. I decided to go forward even if mine is a mere 15G. My problem is backup of this HUGE database . A backup system can be full backup like raid images , now a day with low pricing for storage space this is the preferred choice. Because of limited resources I am still using incremental backup or what is call snapshots of the drive with the help of DIRVISH a linux backup program. This method takes up much less space due to the incremental nature of the storage. But you can imagine that using this method with database file size of 15G is somehow defeating the purpose. Having smaller database file size and using files system for storage offer the elegant alternative of using system tools and standard backups solutions.
One more interest raise by Melanie FSAsset storage is the possibility of database reconstruction using the files already stored in the asset directory. Though I could not find any documents that would support that , I am incline to believe that even with destruction of asset database and corruption of part of the asset directory it would be possible to reconstruction the database pointers from the good element of the asset directory structure.
Database and large file are MySQL engineered way to speed for large database installation with many users and demanding services. Getting out of that framework has detrimental effect on speed. In normal asset upload I saw no noticeable delays. But I found that speed is the cost when loading large oars of fresh new asset. FSAsset first checks the database to see if there is a pointer to the UUID of an existing asset when loading oar to avoid loading duplicates and destroy existing assets. So as asset base increase to more then 50G ( the recommended size to use FSAssets) this should trend in reducing the asset handling time and damper the delay witnessed in freshly loading grid like I did.
About a month after writing this paragraph I have a hard drive crash. It was time to face the music and see if restoring the mysql database and FSasset folder would do the magic. I am happy to report it did....
DATA:URL
Data:URL replaces a tag reference with direct encoding either of image text or html. They are an interesting tool in web page design to lower the overhead of getting the page to user by embeding the data direcly in the page content instead of by reference. By doing only one call to server this provide for a more efficient page loading.
This way is available to media on prim or to html server via scripting in opensim / SL . The documentation provided by second life can be found here http://wiki.secondlife.com/wiki/LlSetPrimMediaParams/Tricks . Any prim can be use to the limit of 1024 characters as web server or to present content as a web browser where that content is included in a data:URL string. I have also tested that javascript is available as well as html style formatting. You can find two example of use of data:url in gimisa5 store of my little grid. one as a sound media testing tool i did to validate different codecs and the other one present a picture and text from notecard containing html. You can also find work done by Edison.Rex @hg.zetaworlds.com where data:url is use in Multifunction Nautical Navigation Panel to dynamically present speed and navigation data.
One very important advantage of DATA:URL use in MOP is full control of dynamic presentation. While it represent very little load on the server compare to the use of a animate or dynamic texture . One draw back is that viewer are configured by default for MOP on request only which is leaving the content designer to request change to the user setting in order for the presentation to be visible.
IRC
Internet relay chat servers can be use to provide script communication between objects in different region. Something not so easily done with html internal servers. Reference is provided by both http://opensimulator.org/wiki/IRCBridgeModule#Object_chat_relay_mode and http://allenkerensky.com/ircbridgemodule .
I am using ngircd as IRC server ref: https://ngircd.barton.de/ . Accepted default except server name and welcome sentence. You can test your server by connecting to it with any IRC client with the address of your server. That server port 6667 (default) should NOT be accessible from the net if you want to keep things under control.
You need to copy paste the [IRC] part in your opensim.ini (simulator) from the link above. This is what mine look like :[IRC] enabled = true ; you need to set this otherwise it won't connect server = 192.168.2.xxx ; change to suite your could be 127.0.0.1 ;password = your access to server password if needed" nick = gimTest ; any name will do Allen suggest region name user = "USER gimGrid 3d.gimisa.ca:9000 * :gridwide bot" ;did not see where this is use randomize_nick = false ; as suggested by Allen prevent extention to nick channel = #opensim ; channel you want for your application port = 6667 ; standard port relay_chat = false ; if you leave this true it will listen to channel 0 (open chat) report_clients = true ; it reports when someone log ( see note * ) commands_enabled = false ; I am not using the command feature command_channel = 4711 ; command script channel access_password = "xxx" ; password relay_private_channels = true ; this is where we have object communication relay_private_channel_out = 4712 ; any script channel you want to llSay to IRC server relay_private_channel_in = 4713 ; any script channel you want to Listen to IRC server msgformat = "PRIVMSG {0} : {3} :{1}" ; format of what Listen function receive , {0} is nick of sender, {3} is message , {1} is sender
The following is a test script that show how this come about inworld://gimisa@yahoo.fr //to use this script avatar type a message inworld on channel 33 . example : /33 Hello World!! //as seen from script: integer relay_private_channel_out = 4712; integer relay_private_channel_in = 4713; string password="xxx"; string from="TESTER"; default { state_entry() { llListen(33, "",NULL_KEY , "");//to capture the avatar message to send llListen(relay_private_channel_in, "",NULL_KEY , "");//to capture message from other object. } listen(integer channel, string name, key id, string mss) { if( channel==33){ llSay(relay_private_channel_out,llList2CSV([password,from,mss] );//sending message to IRC server return; } llInstantMessage(llGetOwner(),llList2CSV([channel,name,mss]));// receiving message from IRC server and relay back to owner } }
The /33 Hello World!! show up on IRC server as <gimTest> Hello World!! :TESTER and in world as in all other listening regions 4713, gimTest@IRC, Hello World!! :TESTER . Note that you can set the from to any string you want which is neat to qualify the message further for scripting purposes . As an additional application note it seem as far as I could test that you cant use USER chat command like /PRIVMSG in your message to IRC server because the IRC module add a space in front of the message.
- Note: that IRC report_clients = true; cannot be use to report arrival of client in the region the IRC script is running . It reports to all others region you have IRC implemented but not the one seeing client arrival.
EMAIL 180828
EMAIL is an other module of interest at least to me in opensim . Both EMAIL and IRC are complementary communicating with avatar,or between avatar and object . For exemple , a friend pointed at me laterly that my IMs dont get saved. That is IMs made by other in gimisaOS grid show a message saying that it not saved due to message limit. I dont send my IMs to email cause that option is not available to me in singularity . No idea why, is it a bug ??.
Anyhow, the problem is I use a lot of instant message from object in my scripts to get running status and so on. I have DIVA offline V2 configured in 090 . I have validate that 25 instant messages from all sources is all that get save in database for delivery when you back on line. I do receive the one that appear in database but the other that are cap off and never stored are simply drop. No warning in scripts, but warning is effectively provided in IMs status message to attentive emailing avatars.
I could send my instant message to IRC instead of IMs to me to save on the limit and keep the 25 storage capability for avatar to avatar messages only. But this is only partial solution. Obvious solution is EMAIL. It would be nice to find why my singularity will not accept sending offline IMs to my configured email is one thing . And using the scripting function already available to object IMS to emails is an other. I will not repeat here the very good tutorial made http://liftedpixel.net/blog/posts/getting-llemail-to-work-in-opensim. Even if done for diva distro this tutorial is accurate and is getting you almost there.
Ya almost. The module ini [SMTP] portion that you will find in opensim.ini need address of you prefered SMTP server with credential to access it . Configuring this data is not different then configuring you account in outlook or any email client you use. You need the same information , so look into you email account info and complete the ini data as required is all it takes.
Well almost, if your account is like mine, you hit a soft spot with the encoding requirement. Most of smtp these days use some kind of encoding for credential information ( passwords ) . And the opensim EMAIL module does not have encoding information integrated in configuration ini file. (something that certainly could be corrected if of interest to developpers ). So to connect to external smtp server that need encoding you off luck unless as suggested you find one that dont use encoding.
And on a linux machine .. yes ubuntu again . You can install a number of smtp servers. But having you own email server come with all kind of issue and troubles that you would certain be happy to avoid when considering that all you need is offline IMs capabilities via email. Nevertheless its possible to install postfix a mail server for local email only . Refer to WIFI email further down this page if this solution is of interest to you.
To the rescue linux offers a very tiny SMTP mailer call nullMailer. Its a snap to install and configure to DIRECT your emails to a email server of your choice ... including encoding !! This is not a tuto to install it but if you need help come my way , it will be a pleasure.
So arm with nullMailer what you do .. Ya one more step , cause nullMailer is only SENDING email you need something that will receive the one on the module side of opensim and relay it to nullMailer. What I use is the piece of code here running on python.
import smtpd import asyncore import subprocess class CustomSMTPServer(smtpd.SMTPServer): def process_message(self, peer, mailfrom, rcpttos, data): print 'Receiving message from:', peer print 'Message addressed from:', mailfrom print 'Message addressed to :', rcpttos print 'Message length :', len(data) print 'Message :', data cline = 'echo "'+data+'" | mail -s "'+mailfrom+'" rcpttos' return subprocess.check_output(cline,shell=True) server = CustomSMTPServer(('0.0.0.0', 1025), None) asyncore.loop()
These few lines above from python2.7 will do the magic. So that you can input in your ini file the following very simple credentials , where this python file and opensim operate on same machine.;# {SMTP_SERVER_HOSTNAME} {[Startup]emailmodule:DefaultEmailModule enabled:true} {SMTP server name?} {} 127.0.0.1 SMTP_SERVER_HOSTNAME = "127.0.0.1" ;# {SMTP_SERVER_PORT} {[Startup]emailmodule:DefaultEmailModule enabled:true} {SMTP server name?} {SMTP server port?} {} 25 SMTP_SERVER_PORT = 1025 ;# {SMTP_SERVER_LOGIN} {[Startup]emailmodule:DefaultEmailModule enabled:true} {SMTP server user name?} {} SMTP_SERVER_LOGIN = "" ;# {SMTP_SERVER_PASSWORD} {[Startup]emailmodule:DefaultEmailModule enabled:true} {SMTP server password} {} SMTP_SERVER_PASSWORD = ""
Please note that this crude SMTP server is not available from outside grid on port 1025 so it cannot receive external mail .Can this be abuse ... Oh yes like anything, but its functionnal minimum and yours to have fun only !! In your script inworld now you can now use something in line with the following and send the information via email instead of crowding your instant messages.
string emailAddress = "gimisa@yahoo.fr"; string emailHeader = "Someone touched me!"; default { touch_start(integer num_detected) { key id = llDetectedKey(0); string name = llDetectedName(0); llEmail(emailAddress, emailHeader, "I was touched by: '" + name + "' (" + (string)id + ")."); llSay(PUBLIC_CHANNEL, "Email has been sent."); } }
BENTO (update 171128)
I salut Gaia work in doing avastar and support. For the sake of making this discussion lets call FITTED the adjustable mesh body and lets call RIGGED the rigid original skeleton ( rigid for Breast and Butt ) . He has provided his bento rig in https://blog.machinimatrix.org/avatar-workbench/ that has all the deformation bone required for fitted mesh body using standard sliders. Now come bento . The bento skeleton present officialy by SL for blender ( http://wiki.secondlife.com/wiki/Project_Bento_Testing) is RIGGED ( rigid ). Iit cannot be adjusted as a fitted skeleton can. ( rigid for Breast and Butt ) . It is missing the deformation bones required for fitting behavior to apply. It had probably been corrected in later releases as maya object but no other release were done in DAE format.
Anyhow that trigger to probe the behaviour difference between RIGGED body and FITTED clothing. Having a rigid body allow adjusting the FITTED mesh clothing to the rigid avatar by way of adjusting the cloth breast and butt while the rigid avatar will stay as is.
In addition the SL BENTO mesh body can be textured using skin and clothing texture since it has same UVMAP as system avatar.
The problem of shape vs clothing adjustment was formally solved in system avatar by adjusting the cloth attachment to fit the avatar . The introduction of fitted mesh avatar which is only a layer on top of the system avatar uses the sliders to modify the skeleton which prevent adjusting fitted body and fitted cloth separately.
There is many clothing shapes floating around from the former rigid design to the later fitted one. They fit system rest shape with more or less success and at a leaser degree any other shape twist. Fortunately Gaia has made a nice effort to insure that the work done with their blender plug in fits the system shape as best as possible given the proper mesh model shape sizing versus the inworld slider position. So that what you see in blender is what you get in virtual worlds if the two model are adjusted appropriately.
You can scale a mesh cloth inworld as you want. The armature bone will scale with it so that the weight relation of the bone to the mesh remain the same. There is no way to modify a mesh clothing inworld except with body sizing sliders.
In my experience with rigged body and fitted mesh clothing where cloth breast and butt can be adjusted separately from the rigid body I saw that it was possible to optimize the fittings of clothing for those parts of the body. The result is very partial since it involves only two adjustment over the total available for the shape. It simply demonstrate the concept that adjustment of the cloth need to be done on its own from the body shape.
It seem what is needed to get back the freedom of choice once possible with system body and clothing is to mimic the former behaviour inworld and allow adjustment of the different cloth separately from the shape of the body. This could be done by way of SELECTING the part that the body adjustment slider influence. Future will tell...
RLV
Replacing NPC in area where NPC functions are not active for the user was the idea behind exploring RLV. RLV is the acronym for restrain love. This is a feature available in certain viewer that with client consent allow certain script controls. The full spec of this feature can be found at http://wiki.secondlife.com/wiki/LSL_Protocol/RestrainedLoveAPI and an example of the script control that can apply is provided with http://wiki.secondlife.com/wiki/Quick_Collar .
The idea is to create an alternate avatar that can obey script function . One famous such bot is Corrade http://grimore.org/secondlife/scripted_agents/corrade . Corrade give scripting access to all function a viewer have. NPC are more limited in the command available and RLV is easier to implement to match same feature as NPC. Naturaly the cost is a full f ledge agent load on the server compare to lesser load a NPC presents.
RLV can be use with script control to attach/detach an item from inventory. The attachment script can then animate and move the BOT. In addition its possible to use a script to teleport a BOT from one area to an other something NPC cannot do. The RLV functionnalities become necessary as a work around in version 090 as its not possible to use the regular lsl script function llTeleportAgent or llTeleportAgentGlobalCoords to teleport an agent using an attachment in opensim. With RLV the function lOwnerSay( "@tpto:<X>/<Y>/<Z>=force" where X Y Z are global coordinates which make this function equivalent to llTeleportAgentGlobalCoords. RLV provides also a way to rotate a BOT which is hard to do with an attachment. By using llOwnerSay( "@setrot:<angle_in_radians>=force" ) its possible to do that.It is interesting to notice that the 0 rotation in opensim is with avatar facing east.
Therefor that RLV function need description correction as follows:Forces the avatar to rotate towards a direction set by an angle in radians from the north is wrong and its direction to the EAST.
I have done such a bot for a pet DOG that will follow you in any region that allow scripts. A demo is available in gimisa5 region of my little grid.
OPENSIM version 090 llMove2Target, llListFindList
Two very usefull function if you do scripting. llMove2Target will allow your avatar or physic object to be moved around with script . The second one I use a lot to do indirect reference.
Problem with move to target of version 090 is that it get your avatar in fly mode / landing transition when your avatar is moved to something else then flat land . I did a hand to hand movement using this function where two avatars hold hands and this cause erratic behavior that break the synchronization between the two actors. The work around I found for now. Is to set the target z value to 0.5 . The draw back of this work around is that it allow avatar to walk on terrain only .
The problem with list find list is a bit tricky . If you store a string variable in list you can easly convert it to an integer by extracting the value to with llList2Inter function . But contrary to 0821 if you try to find a string like 123 with a search on an integer like [123] it will fail. So there is now differentiation in the search between both types . Using ["123"] in the search will be successful. That brakes a few function I have including the object sorter I did to help make sense of large inventory .
See example of work around for those function in gimisa5 store.
BACKUPS
Backups is the most important strategy for system reliability. There is many method and software to help you in that task. I present my receipt using linux server system yours to adapt. There is three type of backup. Full backups , incremental backups and a variance of it call snapshots. I use G4l to fully backup the disk drive every 6 months. https://sourceforge.net/projects/g4l/ . And I use dirvish as a snapshot utility that provide me with the flexibility of incremental daily backup with the convenience of a snapshot where you select the date and the content to restore. The detail of my setup can be found in http://ddd.gimisa.ca/backup.html .
CACHE
In opensim there is server cache and viewer cache. Clearing cache in viewer is often done to correct corruption or to simply clean it of unnecessary cumulative stuff. Server side is use by the simulator to allow faster transmission of asset without having to go back to asset server. See http://opensimulator.org/wiki/AssetCache for a presentation of the server side cache. Lately Alexandra RunningBear from osgrid ask me if I was using server side cache to help for lag. My answer was that I have created FlotsamCache.ini from FlotsamCache.ini.example with the defaults included it the file.
; Set to false for no file cache
FileCacheEnabled = true
Alexandra kindly pointed out that since I have more then one simulator running; each one of them is running his own cache in location specified. Which is by default:
; cache directory can be shared by multiple instances
CacheDirectory = ./assetcache
But since in my case I am using the SAME instance to run different simulator (see my configuration for detail) . ALL simulators use the same cache location. The default file cache timeout is set to 48 hours. So each simulator check to see if the asset in the cache was not access within 48 hours and delete it from cache. This is much less then optimum as every one of the simulator is trying to control the cache for its own assets. So she suggest using disabling time out and use a manual approach to cache control. In order to do that the configuration need to be changed for:; How long {in hours} to keep assets cached on disk, .5 == 30 minutes ; Specify 0 if you do not want your disk cache to expire FileCacheTimeout =0 ;was 48 default ; How often {in hours} should the disk be checked for expired files ; Specify 0 to disable expiration checking FileCleanupTimer = 0 ;was 168.0 ; ( 7 days )So now that the cache is manualy controled how do I do that ??? In linux that mean a cron job and in window a scheduled task. My system being linux the following address the cron job. The job itself is rather simple as follow:
file name cache.sh: #!/bin/bash dat=$(date --date="-30 days" +%y/%m/%d) dat="fcache expire $dat" echo $dat screen -xS screenNAME -X stuff "$(echo $dat) fcache status " echo done the crontab command in this case is : 5 1 * * 0 sh cache.shThe crontab run cache.sh every Sundays at 1:05 . The job execute a console command in the simulator running under screenNAME and clean cache for 30 days old assets. Also it requires a status of the cache so you can tweak the setting to optimum value for your case.
VIRTUAL MACHINE
Combining Opensim a virtual world with a Virtual Machines is an interesting idea. VirtualBox is a software to run a machine inside a real machine and opensim is a virtual life you real life can enjoy. To have your own world , you can use the predefined download from the major grids and attach a region to them. Osgrid , Metro, Neverworldgrid, and Zetaworld to name a few that offers that possibility.
If you want to have your own thing on the metaverse planet, one choice is to use the download at opensimulator ( ref http://opensimulator.org/wiki/Download ) . Out of the box it will install as one region standalone. For hypergrid, use diva distro. ( Ref: http://metaverseink.com/Downloads.html ) This distribution allows an easy install of a hypergrid enabled standalone. Another choice is sim-on-a-stick. A diva distro flavor installed on a USB stick that you can run easily by simply plugging in the stick in your machine's usb port.( ref http://simonastick.com/ ). It dates a bit now with OpenSimulator 0.8.0 post-fixes. Also available and current in release is , diva built DreamWorld, and robust grid DreamGrid ( ref https://www.outworldz.com/outworldz_installer/).
When Lisa Laxton from IMA came to me about an installation on her rented server for grid.metaversedepot.com she had choices from all above. In addition, she had the choice to use the no longer supported MOSES-in-a-box (ref https://github.com/M-O-S-E-S ) not current and not hypergrid enabled. She tested all of the above solutions but really wanted a better solution that was platform agnostic for anyone to use. DreamGrid is a nice easy to use tool but it is limited to the Windows operating system. The Windows operating system is also not free for anyone to use like Linux. Other operating systems like Mac and Solaris are also not supported. As demonstrated by the MOSES team, the free to use VirtualBox will run on all of these operating systems and allow the creation of VM's to host Open Simulator.
So the idea is to have ROBUST hypergrid enabled Open Simulator grid using multiple virtual machines with a clonable VM (for adding simulators/regions) that will run in the free VirtualBox software for any major operating system? If so, is it also possible to simplify installation and administration without a graphical user interface so it can be install on servers?
So install the virtualbox software ( ref https://www.virtualbox.org/wiki/Downloads ), then import the virtual machine image to start the grid. And run !! ... Hmm, not so fast !!! The difficulty in opensimulator installation is ports. Virtualbox cannot solve that nor any of the above distributions. I am sorry to say its not easy to do for everyone. Luckily for rented servers like Lisa, a mechanism is in place to help port access settings.
So virtualbox is easy to install, set, and run on a server. What else is it good for? Plug and play ...lol!! You can have a machine running, save state, change stuff, etc. If you realize you did wrong you can fall back to a saved state. You can clone a machine and have two simulators ready in minutes ( adjusting for ports ). You can send that clone to someone else to be part of your grid. It could, I believe provide sim on demand. That to be developped. Backup is as simple as cloning the machine. ( This is a large file. ) Any problem or extra load on one simulator does not interfere with the other running machines because of the inherent segregation between them. It also provides protection to the host system as it remains out of reach from the guests.The buzz word is flexibility. The limit is yours.
But what are the drawbacks? Large space counted in Gs for running a 180MB program. Limited resources by simulator that will likely affect performance compared to the same install directly on a host. Management of machines parked. Operating experience will tell over time. See Lisa blog for more details.
SEARCH
DIVA has done a proof of concept about searching capability in opensim. The module required are part of the diva distro that can be find on her web site http://metaverseink.com/Downloads.html and for people that dont use diva simulator standalone distribution a addon is availbable to provide the appropriate coding. Detail on her work can be found here: http://www.metaverseink.com/blog/news/metaverse-ink-search-for-opensims/ . Metaverse search option are available at this location http://metaverseink.com/docs/tips.html . Please note Metaverse search facility is broken since about begining of the year as it was before and as it was never intended for full fledged support as opensim searching tool. Any grid owner can implement his own search facility using the simulator datasnapshot data with the help of the following two php sources. search php source code for access registered datasnapshot information:<?php $dbug=false; $sval=mysql_real_escape_string($_GET["sname"]); echo "searching for ", $sval," \n"; if ( strlen($sval) <3){ echo "need more then two letters to make search please \n"; return; } if ( strlen($sval) >63){ echo "not more then 63 letters to make search please \n"; return; } if (!preg_match("/^[a-zA-Z ]*$/",$sval)) { echo "Only letters and white space allowed \n"; return; } $sval="%".mysql_real_escape_string($_GET["sname"])."%"; $DB_HOST = "localhost"; $DB_USER = "opensim"; $DB_PASSWORD = "xxxxx"; $DB_NAME = "ossearch"; if ($dbug){ echo $sval; echo "<br/>"; echo $DB_HOST ; echo "<br/>"; echo $DB_USER; echo "<br/>"; echo $DB_PASSWORD; echo "<br/>"; } $conn = mysqli_connect ($DB_HOST, $DB_USER, $DB_PASSWORD, $DB_NAME); if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } //$sql = "SELECT * FROM `objects` WHERE `name` LIKE \'%Tulip%\' LIMIT 0, 30 "; //$sql = "SELECT * FROM `objects` WHERE `name` LIKE '%Tulip%' LIMIT 0, 30 "; //$sql = "SELECT * FROM `objects` INNER JOIN `regions` ON `objects.regionuuid` = `regions.regionuuid` LIMIT 0, 30 "; //$sql = "SELECT `regionuuid` FROM `objects`"; //$sql = "SELECT `regionname`, `regionuuid`, `regionhandle`, `url`, `owner`, `owneruuid` FROM `regions` WHERE 1 LIMIT 0, 30 "; $sql = "SELECT `location`, `name`, `description` , `regionname` FROM `objects` INNER JOIN `regions` ON objects.`regionuuid`=regions.`regionuuid` WHERE `name` LIKE '". $sval . "' LIMIT 0, 300 "; $result = $conn->query($sql); if ($result->num_rows > 0) { echo "found ".$result->num_rows." item(s) clic on the link below TWO times to teleport to object \n"; // output data of each row while($row = $result->fetch_assoc()) { // echo "Name: " . $row["name"]. " - Description: " . $row["description"]. " RegionName" . $row["regionname"]." Location" . $row["location"]. "<br>"; echo "NAME: " . $row["name"]. " - DESC: " . $row["description"]. " - LOC https://gimisa/region/" . $row["regionname"]."/" . $row["location"]; } } else { echo "0 results"; } $conn->close(); ?>As explain here http://metaverseink.com/docs/listing.html To create your owne address search location using the above is as simple as populating the opensim.ini file with your site data. For exemple for my location (3d.gimisa.ca:9000 ) the opensim.ini dataSnapshot configuration is changed as follow with data_services pointing to metaverse search location in addition to my own internal location search facility :
[DataSnapshot] index_sims = true data_exposure = minimum gridname = "GiMiSa" ; 1 hour default_snapshot_period = 13600 snapshot_cache_directory = "DataSnapshot" data_services="http://192.168.2.105/register.php;http://metaverseink.com/cgi-bin/register.py"The data_service register.php code is as follows:
<?php ////////////////////////////////////////////////////////////////////////////// // register.php // // (C) 2008, Fly-man- // // This file contains the registration of a simulator to the database // // and checks if the simulator is new in the database or a reconnected one // // // // If the simulator is old, check if the nextcheck date > registration // // When the date is older, make a request to the Parser to grab new data // ////////////////////////////////////////////////////////////////////////////// include("databaseinfo.php"); //establish connection to master db server mysql_connect ($DB_HOST, $DB_USER, $DB_PASSWORD); mysql_select_db ($DB_NAME); $hostname = $_GET['host']; $port = $_GET['port']; $service = $_GET['service']; if ($hostname != "" && $port != "" && $service == "online") { // Check if there is already a database row for this host $checkhost = mysql_query("SELECT register FROM hostsregister WHERE " . "host = '" . mysql_real_escape_string($hostname) . "' AND " . "port = '" . mysql_real_escape_string($port) . "'"); // Get the request time as a timestamp for later $timestamp = $_SERVER['REQUEST_TIME']; // if greater than 1, check the nextcheck date if (mysql_num_rows($checkhost) > 0) { $update = "UPDATE hostsregister SET " . "register = '" . mysql_real_escape_string($timestamp) . "', " . "nextcheck = '0', checked = '0', " . "failcounter = '0' " . "WHERE host = '" . mysql_real_escape_string($hostname) . "' AND " . "port = '" . mysql_real_escape_string($port) . "'"; $runupdate = mysql_query($update); } else { $register = "INSERT INTO hostsregister VALUES ". "('" . mysql_real_escape_string($hostname) . "', " . "'" . mysql_real_escape_string($port) . "', " . "'" . mysql_real_escape_string($timestamp) . "', 0, 0, 0)"; $runupdate = mysql_query($register); } } elseif ($hostname != "" && $port != "" && $service = "offline") { $delete = "DELETE FROM hostsregister " . "WHERE host = '" . mysql_real_escape_string($hostname) . "' AND " . "port = '" . mysql_real_escape_string($port) . "'"; $rundelete = mysql_query($delete); } ?>A demo searching object can be found in almost all regions of your friendly gimisaOS grid.
INSTANT MESSAGES
They are the backbone of social interaction in opensim alone with local chat and voice. This feature works very well in local grid where two avatar or an object to avatar communication is possible across the entire grid. HG INSTANT MESSAGE is the ability to communicate with other avatar across grid. The general spec of that initiative is given by DIVA in her 2011 blog ref : http://www.metaverseink.com/blog/hypergrid/friends-and-im-over-the-hypergrid/ . In 2013 she release a addon that eventual got integrated in opensim core. This initiative was a success within DIVA distro but was never fully successful in core implementation. The role of the secret key is explain by DIVA in the following terms:
"An HG friendship establishes 2 pairs of data, each stored in each user’s user services. That data is “signed” with a random number known only to the 2 services and the simulator where the friendship was established, so that, even if the user services (hg friends, to be precise) are exposed to the Internet, no one but the holders of the signature can manipulate the friendship data".
The friend database include two entry. One is all friend to you. And the other is the opposite HG People friend to local grid users. That secret key stored in friend database is used to allow to be notified when you login/logout (and vice-versa), to change your objects (and vice-versa), to see you on the map (and vice-versa), etc. All services would be affected equaly if the secret key is the determining factor of the problem. But they are not . And this discrepancy in service rendering, online indication, IM delivery and so on is an indication that the trouble is a question of how each of this service works. What is puzzling is that ONLINE indication should be a simpler feature yet easy to make work properly. If we follow DIVA spec the intended action is that ONLINE status should follow the HG traveller in his quest. As long as he is traceable by his friend the HG friend should be shown online. IM messages and other friend service should be equally successful. At this current version 0901, the only reliable way to have contact with HG friend is to move along to their local grid to confirm online indication and establish contact.
I have extended the discussion with an example test and discussion to overcome the limitation of a user page gaciously offered by opensimulator.org. See http://profil.gimisa.ca/opensimCommunication.pdf
TOS
No, this is not a discussion about GDPR. If you want information or directive about GDPR, search with google. This text is rather about help with installing DIVA TOS addon to a grid.
DIVA TOS is a simulator query for acceptance of the TOS, with a constraint of ejection if not accepted. Its a simulator function ( opensim.exe). As a simulator function, it works on each running simulator where it's installed. Any region visited by a user that have DIVA TOS enabled will will need to validate the user for TOS (accept or decline). Any region without it will disregard the requirement. Once a TOS is accepted in any regions it will not get any new request for that user unless a TOS change warrant this new acceptance.
The process of installing TOS involves ONLY the simulator and should be relatively easy since diva has an addon available for this function noted in her simple addon steps per reference. ( Ref: http://www.metaverseink.com/blog/diva-addons/wifi-and-other-diva-addons/ ) If I write to you it's because well, it did not go that easy !!!!. To figure out my mistake, I went to the original DIVA distros. Diva includes the TOS feature for a long time now so it should be a snap to see how its done in a her standalone distro then port that to a grid. ( ref: http://www.metaverseink.com/Downloads.html. )
Well this investigation step did not go that easy either as these are broken with both DIVA 0821 and DIVA 0900 distros. V So, instead of talking to you about what does not work, let me drive straight to what does. In DIVA distro 0821 and 0900 what I found was wrong first is the tos.html file. It needed to be modified. The DIVA version, if I am correct, is expecting information both in the GET QUERY link and in the reply POST of the tos.html page. Unfortunately, as I could test, the GET part gets lost and is not picked up by the code when submitting the post. Diva Wifi addon is geared to receive the information from that html file and sets a TOS field in the gridUser database table. The service.TOS is the code in diva wifi responsible to receive your acceptance post. I needed to modify it since now all the information is provided by the post portion the tos.html. I am not C# developper so I did best with what I know. Armed with these changes DIVA distro 0821 is working in providing a TOS request to visitors and recording it properly.
So back to the grid now. Simple enought I believe a new tos.html and a change in service.TOS. Did I say service.TOS? Oops the TOS addin Diva is providing is for simulator so its not at all a direct replacement for the code in wifi!!
So, I had to get the source of DIVA TOS addon. Downloading the source and compiling of Diva addons is rather well explained here ( ref: https://blog.inf.ed.ac.uk/atate/2015/04/06/diva-wifi-on-windows/ ) and the Diva addon source available here . ( ref: https://github.com/diva/diva-distribution/tree/master/addon-modules. But hum, no TOS addon per say!!!
So back to square one. It wont take you long to see the red flags when starting your simulator caused by some missing parts in the TOS addon module. You need to copy two files from the diva distro to implement the missing portion. Those are the Diva.OpenSimServices.dll and the Diva.Interfaces.dll. You also need the TOS.ini modified to point to these with this configuration (GridUserService = "Diva.OpenSimServices.dll:GridUserServicesConnector") .
So now you get an uncomplainng TOS addon module that will load nicely and that will greet your visitors with a TOS text and acceptance buttons. You have a web page to accept the TOS that will be presented to them and an accept button to update the TOS field in the grid server database. Perfect ... well not quite. When the TOS module come back 5 minutes later to see if you have accepted the TOS, it can't get the reply. Damn, sorry but it kicked you out.
A good reason for this is that the data field TOS is missing in gridUser table on the grid server side which is something that wifi doesn't seem to implement. So creating the field is straight forward with the following sql command. ( use robust; ALTER TABLE GridUser ADD TOS char(128); ) So now it writes something to the database. But still kick you out even if you accept the TOS. Hum!! I find that the answer is not pushed back to the simulator when requested by the TOS module.
But going around the missing pieces of information, I found that the some modification to the grid server was required to send the proper TOS information to the simulator TOS module. So here are the changed to dll files to be applied both to grid and simulator for the DIVA TOS to work with version 0821 and likely for 0900 (later not tested) .In grid server side the following dll need to be modified. :
........OpenSim.Data.MySQL.dll
........OpenSim.Services.Connectors.dll
........OpenSim.Services.Interfaces.dll
........OpenSim.Services.UserAccountService.dll
and in grid server addin-registry wifi addition you need to modify the
........Wifi.dll
........tos.html
in the simulator the following file need to be modified:
........Diva.Interfaces.dll
........Diva.OpenSimServices.dll
........OpenSim.Services.Interfaces.dll
and in addin-registry you need to modify the
........tos.iniYou can see a demo of the working solution at http://grid.metaversedepot.com:8002/sandbox. And the required files here ( http://profil.gimisa.ca/TOS.bin.zip ) and source files here.( http://profil.gimisa.ca/TOS.source.zip )
WIFI emails
I have been ask to look at WIFI email notification. Either for new client or for forgotten password. DIVA failed to send mail ,even with ssl authentification on port 465 or TLS on port 578 with proper certificates installed in mono per DIVA suggestion.( ref: https://github.com/diva/d2/wiki/Wifi)
I did also test a simple C# routine to send a test email. I did input the same credential I use with my email client unsuccessfully either. Only port 25 without identification seem to work properly with mono C# emails.
There is not many smtp server anymore that handle port 25. In case yours dont , the solution I found was to install postfix a full mail server. And to direct wifi to localhost , port 25 , providing a default return email and no password configuration as follows in wifi.ini setting.
;;email working with internal postfix routing
SmtpHost = "localhost"
SmtpPort = "25"
SmtpUsername = "your@returnEmail.com"
SmtpPassword = "nopassword"The postfix configuration to use is local only so you dont risk getting identified as spammer by routing unwanted stuff. In this configuration you have to use a real return email as SmtpUsername in wifi otherwise the email will be rejected. I did not install any mailer so that system emails are not forwarded. Install postfix with local configuration when requested. It did not work out of the box for me . I replaced it by the following, for postfix null client ref: http://www.postfix.org/STANDARD_CONFIGURATION_README.html#null_client
myhostname = vmbox1.localdomain
inet_interfaces = localhost
myorigine = $mydomain
relayhost =
mydestination =With this setup wifi email were now forwarded appropriatly on install in ubuntu 16.04 .
PHYSICS
Everyone know it the sciences field that study nature and properties of matter and energy. In opensim its the simulator motor responsible for movement. In opensim you can set an object to be physical in edit panel build tool. Doing so allow the object to be moved by virtual physics forces.
In opensim there is a number of physics engine that one can use. You will find the configuration option about physics in opensim.ini file startup section. As of opensim 0901 the choices are:
;; Default is BulletSim
; physics = OpenDynamicsEngine
; physics = BulletSim
; physics = basicphysics
; physics = POS is a basic physics with collision.
; physics = ubODE Ubit modification to ODE physicsArm with that I wanted to do a bowling game. That game needs physics plug in to calculate the trajectory of the ball in motion and its final impact effect on the pins at the end of the alley.
This is a very demanding application for a simulator. A bowling alley is oiled for two third of its length. So the ball is sliding until it hits the higher friction surface where it starts a rolling action. The spin imposed by the bowler on the ball will take effect in that portion and result in a hook change in direction. Following impact the ball interaction with the pins it hits will changes its trajectory while multiple collision between pins itself must be rendered.
Opensim using bulletsim and ubODE was able to render the game successfully. I noted a few point of interest between the two engines. In bullet it was possible to set the physic feature of the objects to the REAL values of ball weight, pin weight, and alley friction. In ubODE physics it was necessary to use complementary scripting function osSetInertiaAsSphere for the ball and oSetInertiaAsCylinder to obtain similar results.
A ball is an interesting object in physics. When sliding it can be seen as a cube. Friction is minimized on the first part of the bowling alley so movement speed should be constant and trajectory be a straight line. In the second part of the alley friction is more important and should cause rolling instead of sliding. So the spin the bowler impose on the ball would have little effect on the ball trajectory until it reach the high friction area of the alley . Then we expect a rapid change of the ball direction in line with the spin imposed by the bowler. That is called the hook effect. Its similar to golf or baseball where spin of the ball and friction cause the ball trajectory change.
Bullet rendered that behavior as expected. Under ubODE it was necessary to consider a draging effect. In theory a rolling ball will continue rolling because there is little friction involved to stop its movement. But reality as we know is different and there is some dragging effect that will slow the ball rotation . The dragging effect on a 15m alley in bullet was neglectful but in ubODE physic it was important enough to warrant compensation.
You will find both bowling alley demos in my grid.
Hope it helps
180930
email gimisa
hypergrid secondlife:///app/teleport/3d.gimisa.ca:9000
web: http://ddd.gimisa.ca