Regions loading - Printable Version +- SphereCommunity (https://forum.spherecommunity.net) +-- Forum: General Discussion (/Forum-General-Discussion) +--- Forum: UO/Sphere Discussion (/Forum-UO-Sphere-Discussion) +--- Thread: Regions loading (/Thread-Regions-loading) |
Regions loading - Aimed - 04-20-2015 05:45 AM Hello guys! How does Sphere load it's regions? I've noticed it somehow decides their priority and it does not only depend on the order in which they're written in the region files. Seems more like the size of a region is also considered. So a smaller region will be above a bigger region even if it was written in the beginning of a regions file and a bigger region below it( which means a bigger region will cover a smaller one and nulify it). But it does not. So I'm wondering how does this region loading thing works. Thanks for you attention. -Aimed RE: Regions loading - Aimed - 04-22-2015 01:02 AM Hello? Anyone alive? RE: Regions loading - Sharlenwar - 04-22-2015 02:24 AM People are alive. I was hoping a developer would respond to this one. From my understanding, Sphere loads in sectors and in your sphere.ini you can specify how many sectors are loaded into memory at a time. There is also some mechanics where when players move into these sectors, they then get loaded in and what not. I'm just not 100% of this behavior with the newer builds, it's been a while since I worked with Sphere. RE: Regions loading - Aimed - 04-22-2015 06:15 AM (04-22-2015 02:24 AM)Sharlenwar Wrote: People are alive. I was hoping a developer would respond to this one. From my understanding, Sphere loads in sectors and in your sphere.ini you can specify how many sectors are loaded into memory at a time. There is also some mechanics where when players move into these sectors, they then get loaded in and what not. I'm just not 100% of this behavior with the newer builds, it's been a while since I worked with Sphere. Hey Im asking about regions, not about sectors. Sectors are the 64 by 64 tiles squares usually(at least on RunUO) so I don't think it's different on Sphere, as far as I remember they're responsible for loading of all in-game objects. Also you can not define them as they're inside the core. Now, regions are loaded over these sectors, you can define as many regions as you would like to. Regions overlap sectors of course, but u can also make regions overlap each other and it seems like it depends on their size. So a smaller region will always be above a bigger one, otherwise a bigger region will just nulify the small one. And this is my question I just wanna know specifically how they're loaded. RE: Regions loading - XuN - 04-22-2015 04:45 PM Regions are stored inside sectors as a inherited class from CGTypedArray. For each new entry on this sector this array is being read checking if this region is overlapping with anyone else already added. If not, region is added directly. If yes, some checks are made: - if region rects are equal -> return false (the error) - if new region is inside the one being checked the loop continues. - if checking region is a multi and new one is not, the loop continues. - if still inside the loop (the other possible casses) then this region is added to the sector's list. This is a 'fast' explanation of what happens, what will anwser your question, I think, is: 'above' region is last one added. RE: Regions loading - Aimed - 04-23-2015 06:56 AM (04-22-2015 04:45 PM)XuN Wrote: This is a 'fast' explanation of what happens, what will anwser your question, I think, is: 'above' region is last one added. We've already figured this out yesterday by using our logic and alternative algorhythms made by ourselves on runuo and comparisons between sphere and runuo regions loading. And no, the last one added is not the 'above' region. The top region is the one with the smallest surface. U'd check ur region comparing methods inside the core because they decide which region will be on top. Comparing decides the region priorioty(which one will be on top) and it's being done by comparing their overall surface(and not of one particulair rectangle of a region), so the smallest one always wins. Thanks for your time, though |