• 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

RL map has around 1.000.000 images and it takes around 50 GB before compression. After compression it's 10-15 GB.
Is there an option to compress specific folders more effectively? For instance, using PNG files instead of loading the 'minimap.otbm' generated by OTBM would make it look cleaner for OTC. Considering using, let's say, 'folder 14,' which represents zoom level 14. This could provide sufficient detail for the minimap to appear decent. However, implementing this feature in the client might be challenging due to the folder containing 14,000 images and files totaling 300MB
 
Is there an option to compress specific folders more effectively? For instance, using PNG files instead of loading the 'minimap.otbm' generated by OTBM would make it look cleaner for OTC. Considering using, let's say, 'folder 14,' which represents zoom level 14. This could provide sufficient detail for the minimap to appear decent. However, implementing this feature in the client might be challenging due to the folder containing 14,000 images and files totaling 300MB
Adding 300 MB or even 50 MB to client, just to make minimap looks better in client seems to be a bad idea.
I would put it on webserver and in client Minimap module add button to open current minimap location in web browser.
the .webp format works wonders
WebP size is almost the same as JPEG. WebP colors are better and there are less artifacts.

80% quality:

webp_jpeg_test_quality_80.png


If we drop quality to some very low number like 40%, there is a big difference in artifacts [check grass]:

webp_jpeg_test_quality_40.png


100% quality for comparison:

webp_jpeg_test_quality_100.png


Full size images:

If you want to compress to WebP, edit file website_and_php_files/4_compress.php ( otclient_mapgen/website_and_php_files/4_compress.php at master · gesior/otclient_mapgen (https://github.com/gesior/otclient_mapgen/blob/master/website_and_php_files/4_compress.php) )
replace:
PHP:
$toExtension = '.jpg';
with:
PHP:
$toExtension = '.webp';
and:
PHP:
@imagejpeg($image, $savePath, $quality);
with:
Code:
@imagewebp($image, $savePath, $quality);

and in website_and_php_files/map_viewer/map.js ( otclient_mapgen/website_and_php_files/map_viewer/map.js at master · gesior/otclient_mapgen (https://github.com/gesior/otclient_mapgen/blob/master/website_and_php_files/map_viewer/map.js) )
replace:
Code:
imagesExtension: '.jpg',
with:
Code:
imagesExtension: '.webp',

Anyway, I would get free machine with 200 GB disk ( How to get FREE VPS from Oracle Cloud (https://otland.net/threads/how-to-get-free-vps-from-oracle-cloud.279318/) ) and upload .png images :)
 
Incorporating a minimap on the webserver and creating a module that directly links to a webserver for a game seems like a design flaw. It significantly increases the time players spend searching for in-game elements and lacks user convenience, but it just for me tho. Maybe im wrong
 
Incorporating a minimap on the webserver and creating a module that directly links to a webserver for a game seems like a design flaw. It significantly increases the time players spend searching for in-game elements and lacks user convenience, but it just for me tho. Maybe im wrong
Yes. Best option would be to recreate "leaflet maps" in client Lua/OTUI and download images from web server in real time, but it would be a lot of work.
 
Is there any configuration to disable that hard check on Tibia.dat and Tibia.spr? My Otclientv8 shows that there is something wrong with Tibia.dat but it runs anyway and works well. Unfortunately mapgen cannot open properly and I had to use original tibia 10.98 dat to mimic my custom .dat.
 
What is the recommended version of PHP to resolve this error.



imagem_2024-02-08_002327475.png


@Gesior.pl



PHP:
PHP Fatal error:  Uncaught Error: Call to undefined function imagecreatetruecolo
r() in C:\Users\Marcelo\Desktop\otclient_mapgen_v5.1_win-x64\website_and_php_fil
es\2_tile_generator.php:54
Stack trace:
#0 {main}
  thrown in C:\Users\Marcelo\Desktop\otclient_mapgen_v5.1_win-x64\website_and_ph
p_files\2_tile_generator.php on line 54
Start time (floor 4): 04:11:13
Found 429 images for floor 4 in 0.001 seconds



I'm using Xampp 8.2.12



xampp.png
 
What is the recommended version of PHP to resolve this error.
You need to enable gd module in PHP.
 
Insane! Good Work!

Are images created only in folder 16?
Zoom only works on 16+.
The map goes completely dark when it is at 15-

[Solved]
I did all the steps again and it worked.

Thanks for feature
 
Last edited:
Hey Gesior! Thanks for this tutorial. It's helped me a lot. You're the best!

Gesior, do you have 'update.php' for the streamUpdateURL?

I don't have that file.
 
I have a problem where it doesn't generate house images for all city's it only generate for 3. I've been trying to find something to edit but cant really find a solution. Anyone that has encounterd this? =)
 
How to solve that error?
If client cannot load your .dat/.spr, it means that you uses some custom OTC features ex. transparent water or 65k+ items on 8.x protocol.
In file modules/game_things/things.lua under:
LUA:
local errorMessage = ''
add your custom features ex.:
LUA:
g_game.enableFeature(GameSpritesU32)
 
If client cannot load your .dat/.spr, it means that you uses some custom OTC features ex. transparent water or 65k+ items on 8.x protocol.
In file modules/game_things/things.lua under:
LUA:
local errorMessage = ''
add your custom features ex.:
LUA:
g_game.enableFeature(GameSpritesU32)
would love to see a edit to this generator for otbm files that would generate greyscale map this would be ultimately best addition possible
hosters wouldnt have to include fully explored map and players would have a map click working and see their map going into colour:P
 
Hi again,
Does anyone know how to diagnose my problem?

I have extended 8.6v2 (sprites from 13.x downgraded), it was working fine after addition of:
g_game.enableFeature(GameSpritesU32)

But now the problem is that few of grounds cannot render properly:
1726527780913.webp 1726527810078.webp
I would say they're rather low IDs (101 for example with cave wall)
1726527865123.webp1726527887076.webp
There is nothing critical in logs (only ERROR: invalid thing type, server id: 20094, but this is not that ID).
Can you tell if it's .dat problem / otb problem or how to check what's going on?

Thanks in advance!
[Additionally, same goes for minimap. I assume that's not the problem with item linking during map viewing. Minimap also has blank spots]
 
Back
Top