Scripting in Advanced Megaregions, and Troubleshooting Physics

We updated Kitely today with improvements to Kitely’s Advanced Megaregions, bug fixes and performance improvements. We also added features that enable you to troubleshoot physics-related performance issues in your Kitely worlds.

Scripting in Advanced Megaregions

We fixed several scripting functions to work in megaregions, as requested by our users:

llGround(), llGroundNormal(), llGroundSlope(), llGroundContour()
llWind(), llWater(), llCloud()
llSetRegionPos()
llModifyLand()
osSetWindParam()
osSetTerrainHeight(), osGetTerrainHeight(), osTerrainFlush()

New Function: osGetRegionSize()

We were also asked how an object can detect if it’s near the edge of the world (remember that in Kitely each world is a separate island). Normally the function llEdgeOfWorld() would be used to detect this, but it isn’t useful in megaregions because the entire megaregion is considered one region.

We decided to address this requirement in a different way: we created a new function called osGetRegionSize(). It returns the size of the region in meters, and works correctly in megaregions. E.g., in a 2×2-regions megaregion it returns 512×512 meters.

vector osGetRegionSize()

Return the size of the current region in meters. Most regions are
256x256 meters, but megaregions are larger.

Threat Level     None

So now the recommended way for an object to determine if it’s near the edge of the world is by comparing its position (llGetPos()) to the size of the region (osGetRegionSize()), and possibly also checking if there are adjacent regions using llEdgeOfWorld(). This will work both in megaregions and in regular regions, and presumably in varregions as well (although I haven’t tested them). This will also work both in Kitely (where worlds are islands) and in grids where regions are contiguous.

(Updated on Jan 29: osGetRegionSize() has been accepted to OpenSim, and will eventually be available on all OpenSim grids.)

New Grid URI

We changed Kitely’s grid address from osgrid.kitely.com:8002 to grid.kitely.com:8002. The name “osgrid.kitely.com”, which we had used since we began, was chosen rather poorly as it may cause confusion with OSGrid. Since we’re going to enable Hypergrid in the near future, the grid URI is going to become much more visible than before, because when hypergridding the avatar’s Grid URI appears as part of the avatar name. So we decided to change it.

We’re going to contact the developers of viewers that support OpenSim and ask them to update the entry for Kitely in their grid manager to the new URI. (If any viewer developers are reading this, please update your grids list even if we don’t contact you…) However, all currently installed viewers will continue to work even without this change because the old grid URI, osgrid.kitely.com, will continue to be supported for the foreseeable future.

Maturity Ratings Guidelines

Kitely is used by a wide variety of users, ranging from young children to adults looking for adult entertainment. This makes the use of Maturity Ratings important, to ensure that users don’t see content that they don’t want to see or is inappropriate for their age. We’ve discussed the issue of Maturity Ratings with members of the Kitely community for the past few weeks, and the result is a new document that describes Kitely’s Maturity Ratings Guidelines in detail.

These guidelines include input from many people, but we’d like to give special thanks to Sierra Jakob who created the templates that show which skins and clothes are acceptable at each maturity level.

Improved Detection of Slow Physics Objects

Physical objects are great for some types of simulations, but they’re also big performance hogs that can slow down the world and cause lag. You can tell if you have a problem with slow physics by checking the “Physics Time” statistic. You can view this statistic by pressing Ctrl-Shift-1. (Some viewers don’t show this statistic; the following screenshots were taken in Firestorm.)

For example, here’s a world that has a problem with slow physics. Its “Physics Time” is high, and its “Spare Time” is low which means that any activity (e.g., avatars moving around) might cause lag. (By the way, you should look at the “Physics Time” statistic and not at the “Physics FPS”, because the Physics FPS is deceptive: it will remain high right up to the point where the physics time becomes too much to handle in one frame, at which point it will plummet.)

Physics Frame Time - High

Suppose you find that your world does indeed have a problem with slow physics: what can you do? The solution is to remove the “Physical” flag from objects that don’t need it, or at least simplify their geometry. But how do you know which objects are taking up the most physics-processing time? The answer is to use the Top Colliders dialog. You can view this dialog by opening the Region/Estate dialog (Alt-R); going to the “Debug” tab; and clicking the “Get Top Colliders” button. Unfortunately, until now this dialog did not return useful results: it neglected to show many of the worst-performing objects. In today’s update we’ve improved this dialog significantly, and now it produces accurate and useful information about which objects are slowing down the simulator. We recommend that all world managers take a look at this dialog at least once to see if there happen to be any slow physical objects in their world that they aren’t aware of.

For example, here’s what the Top Colliders dialog showed for the aforementioned world before today’s update. It showed only one object, and that object wasn’t even the worst offender (as we’ll see later):

Top Colliders - Before Update

Here’s what the Top Colliders dialog shows after today’s update. This time the slow objects are shown correctly:

Top Colliders - After Update

Once you find which objects are slow, you have several options for dealing with them. First, you can click the Return Selected button in this dialog to remove them from the world and add them to your inventory. (If you do so then you might want to return one object at a time, because if you return multiple objects at once then they’ll create a Coalesced Object.) Second, you can click the Disable Selected button to remove their Physical status. This is a feature that hadn’t been implemented in OpenSim until today, but now you can use it in Kitely. And finally, you can Teleport to the object’s location to examine it and perhaps decide to do something else with it.

In the world that was shown above there was no intention to use physics anywhere. So we removed the “Physical” flag from all the objects shown in the dialog by clicking the “Disable All” button. The effect was immediate, and the Physics Time dropped almost to 0:

Physics Frame Time - Low

Other Improvements

When a region’s wind parameters are changed using osSetWindParam(), this change now takes effect immediately (instead of after a few seconds).

We made a few performance improvements. E.g., when users organize their inventory and move many items into folders, this will now work faster than before.

We’ve received reports that on rare occasions “ghost” avatars appear: the remains of a  user who had long ago logged-out, but still appears in the world. We made a change that might fix this problem; please let us know if it happens again.

When you start a purchase in Kitely Market using USD, we show a message at the top of the screen that reminds you of this fact and lets you cancel the transaction. This message is helpful if there was an error in PayPal and you find yourself back in Kitely without having completed the purchase. This message was previously shown only for some purchases, but now it will be shown for all purchases (as long as they use USD).

And finally, we added a link back from the forums to the Kitely homepage. We hope you enjoy clicking on it as much as we’ve enjoyed creating it. 🙂

Published by

Oren Hurvitz

Oren Hurvitz is the Co-Founder and VP R&D of Kitely.