MantisBT - opensim
View Issue Details
0008292opensim[REGION] OpenSim Corepublic2018-02-17 15:352018-02-19 16:14
master (dev code) 
Grid (Multiple Regions per Sim)
Mono / Linux32
0008292: terrain load-tile and save-tile fail with varregions
Terrain load-tile does not appear to function correctly with varregions.
Setup 3x3 grid of 1024x1024 varregions at (1000, 1000)

Be in the (root) region.

Run command terrain load-tile filename.png 12 12 1000 1000. This will throw invalid pointer exception.

Run command terrain load-tile filename.png 4 4 1000 1000. This will only load the first terrain tile.

Run command terrain save-tile output.png 12 12 1000 1000. Will throw invalid pointer exception.
No tags attached.
Issue History
2018-02-17 15:35TomTheDragonNew Issue
2018-02-17 15:41TomTheDragonNote Added: 0032547
2018-02-17 16:24UbitUmarovNote Added: 0032549
2018-02-17 16:31UbitUmarovNote Added: 0032550
2018-02-17 17:04TomTheDragonNote Added: 0032551
2018-02-17 17:09UbitUmarovNote Added: 0032552
2018-02-17 18:25TomTheDragonNote Added: 0032553
2018-02-17 18:28UbitUmarovNote Added: 0032554
2018-02-17 18:35TomTheDragonNote Added: 0032555
2018-02-17 18:53UbitUmarovNote Added: 0032556
2018-02-19 16:14BillBlightNote Added: 0032557

2018-02-17 15:41   
I am preparing a patch for review once I have run some more in-depth testing.
2018-02-17 16:24   
well at this point i can only tell that code doesn't make much sense to me
neither does a comand based on grid positions.
sounds like mega regions logic, with incorrect upgrade to var regions, we didn't noticed till now :(
i will wait for your patch, since you are already working on it
2018-02-17 16:31   
btw looks like part of the issue is the use off current region dimensions, where it should be Constants.RegionSize (ie 256m)
2018-02-17 17:04   
Yes, part of the issue is definitely use of current region dimensions. They are still required, but many should be changed. This code is a mess, trying to clean it up a little...

How does a command based on grid positions not make sense? If you have another preference, please let me know and I will see if it can possibly be implemented. I don't see any other way of specifying the bottom-left corner region.
2018-02-17 17:09   
those are region relative coords.. made sense in megaregions times
those comands are just obsolete.
note also that the load will only load a tile, losing all the rest of the region
(by tile the code assumed 256x256 i think)
again made sense on mega regions...
2018-02-17 18:25   
Is there a new standard for indexing Varregions? The wiki page for Varregion states "the region coordinates are specified in 256m region count". Should I be using something else?

With my current, minimal changes, the load-tile will load an entire file in at the given grid location.
2018-02-17 18:28   
grid positions are in multiples of 256m so, no changes
i just don't see why use them to load/save heighmaps when we are on the region console. Made sense in mega region days...
2018-02-17 18:35   
It's mainly because we have multiple regions for sims. We are at the region console but we don't know which regions we want it to affect.
2018-02-17 18:53   
one could change to the relevant region on console, making it a lot more easier than remembering grid locations etc
but never the less we still need a fixed loadtile comand to suport files saved on megaregions.
2018-02-19 16:14   
"We are at the region console but we don't know which regions we want it to affect."

This confuses me ..

various console commands to see what regions you want to affect ..

show regions
change region
terrain load
terrain save