[Opensim-dev] Technical questions from a viewer developer - varregions
Leal Duarte
ajlduarte at sapo.pt
Sun May 14 17:29:02 UTC 2023
Hi,
-- messages protocol
As i told in last meeting, what i said is that some information for
var regions is only send using the http region capability 'Event', nad
not the respective LLUDP message.
Several of the "event" messages are direct replacements of
respective LLUDP messages So that some viewers decode both into same
internal message and use same processing code.
* So the messages listed below did got the listed additional
fields, with Region size information, except EstablishAgentCommunication
that no longer has such fields, becasue where not needed, and so ignored
by viewers
-- region sizes
http://opensimulator.org/wiki/Varregion Restrictions is not obsolete on
that:
* The dimensions must be a multiple of 256 and less than or equal to 4096.
* The dimensions must be equal so regions are square
* One region can only have one adjacent region per side, excluding
corners or viewers may crash. (so at most 4 regions touching at corners
plus other 4, one touching each side)
the multiple of 256m is to simplify placement on the map grid that is a
256m grid.
the other restrictions are for compatibility with current viewers.
Opensim could possible handle non square regions, but we keep the
restriction for now
* Adjacent regions must be the same size unless they are all version 0.9
or above.
This is because lack of large region support on older regions.
-- Terrain patchs
terrain is sent blocks of patchs of 16 x 16 terrain heights, as sl
just larger regions have more of those
The protocol is as aurora, uses the same ll messages but with few changes
the layer type on global header is one this
public enum LayerType : byte
{
Land = 0x4C, // 'L'
LandExtended = 0x4D, // 'M'
Water = 0x57, // 'W'
WaterExtended = 0x58, // 'X'
Wind = 0x37, // '7'
WindExtended = 0x39, // '9'
Cloud = 0x38, // '8'
CloudExtended = 0x3A // ':'
}
where extended means regions larger than 256m
Water* where never supported
Wind is only send in 256m total size. Larger regions will have lower
resolution. --> obsolete on many viewers
Cloud was only send in 256m total size. Larger regions had lower
resolution. --> removed from most viewers and opensim.
then each patch is identified be a patchID encoded as :
header.PatchIDs = largeRegion ? (patchX << 16) | (patchY &
0xFFFF) : (patchX << 5) | (patchY & 0x1F);
where largeRegion is true for regions larger than 256m
note that terrain patchs are 16x16m size not 4x4. 4x4 is land parcels
minimal size.
-- region Handle math
SL uses region Handle as a region identifier, it built from the region
reference corner that is left lower corner on map.
ulong handle = X & 0xffffff00; // make sure it matches grid
coord points.
handle <<= 32; // to higher half
handle |= (Y & 0xffffff00);
with X and Y the global coords (in meters ) of that corner
Because historic reasons, opensim must always look for a region that
contains such a point
so only restriction is mostly that any pair (handle, offset) of a
message do point to the correct point.
if offset is the localoffset as defined for LSL, ie relative to the
reference corner, so handle must be made from that
but in several messages it can be relative to the nearest lower left
grid point.
Ubit
On 14-May-23 05:54, John Nagle wrote:
> I'm working on a new viewer. It's connecting to Second Life, and to
> non-varregion Open Simulator regions. Varregions don't work yet.
> I need more info on them.
>
> ## Simulator to client protocol for connecting to regions
>
> The Open Simulator wiki says, at
>
> http://opensimulator.org/wiki/Varregion
>
> "The implementation uses the Aurora large region protocol extensions so
> the existing Firestorm and Singularity Aurora support will now work for
> OpenSimulator."
>
> This references
>
> http://opensimulator.org/wiki/Varregion/Protocol
>
> which says:
>
> Simulator to Client Protocol
>
> EnableSimulator event message: add integers 'RegionSizeX' and
> 'RegionSizeY'
> CrossRegion event message: add integers 'RegionSizeX' and
> 'RegionSizeY' to 'RegionData' section.
> TeleportFinish event message: add integers 'RegionSizeX' and
> 'RegionSizeY' to 'Info' section.
> EstablishAgentCommunication event message: add integers
> 'region-size-x' and 'region-size-y'.
>
> This is, apparently, obsolete, according to Ubit. Although there is
> still code for those LLUDP messages in Firestorm. Does anything still
> use those now-blacklisted UDP messages? Ubit has said that region size
> info is now passed via an HTTP capability. But which capability, and in
> what format?
>
> Does anybody still use that old Aurora format?
>
> The obsolete Varregion article also says that regions are limited to
> multiples of 256x256 and that sizes cannot be mixed for regions that
> touch. Are those obsolete restrictions, or should mixed-size regions
> be handled? If so, how does a sim find all its neighbors?
>
> Are non-square regions now supported?
>
> (An argument for mixed-size regions in a grid is that you can have large
> regions of mostly empty space as large regions, with smaller regions
> for heavily populated areas. I'm willing to support that if the protocol
> is documented.)
>
>
> ## Terrain patches
>
> The wiki says " Implementation Discussion (Obsolete)", and
> that, as of the obsolete version, terrain was sent the Linden Lab way,
> as patches with discrite cosine transform compression. The discussion
> on the wiki suggests this be replaced with generalized meshes. Was that
> ever supported? I would guess not, but would like to be sure before
> I implement.
>
> For larger regions, do the terrain squares get bigger than LL's 4x4
> meter size? Or are there just more 4x4 terrain squares?
>
> John Nagle
> Animats
>
> _______________________________________________
> Opensim-dev mailing list
> Opensim-dev at opensimulator.org
> http://opensimulator.org/cgi-bin/mailman/listinfo/opensim-dev
More information about the Opensim-dev
mailing list