| View previous topic :: View next topic |
| Author |
Message |
guest
Joined: 08 Oct 2006 Posts: 3962
|
Posted: Tue Apr 03, 2012 9:20 am Post subject: large maps don't work |
|
|
| A single map 125952 x 75008 pixels split in 246 x 147 tiles is displayed incorrectly in 1.0.23. Map "loads", but only each 4th tile is displayed (seems that only odd rows and columns work). |
|
| Back to top |
|
 |
guest
Joined: 08 Oct 2006 Posts: 3962
|
Posted: Tue Apr 03, 2012 3:09 pm Post subject: |
|
|
Probably found the cause.. TB uses some arcane heuristics to determine the tile size, that fails on sparse maps (maps that leave out some tiles near the borders). In this case, it believes tiles are twice as big, so it loads only every 4th tile.
Why don't you just add an option in .map file instead? Or, document the guessing algorithm, so I can work it around.. Thanks! |
|
| Back to top |
|
 |
kruch Site Admin
Joined: 02 Jul 2006 Posts: 5096
|
Posted: Tue Apr 03, 2012 6:36 pm Post subject: |
|
|
| It looks like a bug. I tried (smaller) map with 246x147 tile size and it worked. Could you upload your map somewhere? |
|
| Back to top |
|
 |
guest
Joined: 08 Oct 2006 Posts: 3962
|
Posted: Wed Apr 04, 2012 11:55 am Post subject: |
|
|
No, as the map is almost 2GB.. But I've cropped the sides a bit and now it works. There were some 3 rows or columns missing..
I guess you simply check all tile's coordinates (x, y), and pick tile size as MIN(x), MIN(y) for all non-zero values. That would explain this behavior. Something more reliable could be handy. |
|
| Back to top |
|
 |
kruch Site Admin
Joined: 02 Jul 2006 Posts: 5096
|
Posted: Wed Apr 04, 2012 12:24 pm Post subject: |
|
|
| Exactly. No idea how come it fails for you map. But I do not need tiles, just calibration (.map) and tiles list (.set or .tmi) would be enough. |
|
| Back to top |
|
 |
guest
Joined: 08 Oct 2006 Posts: 3962
|
Posted: Wed Apr 04, 2012 12:24 pm Post subject: |
|
|
| Code: |
def guess_tile_size(array):
a = b = sys.maxint
for i in array:
if i != a and i < b:
a, b = sorted((a, i))
return b - a
|
|
|
| Back to top |
|
 |
|