Registry

From ActiveWiki
(Redirected from Encroach)
Jump to navigation Jump to search

Overview

Creating an object registry is probably the most important step of opening a world for public building. The registry file serves two important purposes:

  • It specifies exactly which objects can be used for building in your world
  • It specifies the dimensions of each object, so that encroachment can be enforced

What is encroachment?

Encroachment occurs when a user tries to place an object in such a manner that it overlaps with another object built by a different user. With a properly configured registry, the Active World Server can make sure that every object built in a world does not encroach on anyone else's property. This is an important aspect of maintaining control and ownership of property in a world that is open for public building.

Do I have to have a registry in my world?

No. In particular, if your world is not open to building by the public, then a registry is typically not necessary, since it is assumed those who are allowed to build in your world are responsible enough to keep their objects from encroaching. However, if your world is going to be open to public building, then using a registry is the only effective way to prevent vandalism.

Creating a registry file

There are two ways to create a registry file. One is to make it by hand in a text editor. The other is to use the RWXMOD utility.

Making a registry file by hand is generally easier unless you have a very large number of original objects. It is best to start with an existing registry file, such as the registry from AlphaWorld, and then to add/delete objects as necessary.

Format of the registry file

Registry files are simply ASCII text files. Each line in the registry corresponds to one valid building object in your world. The general format is:

modelname 1 min_x min_y min_z max_x max_y max_z comment

A typical line looks like this:

   STREET1.RWX 1 -495 5 -495 495 5 495

The first column is the name of the particular object (either a .rwx file or a .cob file). The second column is ignored. The remaining columns are the dimensions of a bounding box around the object. The property server only actually looks at the fifth and seventh numbers. The fifth number is interpreted as one half the width of the object in centimeters. The seventh number is one half the depth of the object. So in this case, we can see that the STREET1.RWX object is 990 centimeters wide and 990 centimeters deep, or very close to 10 x 10 meters. The reason why the value 495 is used instead of 500 is that it is a good idea to shave a few centimeters off of the dimensions so that objects can be placed right next to each other without causing encroachment.

Note that since only the fifth and seventh numbers are used, the sample registry entry above is equivalent to:

   STREET1.RWX 0 0 0 0 495 0 495

Tip: When adding an object to a registry, it is a good idea to always specify a positive value for the width and depth, even for "two dimensional" objects such as wall panels. The reason for this is that an object with 0 width or depth can potentially be slipped right in between two "adjacent" objects on someone else's property. Thus we typically give wall panels a width of 5 centimeters, even if they are actually 0 centimeters wide.

Installing a registry file

Once you have a registry file, installing it is a simple matter of placing it in your Active World Server directory, and then using the World Server Administration Tool to add the registry file to the world.

Reloading a registry

When the objects in a world's object path are updated, the registry will need to be updated also. When the registry is changed the world server must be instructed to reload the registry file. Any new objects added to the object path and the registry will be available for use until the registry is reloaded . The object registry can be reloaded at any time from the World Server Administration Tool.

Important notes

  • The encroachment algorithm never checks the "Y" parameter.
  • To speed up the checking, the world server only checks the 8 neighboring cells for encroachment, so never make an object larger than 14x14 meters.