[Guide] Mapcache Generation 2018

bWolfie

I'm the man
Messages
850
Points
0
Location
Alberta, Midgard
Github
bWolfie
Emulator
As of Release v2018.03.13, the method to generate mapcache for Hercules has changed. A lot of people. myself included, were confused as to how it works. In this thread, I will do my best to explain the new way to generate your cache. This guide is intended to help people using the old system, not to aid new people (i.e. never generated mapcache before), so if you are new, some of it may seem like alien talk.

Old (your source predates [is older than] Feb 18, 2018)

In the old system, there were two ways to generate mapcache

  • You could run the mapcache executable in Hercules root folder.
  • Or use a program such as WeeMapCache to edit in your required mapcache.
These two methods would generate or alter your required mapcache located in db/[pre-re or re]/map_cache.dat. However, they are no longer supported.

New (your source is using Release v2018.03.13 or newer)

The new system involves the use of the new 'mapcache' plugin to generate files. Some quick points:

  • db/[pre-re or re]/map_cache.dat has been dropped (no longer supported).
  • In its place are individual .mcache files for every map located in maps/[pre-re or re]/
  • Mapcache executable has been removed.
  • Replaced with the mapcache plugin (src/plugins/mapcache.c).
How to generate the mapcache?

  1. Same as before, check conf/map/maps.conf and db/map_index.txt have all the maps you want to cache.
  2. Your maps need to exist somewhere in your repository! There are two ways for the plugin to find them:
    a. Place all your maps, including resnametable.txt, inside the data folder of your Hercules repo. I.e. Hercules/data/prontera.gat/gnd/gnd/rsw (note: I forget if all three files are needed).
    b. OR Configure your conf/grf-files.txt to tell it where to find your GRF(s) which contains your maps.
  3. Build the mapcache plugin. On linux, this can be done by running the following command:
    make plugin.mapcache
    If using MSVC, compile as you would any other plugin.
  4. Execute plugin. This can be done using the following command:
    ./map-server --load-plugin mapcache [param]
    In windows, just remove the './' and run the commands in your command prompt.
The params:

The first thing you should do is run
./map-server --load-plugin mapcache --help

A list of usable parameters will appear. Here are the ones you need to know for mapcache:

Code:
[Info]:   --convert-old-mapcache         Converts an old db/pre-re/map_cache.dat file to the new format. [Mapcache]
[Info]:   --rebuild-mapcache             Rebuilds the entire mapcache folder (maps/pre-re/), using db/map_index.txt as index. [Mapcache]
[Info]:   --map <name>                   Rebuilds an individual map's cache into maps/pre-re/ (usage: --map <map_name_without_extension>). [Mapcache]
[Info]:   --fix-md5                      Updates the checksum for the files in maps/pre-re/, using db/map_index.txt as index (see PR #1981). [Mapcache]
./map-server --load-plugin mapcache --convert-old-mapcache
Rebuild all the .mcache files using your old db/[pre-re or re]map_cache.dat file.
NOTE: You should only run this command when you have an old map_cache.dat file you need to convert.

./map-server --load-plugin mapcache --rebuild-mapcache
Rebuild all the .mcache files using your map files specified in step 2 of generation.
NOTE: You should only run this command in special circumstances. This erases ALL the existing mapcache and rebuilds it with whatever files you provide it. If you don't have the required files, the build will fail and you will be left with missing mapcache files, meaning you won't be able to access those particular maps.

./map-server --load-plugin mapcache --map <name>
Rebuild the .mcache file for the map name you specify. E.g. if you replace <name> with prontera, the maps/[pre-re or re]/prontera.mcache file will be rebuilt.
NOTE: This is the best command to run, as it only caches a single map at a time.

./map-server --load-plugin mapcache --fix-md5
I don't know what checksum is for.

The End

Feel free to ask for help here. I'll try to answer questions re: mapcache if possible. And if you think anything needs correcting or added, let me know.

Hope this helps!

 
Last edited by a moderator:
I successfully ran the code. But I still cannot @go to my custom map?

 
Last edited by a moderator:
Can anyone build a tutorial or video to compile the map cache in windows, please!

pt-br: Alguém pode construir um tutorial ou video para compilar o mapa cache no windows, por favor!

 
I don't have Visual Studio so I'm unable to compile and test. Hopefully somebody can fill in this missing info.
Building the mapcache on a Windows machine

Yes, I've tested building the mapcache on Visual Studio on a Windows machine.

I've updated the documentation for how to build the plugins (like the mapcache plugin) for windows. It is under Building HPM Plugin for MSVC. I also included the screenshots that used to be in the mediawiki site.

Can anyone build a tutorial or video to compile the map cache in windows, please!

pt-br: Alguém pode construir um tutorial ou video para compilar o mapa cache no windows, por favor!
Building the mapcache

Hello there. I just recently updated the guide for building the mapcache on a Hercules server (December 2018). It's found in the Github Wiki under Mapcache. It generally covers more-or-less the same thing that Myriad has already discussed.

What it requires from you is:

  • You need to understand how Hercules' Plugin Manager (HPM) works
  • You need to understand how to add and build a plugin using the HPM.
Since you're trying to build the mapcache, just go here and read about the Mapcache.

If you think some parts of it are confusing, or difficult to understand, please respond on this thread so I can add details to the tutorial.

 
Last edited by a moderator:
I honestly have no idea of the conditions, I am completely new and I just want to clean up the old maps of pre-renewal, if I could add a step-by-step with images it would be very good for those who fell parachute in the world of emulators.

The tutorial of this post was even understanding until arriving at the park that copilar in windows was not quoted: /

pt-br: 

Sinceramente não tenho ideia das condições, sou completamente novato e só quero arrumar os mapas antios da pré-renovação, se pudesse adicionar um passo-a-passo com imagens seria muito bom para aqueles que cairam de paraquedas no mundo dos emuladores.

O tutorial deste post até tava entendendo até chegar na parque que copilar no windows não foi citado :/

 
I honestly have no idea of the conditions, I am completely new and I just want to clean up the old maps of pre-renewal, if I could add a step-by-step with images it would be very good for those who fell parachute in the world of emulators.

The tutorial of this post was even understanding until arriving at the park that copilar in windows was not quoted.
From what I understand, you have a novice/beginner experience in starting up a server, so "compiling" must be a difficult concept. I wrote about it in more detail here:

https://github.com/HerculesWS/Hercules/wiki/Compiling

Start with figuring out your operating system, so that you can determine which guide to follow. Once you know what operating system to use, just follow the instructions in the mapcache guide.

Let me know what part you get stuck in.

 
From what I understand, you have a novice/beginner experience in starting up a server, so "compiling" must be a difficult concept. I wrote about it in more detail here:

https://github.com/HerculesWS/Hercules/wiki/Compiling

Start with figuring out your operating system, so that you can determine which guide to follow. Once you know what operating system to use, just follow the instructions in the mapcache guide.

Let me know what part you get stuck in.
Problem solved!
Thanks

 
Hello.

I rebuilt mapcache (using mvs plugin guide) so my custom map works fine

But in result of this mapcache rebuilding some errors started to pop up: 

when rebuild - http://prntscr.com/m4ep8n

when start server - http://prntscr.com/m4epz5

I also had an error about not having poring_c01/poring_c02 maps (so I downloaded them from some link on the forum).

If I delete this pvp-* map entries from map_index and maps.conf I get this error - http://prntscr.com/m4euii

Where can I download maps needed? Or have I done something wrong here?

Using latest kRO data folder + 2015-10-29aRagexeRE + Hercules v2018.12.16

kRO client is up to date but has no files for these maps - only for *-2 (http://prntscr.com/m4emt9).

Thx

 
Last edited by a moderator:
Hello.

I rebuilt mapcache (using mvs plugin guide) so my custom map works fine

But in result of this mapcache rebuilding some errors started to pop up: 

when rebuild - http://prntscr.com/m4ep8n

when start server - http://prntscr.com/m4epz5

I also had an error about not having poring_c01/poring_c02 maps (so I downloaded them from some link on the forum).

If I delete this pvp-* map entries from map_index and maps.conf I get this error - http://prntscr.com/m4euii

Where can I download maps needed? Or have I done something wrong here?

Using latest kRO data folder + 2015-10-29aRagexeRE + Hercules v2018.12.16

kRO client is up to date but has no files for these maps - only for *-2 (http://prntscr.com/m4emt9).

Thx
I have the same errors.

This new way of adding custom maps is so hard, maybe i'll change my emulator to rathena because of this.

I just want to fix the unwalkable areas in izlude map but I have to do all this just to fix it.

Why did they change the old way, it's so easy compared to the new way of adding custom maps.

 
Last edited by a moderator:
Once you get used to it, the new way is far easier. Consider that most of us are running Hercules on Linux, which means we don't face the issues people running local servers on their Windows do (in terms of mapcache).

A tl;dr guide is

- Make the 'mapcache' plugin.
- With the izlude map files you want to use in your /data/ folder, run:

Linux

Code:
./map-server --load-plugin mapcache --map izlude
Windows

Code:
map-server.exe --load-plugin mapcache --map izlude


The errors from those screenshots are happening because that person rebuilt their entire cache without having the required files that resnametable.txt was looking for.

E.g. you ran ./map-server --load-plugin mapcache --rebuild-mapcache 
But you didn't have all the map files you needed in the /data/ folder or your GRFs.
In this screenshot: https://prnt.sc/m4ep8n - pvp_y_1-4 is based on alberta, so you would need all the alberta map files when mapcache is being rebuilt.

I should probably update that you shouldn't run the rebuild-mapcache option unless it's really necessary.

 
Last edited by a moderator:
Myriad, I have successfully used this

map-server.exe --load-plugin mapcache --map izlude


but it did not fix the unwalkable areas on izlude map. Also, I have error in reading the data.grf on my RO folder. I have successfully configured the conf/grf-files.txt

https://imgur.com/a/YkR8Mc6

When I use

map-server --load-plugin mapcache --rebuild-mapcache


It fixes the izlude map but there are hundreds of errors on my map-server after executing it.

 
Last edited by a moderator:
I fixed it Myriad.

I extracted all the izlude maps in data.grf. I moved it to my data folder. Then I ran

map-server.exe --load-plugin mapcache --map izlude
map-server.exe --load-plugin mapcache --map izlude_a
map-server.exe --load-plugin mapcache --map izlude_b
map-server.exe --load-plugin mapcache --map izlude_c
map-server.exe --load-plugin mapcache --map izlude_d
map-server.exe --load-plugin mapcache --map izlude_in


The unwalkable areas of izlude map are now fixed. Thank you.

 
FUCKING BULLSHIT HERCULES WHY U CHANGE THIS BULLSHIT LIKE THIS? IM DONE WITH THIS HERCULES ILL CHANGE MY SERVER TO RATHENA !!!! EASY TO SETUP
lol? this is way better than the old way. Splitting cache into individual files makes it so much easier to manage. Those used to the old way (editing map_cache.dat) will struggle at first, but find it a lot better once they get used to it. I was mad when the change was first made, now I am much happier because of it.

 
FUCKING BULLSHIT HERCULES WHY U CHANGE THIS BULLSHIT LIKE THIS? IM DONE WITH THIS HERCULES ILL CHANGE MY SERVER TO RATHENA !!!! EASY TO SETUP
https://annieruru.blogspot.com/2019/01/how-to-add-custom-map.html

the reason why hercules change the mapcache system because, the default way of running map_cache.bat
https://github.com/HerculesWS/Hercules/pull/1552#issuecomment-279596099
1. can generate rubbish the more you run map_cache.bat
2. total capacity is smaller than rathena
3. can use plugin to inspect each file

but Haru probably doesn't know about the weemapcache though, because using weemapcache on the import map_cache.dat also do the same

 
FUCKING BULLSHIT HERCULES WHY U CHANGE THIS BULLSHIT LIKE THIS? IM DONE WITH THIS HERCULES ILL CHANGE MY SERVER TO RATHENA !!!! EASY TO SETUP
Well, you are free to change emulator, nobody is forcing anything to you.

Also, swearing/shouting is not allowed in this forum.

 
https://annieruru.blogspot.com/2019/01/how-to-add-custom-map.html

the reason why hercules change the mapcache system because, the default way of running map_cache.bat
https://github.com/HerculesWS/Hercules/pull/1552#issuecomment-279596099
1. can generate rubbish the more you run map_cache.bat
2. total capacity is smaller than rathena
3. can use plugin to inspect each file

but Haru probably doesn't know about the weemapcache though, because using weemapcache on the import map_cache.dat also do the same
Weemapcache is known, but it does not follow proper format.

Weemapcache does not preserve map index instead of creates its own index based on map names (alphabetically)

Also, new system helps to know what changes are been done and is better trackable in git.

 
Back
Top