• 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

Can I somehow include monster images (from spawns) and maybe even NPCs to show my players? And where can I read more on how I can work with OTClient?
Thank you for this great thing you made
There are 2 ways to add something to Leaflet map:
- draw image on map - OTClient can draw monster image on monster position from map .xml file, but it will be hard to find on map (player must zoom in very close to see monsters)
- add 'marker' [like 'point' on Google Maps] - PHP or OTClient can 'unpack' .xml file to list of monster/NPC names and positons in JSON (javascript) format, then Leaflet can add these points on map with 'monster images' as 'icons' ( http://leafletjs.com/examples/custom-icons.html )

Second option is better, because you can add 'search box' on website in which user can type 'Demon' and view on map all Demons spawns, it would be hard to show all 50.000 monsters (map would be unreadable.. webbrowser would freez with so many elements on website).
 
@Gesior.pl I've been gone for a while, but is it now possible to unpack my own ORTS map? or still having errors with unpacking?
 
https://github.com/djarek/otclient_mapgen
is much faster version and should work without errors. I will try to make LUA for it in next few days and release new version of https://github.com/gesior/otclient

COmpiling now,
Still the same?

1. prepareClient(1076, '/things/1076/items.otb', '/map.otbm')
2. generateMap(25, 45, 0, 555, 699, 15, 4) <-- to generate full map.

@Gesior.pl I'm having compiling issues again, mind compiling it and posting the .exe of the client?
 
Last edited by a moderator:
Oke, i'm able to unpack the 400k images on linux, but i cant find where the are there..
cant find /home/username/otclient/map any ideas?
 
@Gesior.pl

I'm sure https://github.com/djarek/otclient_mapgen contains a source bug since it gives out same compiling error on linux/windows.
I made new version of generator based on previous commit by djarek.
It generated 7.72 RL map (130.668 images, ~160 images per second) in 14 minutes on my 4x4GHz CPU [16 threads in OTClient].
I'm also working on new version of PHP script. Version that will not require configuration and will work much faster (use Imagick/Gmagick).

I will try to release it on Github this week.
 
Cannot edit...

I wasted 2 hours to make script that convert images on few cores (generate list of positions for each thread).. then I realized that 'Imagick' works on all cores (even if you process 1 image).
I should finish C++/LUA/PHP scripts tommorow. Then just test JS script and I can release it.
 
Code is ready. I will release tommorow in new thread.

Today tests:
30MB map
(~1/3 of RL map size in tiles), 4x4GHz, Samsung 850 Evo SSD 512GB:
1. Generate images from .otmb (this requires much RAM for map, all next steps use less then 100MB RAM) - 7 minutes
2. Prepare generator - 0.2 minute
3. Compose floors (on higher floor you must see floors below) - 95 minutes
4. Add shadow to lower floors (floors below are 30% darker then current floor) - 89 minutes
5. Generate 16 'zoom' levels for LeafletJS - 24 minutes
6. Compress 11 GB (270.000) PNG images to 2.6 GB JPG images - 35 minutes

elqbF1hSv.png

Configuration required: NONE (open website, give it 1 minute to generate links, click on links)
Total generation time: 4 hours 11 minutes

Fixed 'show' (move map to player position and change his 'pointer' color from blue to red) and 'follow' (keep map center on player position, show 'crosshair') options:
3pTCZlo1R.png
 
Thank you Gesior we all appreciate your efforts!

Code is ready. I will release tommorow in new thread.

Today tests:
30MB map
(~1/3 of RL map size in tiles), 4x4GHz, Samsung 850 Evo SSD 512GB:
1. Generate images from .otmb (this requires much RAM for map, all next steps use less then 100MB RAM) - 7 minutes
2. Prepare generator - 0.2 minute
3. Compose floors (on higher floor you must see floors below) - 95 minutes
4. Add shadow to lower floors (floors below are 30% darker then current floor) - 89 minutes
5. Generate 16 'zoom' levels for LeafletJS - 24 minutes
6. Compress 11 GB (270.000) PNG images to 2.6 GB JPG images - 35 minutes

elqbF1hSv.png

Configuration required: NONE (open website, give it 1 minute to generate links, click on links)
Total generation time: 4 hours 11 minutes

Fixed 'show' (move map to player position and change his 'pointer' color from blue to red) and 'follow' (keep map center on player position, show 'crosshair') options:
3pTCZlo1R.png
 
I got no time to write new thread now. It's ready, tested:
https://github.com/gesior/otclient_mapgen - modified OTClient to generate .png images from .otbm
https://github.com/gesior/otclient_mapgen_php - PHP scripts to generate LeafletJS map from .png images + configured map viewer

Map viewer (https://github.com/gesior/otclient_mapgen_php/tree/master/map_viewer):
- all easy configurable
PHP:
var mapConfig = {
    imagesUrl: 'http://myserver.com/map/', // URL to folder with 'zoom levels' (folders with names 0-16)
    imagesExtension: '.png',
    mapName: 'RL MAP?',
    startPosition: {x: 1000, y: 1000, z: 7},
    startZoom: 14,
    minZoom: 4,
    maxZoom: 18, // maximum zoom with full quality is 16
  
    streamUpdateURL: 'update.php',
    disableClusteringAtZoom: 14, // disable grouping when zoomed in
    streamAnimationFramesPerSecond: 25, // smoother animation requires fast PC for high number of players online

    streamOutfit: false,
    streamHideOutfitOnZoom: 14, // show icons, not outfits when zoomed out
    outfitGeneratorURL: 'http://outfit-images.ots.me/outfit.php?',
    outfitAnimatedGeneratorURL: 'http://outfit-images.ots.me/animatedOutfits1080/animoutfit.php?'
}

In Leaflet (map view) script I've added possibility to stream outfits (+player direction), moving players got animation of move and turn right direction, so it looks cool.
LUA script for other TFS versions [stream server] I will release when someone ask for it.

Current version of LUA script is only for TFS 1.1 and it does not stream outfits:
https://github.com/gesior/otclient_mapgen_php/blob/master/map_viewer/minimap_stream_TFS_1.1.lua
 
I did some updates in LUA and JS scripts [show names and health bar on map].
Not everything is already released on github [still testing], but I've added TFS 1.2 LUA script for streaming players with outfits.

Newest version online demo is available here [8.0 RL map + 2 fake players that run random tiles]:
http://map.eloth.net/#zoom,17,position,32423,32101,6

Screen:
oNCH2PE.png


TODO:
- show NPCs on map
- search NPC by name
- search NPC by item name - sell/buy (+compare item with name X sell/buy price of all NPCs)
- show monster spawns [inaccurate, does not show real position from spawns.xml]
- search monsters [show 'big'/'medium'/'small' spawns, I need to prepare some algorithm to generate some heatmap of monsters]
 
doesn't load on firefox
Thank you for report. I fixed CSS. Now it works fine in Chrome, Firefox, IE 11 and in Chrome on Android 4.3.
Screen width over 980px is recommended, because Bootstrap moves down container with change floor/search with lower resolution - hard to use on old mobile phones.
 
It's so fast o_O Never seen anything like that.
tibia earth and tibiawiki map lag so much while doing exact same thing slower o_O
 
LG K4 LTE, Firefox 46.0
Android 5.1.1

https://imgur.com/KAK9T9n
area is too large and sometimes I have to refresh the page to get to settings panel
besides that everything works perfectly ;p Awesome work!
 
I just can't find the folder 'otclient/map' on Ubuntu 16.4.
root/.otclient/map doesn't exists.
home/otclient/map doesn't exists.
home/otclient_mapgen/map doesn't exists.

I've tried to compile with djarek's and gesior's version.

Can somebody help me track it?

Thank you.
 
Hey guys, nvm, I've found the folder.

My considerations (for those who are having trouble):

Compiling on Windows with CodeBlocks it's impossible by following OTClient's tutorial.
I've tried on Win 8.1, 10 and a clean version of 7 on a VM.
Compiling with VisualStudio is also a waste of time.

Compiling on Linux is easy and fast.
Download a VM (VirtualBox or VMware) and a Ubuntu ISO (from Ubuntu's website) and install linux.
After following tutorial's instructions and generating some images, open a new terminal and type 'nautilus .otclient/map'.

Now I'm going to test the PHP part (after some days stuck on this)

See ya!
 
Back
Top