Jump to content
Sign in to follow this  
V3ct0r

Tool for compressing .map files

Recommended Posts

Tool for compressing .map files

 

When working with the YAMMI map editor, there may be a problem that the output .map file will be very large. For example, if you open the map darkblue.map (Deep Blue) in YAMMI and save it to disk, then the size of the map will be about 240 MB, instead of the original 46 MB! This is due to the fact that most of the darkblue map is occupied by the sea, i.e. essentially the same cells that do not differ from each other, and such cells do not need to be written to the .map file - the game client will automatically replace them with water when rendering, but YAMMI does not use this optimization and still writes "empty" cells to the output .map file.

 

This tool solves the problem described above and allows you to significantly reduce the size of .map files on disk after they have been edited in YAMMI. To do this, the program looks for "empty" cells in the .map file and removes them from the file.

 

Download

1) The tool (pkodev.tool.mapcompressor.exe);

2) Source code (C++).

 

The tool is a console program, so the paths to the source and output .map files are passed through the startup parameters:

> pkodev.tool.mapcompressor darkblue.map darkblue_c.map

darkblue.map is the uncompressed .map file that needs to be reduced;

darkblue_c.map is a compressed .map file after being processed by the program.

 

The output of the program will be something like this:

PKOdev.NET .map file compressor program
Version: v1.0.0 (03/01/2022)
Author: V3ct0r

Input .map file: darkblue.map
Output .map file: darkblue_c.map

Input .map file information:
* Width: 4096
* Height: 4096
* Section width: 8
* Section height: 8
* Sections number: 262144

Please wait . . .

Done!
* Sections compressed: 222007
* Percentage: 84.69%
* Bytes freed: 213126720

As you can see from the output, the size of the .map file has been reduced by about 203 MB!

 

 

Attention! At the moment, the program has not yet been properly tested, so after compression, certain errors may occur on the maps. Keep this in mind when working and keep backup copies of the original .map files.

 

  • Like 2

Share this post


Link to post
Share on other sites

@V3ct0r Добрый вечер. Спасибо за этот пост, я уже переписал компрессор карт и распаковку мини-карт на C#))

И вот я задумался.. Еще же есть Yummi. У тебя нет его исходников или чего-нибудь подобного? Хочу добить все это и сделать 1 проект для полноценной работы с картами.

Edited by Graf

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...