May be related: I'm trying to generate my map but always there is the same part missing on the same zoom level.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.
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.It says 121947 images generated, but there is only 120439 images in the folder
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 ).As my understanding having less images in this first generation process should make all zooms to have missing images not only specific ones, right?
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?I see..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 goingNetwork
tab, to view what images it loads. Can you find URLs to these 14 zoom level images that are missing (should be red innetwork
tab)? Are they missing inmap/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
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.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.
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.I will send you the images, my internet upload this in 5 minutes haha Check discord for invitation from Agent..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.![]()
otclient_mapgen/website_and_php_files/2_tile_generator.php at master · gesior/otclient_mapgen
Open Tibia map images generator [for LeafletJS]. Loads .otbm file and generate .png images 256x256 px - gesior/otclient_mapgengithub.com
If you can share serveritems.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.
It looks like you are using "transparency" feature in .spr.How to fix this?
modules/game_things/things.lua
and under:local errorMessage = ''
g_game.enableFeature(GameSpritesAlphaChannel)
How can I export a single image of the entire map? My map is very small, so I don't think there will be any problems, plus I have plenty of RAM.What is new in version 4.0?
Github release with 64-bit .exe:
- website view with NPCs and monsters search
- configurable town names and positions - big names visible on map
- possibility to link NPCs and monsters ex. mymap.com/#npc,Xodet , mymap.com/#monster,Dragon+Lord
- scripts to run 'zoom levels' and 'compression' on 16 cores on windows (for linux it was in version 3.0)
- house images generator - generate images of houses that you can use on 'houses' page in acc. maker
- minimap generator - you can generate full minimap and use it with any OTClient
- sources updated for new linuxes (new openssl) and newest Visual Studio project from edubart/otclient (vcpkg)
![]()
Release Map generator v4 - Windows x64 · gesior/otclient_mapgen
Open Tibia map images generator [for LeafletJS]. Loads .otbm file and generate .png images 256x256 px - Release Map generator v4 - Windows x64 · gesior/otclient_mapgengithub.com
What is this?
It's automatic map image generator [for website view 'like GoogleMaps'].
It generates OTS map .png images (each 8x8 tiles).
-- BINARY (.EXE) ATTACHED! YOU DO NOT HAVE TO COMPILE! --
To run binary you may need to install Microsoft VS 2019 Redist x64 first:
It contains configured JavaScript and HTML to view map on website like this:
View attachment 46550
How to use?
1. Download otclient_mapgen from GitHub:
GitHub - gesior/otclient_mapgen: Open Tibia map images generator [good for Leaflets]. Loads .otbm file and generate .png images 256x256 px
and compile it like normal OTClient:
Compiling on Windows · edubart/otclient Wiki · GitHub
Compiling on Linux · edubart/otclient Wiki · GitHub
Compiling on Mac OS X · edubart/otclient Wiki · GitHub
Compiling for Android · edubart/otclient Wiki · GitHub
OR DOWNLOAD BINARY (.EXE) ATTACHED
2. Copy your server client .spr and .dat files to OTClient folder: data/things/HERE_PROTOCOL_VERSION/
3. Copy your server data/items/items.otb file to OTClient folder: data/things/HERE_PROTOCOL_VERSION/
4. Copy your server data/world/MAP_NAME.otbm file to OTClient folder: data/map.otbm
5. Run otclient.exe
6. Type in client terminal command like:
prepareClient(1076, '/things/1076/items.otb', '/map.otbm', 8, 5)
- with you client protocol version,
- valid paths to items.otb and map.otbm,
- number of threads to run (in example it's 8),
- number of map parts (OTC will split map to parts to reduce maximum RAM usage)
[Paths are relational, so start path with '/' to start in folder 'data', access to other folders in computer is blocked]
7. OTClient will show in 10-50 seconds (it will freez client, do not close it, just wait) something like:
8. Type in client terminal command:
generateMap('all', 30)
OTClient will report progress in terminal.
9. Your map images will appear in your system 'user' directory
%HOMEPATH%/otclient - Windows, open it in folder explorer
$({HOME}/.otclient - Linux, 'cd' to it, this folder is invisible, but you can navigate to it
10. Copy folder map from folder metioned in previous step to folder website_and_php_files of otclient_mapgen.
--- NEXT STEPS REQUIRE PHP INSTALLED IN SYSTEM ---
--- LINUX: FOR GENERATION TIME, SET FOLDER website_and_php_files RIGHTS TO 777 ---
11. Linux
11. Windows
- Execute (in terminal):
sh linux_run_all.sh
1. If you got Git BASH installed
2. If you do not have Git BASH
- Execute (in system terminal):
./windows_run_1_pre_tile_generator.sh
- Execute:
./windows_run_2_tile_generator.sh
Watch CPU usage (by php.exe). Wait until it finish.
- Execute:
./windows_run_3_pre_compress.sh
- Execute:
./windows_run_4_compress.sh
Watch CPU usage (by php.exe). Wait until it finish.
- Execute (in system terminal):
php 1_pre_tile_generator.php
- Execute (command parameter is map 'floor'):
- You can execute these commands in any order.
- You can open few terminals and run few commands at once to generate it faster (use all CPU cores).
php 2_tile_generator.php 0
php 2_tile_generator.php 1
php 2_tile_generator.php 2
php 2_tile_generator.php 3
php 2_tile_generator.php 4
php 2_tile_generator.php 5
php 2_tile_generator.php 6
php 2_tile_generator.php 7
php 2_tile_generator.php 8
php 2_tile_generator.php 9
php 2_tile_generator.php 10
php 2_tile_generator.php 11
php 2_tile_generator.php 12
php 2_tile_generator.php 13
php 2_tile_generator.php 14
php 2_tile_generator.php 15
php 2_tile_generator.php 16
- Execute:
php 3_pre_compress.php
- Execute (command parameter is map 'floor'):
- You can set compression quality in file 4_compress.php (line: $quality = 80
- You can execute these commands in any order.
- You can open few terminals and run few commands at once to generate it faster (use all CPU cores).
php 4_compress.php 0
php 4_compress.php 1
php 4_compress.php 2
12. Move folder website_and_php_files/map_viewer to your webserver - it contains all images and website scripts to view them (Leaflet Map).
13. Configure map_viewer. Config is at start of map.js file:
- You can keep images on other webserver. Set imagesUrl to URL of this server like: 'http://myserver.com/map_images/'
Code:imagesUrl: 'map/', // URL to folder with 'zoom levels' (folders with names 0-16) imagesExtension: '.jpg', mapName: 'RL MAP?', startPosition: {x: 1000, y: 1000, z: 7}, startZoom: 14, minZoom: 4, maxZoom: 18, // maximum zoom with full quality is 16
GENERATE HOUSE IMAGES
Houses with few floors generate few images with 'floor level' in file name, but all floors images have same size and top-left corner position, so you can show it on website with +/- button to switch floors.
- Do steps 1-6 from How to use? instruction (above).
- Type in client terminal command:
generateHouses(30, false)
- 30 - shadow percent for tiles around house (they will be darker)
- false - load whole map at once, requires much RAM, set it to true to load map by parts, it's much slower, but will use little amount of RAM to generate house images
- It will freez client for house generation time! Don't close it. If you want watch progress run OTClient by windows/linux console (not by clicking .exe):
./otclient
'Freezed' client will show messages about generated houses in system console.- Your house images will appear in your system 'user' directory:
%HOMEPATH%/otclient/house/ - Windows, open it in folder explorer
${HOME}/.otclient/house/ - Linux, 'cd' to it, this folder is invisible, but you can navigate to it
Example house image - tiles outside house are 30% darker:
View attachment 46551
GENERATE FULL MINIMAP FOR OTCLIENT
Most of released OTClient .exe files are 32-bit and they got limit around 2 GB RAM. It means that you cannot generate minimap from .otbm bigger than ~60MB.
Attached binary is 64-bit version of OTClient. It can load any size .otbm into RAM. To export full minimap, you got to load whole map.
- Do steps 1-6 from How to use? instruction (above).
- Type in client terminal command:
saveMinimap('minimap.otmm')- Your minimap will appear in your system 'user' directory:
%HOMEPATH%/otclient/ - Windows, open it in folder explorer
${HOME}/.otclient/ - Linux, 'cd' to it, this folder is invisible, but you can navigate to it- Copy it to folder data in your normal OTClient. It must be closed when you place there new minimap!
- Run your OTClient, login to game, you should see full minimap.
Probably not. This client requiresIs it possible to use this with the Nostaurius system?
items.otb
, so you would need to somehow generate items.otb
with item attributes and IDs as in Nostalrius server.500x500 SQM (16k px x 16k px) takes around 1 GB RAM and generates ~60 MB PNG.How can I export a single image of the entire map? My map is very small, so I don't think there will be any problems, plus I have plenty of RAM.
data/things/1098/
:prepareClient(1098, '/things/1098/items.otb', '/things/1098/forgotten.otbm', 1, 1)
g_map.setMinXToLoad(0)
g_map.setMaxXToLoad(70000)
g_map.setMinXToRender(0)...
drawCustomMap
function:https://downloads.ots.me/data/tibia-clients/dat_and_spr/1098.zip
and unpack it into data/things
in client, so there will be folder data/things/1098
with Tibia.dat
and Tibia.spr
data/items/
copy items.otb
to otclient data/items.otb
data/world
copy .otbm file to otclient data
ex. data/forgottenserver.otbm
g_map.setShadowPercent(30)
prepareClient(1098, 'items.otb', 'forgotten.otbm', 1, 1)
g_map.setMinXToLoad(0)
g_map.setMaxXToLoad(70000)
g_map.setMinXToRender(0)
g_map.setMaxXToRender(70000)
g_map.loadOtbm('forgotten.otbm')
g_map.drawCustomMap("100x100.png", 100, 350, 7, 200, 450, true);
x = 100, y = 350, z =7
and ending on position x = 200, y = 450, z =7
(it always generate only 1 floor).true
is "render lower floors", when you render other floor than 7 (ground level). Lower floors are rendered a bit darker, it's set by g_map.setShadowPercent(30)
to make lower floors 30% darker. modules/game_things/things.lua
file. More information about it:If you are using myIm using 8.6 extended client
5.1 otclient_mapgen
.exe ( https://github.com/gesior/otclient_mapgen/releases/download/v5.1/otclient_mapgen_v5.1_win-x64.zip ), it does not auto-detect 'extended sprites' .dat/.spr files for any protocol as OTCv8 does.modules/game_things/things.lua
and under:local errorMessage = ''
g_game.enableFeature(GameSpritesU32)
I tried using the command "g_map.drawCustomMap("100x100.png", 100, 350, 7, 200, 450, true);" but nothing happened. Sorry for the delay.Provavelmente não. Este cliente requeritems.otb
, então você precisaria gerar de alguma formaitems.otb
com atributos e IDs de itens como no servidor Nostalrius.
500x500 m² (16k px x 16k px) ocupam cerca de 1 GB de RAM e geram ~60 MB de PNG.
Eu descrevi isto aqui:
[CONTEÚDO INCORPORADO="post-2765061"] Exportar mapa RME (https://otland.net/threads/export-rme-map.290672/#post-2765061[/INCORPORADO])
Instruções mais fornecidas para o protocolo TFS 1.4 10.98:
1. Primeiro baixe a versão 5.1 do gerador, ela tem novasdrawCustomMap
funções:
2. Em seguida, baixe os arquivos .spr e .dat do seu cliente (ou use a versão do seu cliente, se tiver modificado os arquivos):
ex.https://downloads.ots.me/data/tibia-clients/dat_and_spr/1098.zip
e descompacte-odata/things
no cliente, então haverá uma pastadata/things/1098
comTibia.dat
eTibia.spr
3.data/items/
Da cópia do OTSitems.otb
para o otclientdata/items.otb
4. Faça uma cópia OTSdata/world
do arquivo .otbm para otclientdata
ex.data/forgottenserver.otbm
5. Execute otclient.exe
6. Digite (você pode copiar e colar tudo em uma única linha no terminal OTC, funcionará):
para preparar o cliente.LUA:g_map.setShadowPercent(30) prepareClient(1098, 'itens.otb', 'esquecido.otbm', 1, 1) g_map.setMinXToLoad(0) g_map.setMaxXToLoad(70000) g_map.setMinXToRender(0) g_map.setMaxXToRender(70000) g_map.loadOtbm('esquecido.otbm')
7. Tipo:
para gerar uma imagem de 100 x 100 começando na posiçãoLUA:g_map.drawCustomMap("100x100.png", 100, 350, 7, 200, 450, verdadeiro);
x = 100, y = 350, z =7
e terminando na posiçãox = 200, y = 450, z =7
(sempre gera apenas 1 andar).
A imagem será salva na pasta OTC ao lado de .exe.
O último parâmetrotrue
é "renderizar andares inferiores", quando você renderiza um andar diferente do 7 (nível superior). Os andares inferiores são renderizados um pouco mais escuros. A configuração ég_map.setShadowPercent(30)
para tornar os andares inferiores 30% mais escuros.
Se seu cliente utilizar alguns recursos personalizados, como "sprites estendidos" no protocolo 8.6, você deverá habilitá-los nomodules/game_things/things.lua
arquivo. Mais informações sobre isso:
[CONTEÚDO INCORPORADO="post-2764598"] Resolvido - Gerando minimapa a partir de erro otclient (https://otland.net/threads/generating-minimap-from-otclient-error.290595/#post-2764598[/INCORPORADO])