• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

OpenTibia OTClient that unpack map.otbm to .png files - v4.0

Hello.

For some reason the zoom 14 is not loading parts of the map (all floors with zoom 14 in the same area) for me. Only the zoom 14 is where I found this issue.


1733553081189.webp

But in the same area in all other zooms, it is ok: 1733553142782.webp
 
Hello.

For some reason the zoom 14 is not loading parts of the map (all floors with zoom 14 in the same area) for me. Only the zoom 14 is where I found this issue.
May be related: I'm trying to generate my map but always there is the same part missing on the same zoom level.

The first thing I notice was this:

1733722987450.webp

It says 121947 images generated, but there is only 120439 images in the folder... Tried to use different values for how many parts it should split, but I always ended with missing images for some parts on specific zoom levels (few images on zoom 14 and zoom 13, for all floors).

EDIT: As my understanding since the images generated from the OTClient will be the 16 zoom images, but there is no failure on this zoom level. So probably it is not related to my problem.

Then I read the code you made to generate the zoom files on PHP and the linux script. I think it may be race condition. You start all process to generate zoom images at the same time. Probably it will have few issues if there is multiple threads generating images (each zoom level depends on the previous zoom level images).

I'm trying too different fixes:

1 - Simply remove the concurrence and run level by level (removing & from the script)
2 - Modify the code to always use the base images from zoom 16 instead of the 4 images of the previous zoom

After testing it I will come back to say if it is fixed.
 
Last edited:
It says 121947 images generated, but there is only 120439 images in the folder
I think it's normal. Number showed in OTC is number of different 8x8 SQM squares it will try to generate, but if all tiles in that area have no items (black screen), it does not save image on HDD, as not existing images are also visible in web browser as black screen.
Map images generator detects 8x8 squares that have some items inside and only generates them (to skip millions of empty area tiles), but then it adds ~20 tiles around detected map area, to make sure that other floor items are loaded too (they are offset by +/- floor count SQM in client), so there are some 8x8 squares with no items on list of 'images to generate'.
As my understanding having less images in this first generation process should make all zooms to have missing images not only specific ones, right?
It's not related. Full 'zoom' images of 8x8 SQM squares are 256x256 pixels size and they are visible in web browser on zoom level 16 ( https://map.kasteria.online/#zoom,16,position,32352,31705,7 ).
17-18 zoom levels are 'zoom 16' images scaled up by web browser ( https://map.kasteria.online/#zoom,18,position,32356,31703,7 ).
0-15 zoom levels are generated by PHP scripts you run after map generation in OTC (ex. 14 zoom: https://map.kasteria.online/#zoom,14,position,32352,31730,7 ).

So if there are any images missing on floor 14, that are visible on floor 16, there must be a problem with PHP script that generates them.

Zoom level 15 images are made by merging 4 images from zoom level 16 and shrinking by 50% to generate 256x256 images.
Zoom level 14 images are made by merging 4 images from zoom level 15 and shrinking by 50% to generate 256x256 images.
So if image on zoom level 14 is bugged[black]/missing, all next zoom levels (13, 12, 11..) should be bugged too.

Maybe it's some problem with opening .htm file on local PC. You can try to debug it in web browser by clicking F12 and going Network tab, to view what images it loads. Can you find URLs to these 14 zoom level images that are missing (should be red in network tab)? Are they missing in map/14 folder or it's just web browser problem, that it can't load them?
ex. there is some black area 8x8 on map, so it returned 404 from server and it's red in Network tab, but it's fine in my case, because on zoom level 16 it's also black:
1733757660063.webp
 
Last edited:
I think it's normal. Number showed in OTC is number of different 8x8 SQM squares it will try to generate, but if all tiles in that area have no items (black screen), it does not save image on HDD, as not existing images are also visible in web browser as black screen.
Map images generator detects 8x8 squares that have some items inside and only generates them (to skip millions of empty area tiles), but then it adds ~20 tiles around detected map area, to make sure that other floor items are loaded too (they are offset by +/- floor count SQM in client), so there are some 8x8 squares with no items on list of 'images to generate'.

It's not related. Full 'zoom' images of 8x8 SQM squares are 256x256 pixels size and they are visible in web browser on zoom level 16 ( https://map.kasteria.online/#zoom,16,position,32352,31705,7 ).
17-18 zoom levels are 'zoom 16' images scaled up by web browser ( https://map.kasteria.online/#zoom,18,position,32356,31703,7 ).
0-15 zoom levels are generated by PHP scripts you run after map generation in OTC (ex. 14 zoom: https://map.kasteria.online/#zoom,14,position,32352,31730,7 ).

So if there are any images missing on floor 14, that are visible on floor 16, there must be a problem with PHP script that generates them.

Zoom level 15 images are made by merging 4 images from zoom level 16 and shrinking by 50% to generate 256x256 images.
Zoom level 14 images are made by merging 4 images from zoom level 15 and shrinking by 50% to generate 256x256 images.
So if image on zoom level 14 is bugged[black]/missing, all next zoom levels (13, 12, 11..) should be bugged too.

Maybe it's some problem with opening .htm file on local PC. You can try to debug it in web browser by clicking F12 and going Network tab, to view what images it loads. Can you find URLs to these 14 zoom level images that are missing (should be red in network tab)? Are they missing in map/14 folder or it's just web browser problem, that it can't load them?
ex. there is some black area 8x8 on map, so it returned 404 from server and it's red in Network tab, but it's fine in my case, because on zoom level 16 it's also black:
View attachment 88762
I see..

But yeah, the files is missing in the folder, not a network problem. I'm running it locally first to test, so should be pretty hard to be a network problem.

EDIT:

You said that if the zoom level 14 is missing, probably all next zoom levels should be bugged too, right?

Thats not what is hapenning for me hahaha Check this out:

Zoom 14:
1733761893179.webp

Zoom 13:

1733761927623.webp

Zoom 15:
1733761969900.webp

These are the result of generating the zoom level images one level by level, without running parallel scripts..

And it is not only in one area or one level. In the right side of my map there is an issue, but in the zoom 13:

1733762069963.webp

And both zoom s14 and 12 are ok:

1733762107154.webp

One thing both areas have in common is that all images from the same column (same X) are missing.. For example from 370,-220,7 to 370,1285,7 there is no images in this column. And all floors are missing images in these coordinates, but only for the specific zoom.

EDIT: I really think it is something with the PHP script to generate the zoom tiles, just don't know what yet.. Read the script and it seems fine to me. Because it is deterministic. Every single time I regenerate everything from scratch, the same areas had missing images.
 
Last edited:
But yeah, the files is missing in the folder, not a network problem. I'm running it locally first to test, so should be pretty hard to be a network problem.
IDK what to say. I've ran that code 30+ times on Linuxes and Windows with maps .otbm 10-190 MB. Nobody reported any problem.
I use Windows 10/Linux based on Ubuntu 20.04/22.04 and no antivirus. IDK what could stop writing to HDD/SSD.

Code that generates given floor/zoom image does not report any errors/warnings:
as it expects images to save on HDD/SSD. Often there are 1kk images to save (RL map) and breaking on single image error would require whole 'floor' generation to start again.

If you can share server items.otb and map .otbm and client .spr and .dat, message me on Discord: gesior.pl, I will try to fix any errors related to map generation.

EDIT:
If you can't share your server files, you can share level 16 zoom files and I can try to find resizing (zoom generation) bug, but it will take few GBs in .zip.
 
IDK what to say. I've ran that code 30+ times on Linuxes and Windows with maps .otbm 10-190 MB. Nobody reported any problem.
I use Windows 10/Linux based on Ubuntu 20.04/22.04 and no antivirus. IDK what could stop writing to HDD/SSD.

Code that generates given floor/zoom image does not report any errors/warnings:
as it expects images to save on HDD/SSD. Often there are 1kk images to save (RL map) and breaking on single image error would require whole 'floor' generation to start again.

If you can share server items.otb and map .otbm and client .spr and .dat, message me on Discord: gesior.pl, I will try to fix any errors related to map generation.

EDIT:
If you can't share your server files, you can share level 16 zoom files and I can try to find resizing (zoom generation) bug, but it will take few GBs in .zip.
I will send you the images, my internet upload this in 5 minutes haha Check discord for invitation from Agent..

Thanks
 
How to fix this?
It looks like you are using "transparency" feature in .spr.
You have to enable it in otclient_mapgen.
Edit modules/game_things/things.lua and under:
LUA:
local errorMessage = ''
add line:
LUA:
g_game.enableFeature(GameSpritesAlphaChannel)
 
Back
Top