• 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 - v2.0

i have bad version to microsoft visual 2015 ^^d.. no work with 2015-2019 x86 xD
On windows it was always hell to compile OTC as it requires tons of libraries.
That's why I posted .exe in first post. I use this .exe myself on windows 10 and it works pretty well. Generates 67MB otbm map images (4GB of images in JPG) in 50 minutes on i9-9900K:
 
This work is a most interesant its a excelent work but i dont stop get problems with this... now start command with
php 1_pre_tile_generator.php, instaled 7.4php with fastcgi, oci8_12c, pdo_firebird, pdo_oci and correct direct to open_basedir and not work...
Lua:
C:\Users\Administrator\Desktop\otclient_mapgen-master\website_and_php_files>php 1_pre_tile_generator.php

Warning: PHP Startup: Unable to load dynamic library 'oci8_12c' (tried: ext\oci8_12c (No se puede encontrar el m├│dulo especificado.), ext\php_oci8_12c.dll (No se puede encontrar el m├│dulo especificado.)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'pdo_firebird' (tried: ext\pdo_firebird (No se puede encontrar el m├│dulo especificado.), ext\php_pdo_firebird.dll (No se puede encontrar el m├│dulo especificado.)) in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'pdo_oci' (tried: ext\pdo_oci (No se puede encontrar el m├│dulo especificado.), ext\php_pdo_oci.dll (No se puede encontrar el m├│dulo especificado.)) in Unknown on line 0
Start time: 05:56:42

Warning: file_exists(): open_basedir restriction in effect. File(map) is not within the allowed path(s): (C:\inetpub\wwwroot) in C:\Users\Administrator\Desktop\otclient_mapgen-master\website_and_php_files\1_pre_tile_generator.php on line 12

Warning: is_dir(): open_basedir restriction in effect. File(map_tiled) is not within the allowed path(s): (C:\inetpub\wwwroot) in C:\Users\Administrator\Desktop\otclient_mapgen-master\website_and_php_files\1_pre_tile_generator.php on line 24
Folder "map_tiled" or "map_tiled/16" does not exist.

On put "no se puede encontrar el modulo especificado" says "The specified module can not be found" i try do this in windows server 2016 im the last steps... can help me plx? now im really lost..
Post automatically merged:

done!.jpg
You make this mod of 0, really you are a genius! i done ^^

I post the fix this problem for other guy have. this error.

Lua:
Warning: is_dir(): open_basedir restriction in effect. File(map_tiled) is not within the allowed path(s): (C:\inetpub\wwwroot) in C:\Users\Administrator\Desktop\otclient_mapgen-master\website_and_php_files\1_pre_tile_generator.php on line 24
Folder "map_tiled" or "map_tiled/16" does not exist.

i fix comment again the line from php.ini open_basedir = "C:\inetpub\wwwroot" put again ; before do all steps from php. "exemple" ;open_basedir = "C:\inetpub\wwwroot".
When you finish all steps and need put the folder in website uncomment again if u use php for u website. :) (Not PhP from uniserver or xampp)

tutorial how install well php in windows 10, server 2012 2016 and 2019 :
 
Last edited:
This is incrible... but how you do for npc and monster work? i try follow the step for this update but dont works :/ idk i do well the configuration in creaturesData.php i do on windows maybe the path on data folder is not correct...

Lua:
// path to folder with monster, npc and spawns data
$dataPath = 'c:/users/administrator/desktop/zenolia/data/';
$monstersDir = 'monster/';
$npcDir = 'npc/';
$spawnsFile = 'world/new-spawn.xml';

Please can help me? its last step!
 
Last edited:
This is incrible... but how you do for npc and monster work? i try follow the step for this update but dont works :/ idk i do well the configuration in creaturesData.php i do on windows maybe the path on data folder is not correct...

Lua:
// path to folder with monster, npc and spawns data
$dataPath = 'c:/users/administrator/desktop/zenolia/data/';
$monstersDir = 'monster/';
$npcDir = 'npc/';
$spawnsFile = 'world/new-spawn.xml';

Please can help me? its last step!
Make sure that there is no file creaturesData.cache.json in creaturesData.php, because it means that your monsters and NPCs are already cached and changes to config in .php file are ignored. If there is one, remove it and reload map website to generate it with current configuration.

Other problem can be access to that folder. It's on Windows user desktop, PHP (webserver) may not have access to that folder. You can try to make a copy of datapack, place it somewhere website path, generate monsters and npc cache, remove copy from website path.
 
Im looking for creaturesData.cache.json in my system but dont looking nothing... on script of creaturedata.php exist the line i will try second option because maybe its problem from access... thx for respond me master!
 
Could this be made to work with servers using the items.srv (Nostalrius for example) ?

Doesn't have or use Items.otb
 
Hey @Gesior.pl

i get error in protocol 12.40, can help?

View attachment 50428
How do you connect to your server with not supported protocol?
Never seen OTClient supporting protocols over 10.99. I loaded all .dat and .spr files called '11.54' etc. using version 10.99 (1099) in OTC.
 
Is there any way to match house IDs with house pictures that have been exported? I have around 400 houses id like to match
 
@Gesior.pl can't open your compiled release, i try compile it for old processors thinking it was the problem but i still can't run it, any idea?
 
Is there any way to match house IDs with house pictures that have been exported? I have around 400 houses id like to match
Images of houses name format is:
houseid_floor.png
You can't just show one image for house on website, because houses often have few floors and you need to show all of them somehow.
In case of PHP, you can use scandir function to list house images in folder and search for file with given house id in name.

All house images size are square. In case of multi-floor houses, all floor images have same size, so you can use some JavaScript gallery/carousel to show all floors of house and it will look fine.
@Gesior.pl can't open your compiled release, i try compile it for old processors thinking it was the problem but i still can't run it, any idea?
Any error? Did you install Download Microsoft Visual C++ 2015 Redistributable Update 3 from Official Microsoft Download Center (https://www.microsoft.com/en-us/download/details.aspx?id=53587) ? Are you running 32-bit system?

You can try to run newest version (v4):
For v4 version, you need this Windows libraries:
 
Images of houses name format is:
houseid_floor.png
You can't just show one image for house on website, because houses often have few floors and you need to show all of them somehow.
In case of PHP, you can use scandir function to list house images in folder and search for file with given house id in name.

All house images size are square. In case of multi-floor houses, all floor images have same size, so you can use some JavaScript gallery/carousel to show all floors of house and it will look fine.

Any error? Did you install Download Microsoft Visual C++ 2015 Redistributable Update 3 from Official Microsoft Download Center (https://www.microsoft.com/en-us/download/details.aspx?id=53587) ? Are you running 32-bit system?

You can try to run newest version (v4):
For v4 version, you need this Windows libraries:
Yes i have the required vc++ thats strange, im using windows 10 x64.
 
Yes i have the required vc++ thats strange, im using windows 10 x64.
v3 (from this thread) and v4 do not work? Any error when you run it?

It's strange, because I can run v3 and v4 otclient.exe (Windows binary!) even on Linux and it works fine.
2020 - year when Windows apps work better on Linux, than on Windows:p
 
Images of houses name format is:
houseid_floor.png
You can't just show one image for house on website, because houses often have few floors and you need to show all of them somehow.
In case of PHP, you can use scandir function to list house images in folder and search for file with given house id in name.

All house images size are square. In case of multi-floor houses, all floor images have same size, so you can use some JavaScript gallery/carousel to show all floors of house and it will look fine.
Thanks for your reply! The reason I asked was because i could not see how the filename correlated to the house ID's. After giving it a second look i realised only about 50% of the house images we're created. I had better luck using generateHouses(30, true) then i had with false and was able to export more house images. It freezes but finishes after a couple of hours. Any thoughts on what i can do to make sure all of the houses are parsed? I'm using the precompiled package v4 from github with Windows 10.
Using 8.6 prepareClient(860, '/things/860/items.otb', '/world/OTMap.otbm', 8, 5)

Also great pointers regarding how to display the pictures. I'm new to JavaScript but should be able to pull it of. This one looked really neat: slick - the last carousel you'll ever need (https://kenwheeler.github.io/slick/)
Using scandir I guess this code looks alright?
$imageDir = /images/houses/
$houseImages= scandir($imageDir)
After getting that sorted, could I just do something like below? (non-proper code)
foreach $houseImages where $house['id']_*.png
echo <div><img src=$house['id']_*.png></div>
 
Last edited:
Thanks for your reply! The reason I asked was because i could not see how the filename correlated to the house ID's. After giving it a second look i realised only about 50% of the house images we're created. I had better luck using generateHouses(30, true) then i had with false and was able to export more house images. It freezes but finishes after a couple of hours. Any thoughts on what i can do to make sure all of the houses are parsed? I'm using the precompiled package v4 from github with Windows 10.
Using 8.6 prepareClient(860, '/things/860/items.otb', '/world/OTMap.otbm', 8, 5)

Also great pointers regarding how to display the pictures. I'm new to JavaScript but should be able to pull it of. This one looked really neat: slick - the last carousel you'll ever need (https://kenwheeler.github.io/slick/)
Using scandir I guess this code looks alright?
$imageDir = /images/houses/
$houseImages= scandir($imageDir)
After getting that sorted, could I just do something like below? (non-proper code)
foreach $houseImages where $house['id']_*.png
echo <div><img src=$house['id']_*.png></div>
Released v2 and v3 versions were 32bit and they could not load big maps like RL map, because of 2.6 GB RAM limit. That's why you had to use true (or compile otclient on your own to get 64bit version).
Released v4 version (64bit) should load all houses with false:
Code:
generateHouses(30, false)
Generating with true take hours - it reloads whole map.otbm for every house, with false it should be few minutes.

It should generate all houses. If some house is bugged on map (common on RL maps), if will show message in console:
ERROR: House width or height is higher than 100 tiles! House ID: XXX
After generating house images, you should check, if there are any messages like that in OTC terminal. House errors handling was also added in v4. v2/v3 version was just crashing OTC.

About displaying on site:
PHP:
<?php
$houseId = 123;

// 'glob' search for files in directory and handles '*' in pattern
$imageFiles = glob('images/houses/' . $houseId . '_*.png');
foreach($imageFiles as $imagePath)
{   
    // we need to convert HDD path to URL
    // $imagePath = 'images/houses/123_7.png'
    // $imageName = '123_7.png'
    $imageName = basename($imagePath);
   
    echo '<div><img src="HERE/path/to/house/images/relational/to/website/path/' . $imageName . '"></div>
}
 
Last edited:
v3 (from this thread) and v4 do not work? Any error when you run it?

It's strange, because I can run v3 and v4 otclient.exe (Windows binary!) even on Linux and it works fine.
2020 - year when Windows apps work better on Linux, than on Windows:p
I cant open all versions, that is more strange x2 haha and true.. im almost ready to bring to linux at 100%.
 
@Gesior.pl I compile it again and work, maybe was a touble by myself, other thing is well my pc is not good, do you know any good rdp or specs to make this more faster?
 
@Gesior.pl I compile it again and work, maybe was a touble by myself, other thing is well my pc is not good, do you know any good rdp or specs to make this more faster?
If v4 .exe did not work, but you could compile sources and run app, it probably means, you have some .dll used by application in custom version already installed in Windows.
 
Back
Top