map_cache.txt 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. //===== Athena Doc ========================================
  2. //= eAthena Map Cache Builder and Format Documentation
  3. //===== By ================================================
  4. //= DracoRPG
  5. //===== Version ===========================================
  6. //= 1.0
  7. //=========================================================
  8. //= 0.1 - Short howto for the initial builder version
  9. //= 1.0 - Complete manual covering the improved version
  10. //===== Description =======================================
  11. //= A complete manual for eAthena's map cache generator
  12. //= as well as a reference on the map cache format used
  13. //=========================================================
  14. Preface:
  15. -------------------------------------------------------------------------------
  16. Since SVN revision ~10000, the map-server does not know how to read RO client files anymore. It reads maps from a
  17. "map cache" file that contains all and only the useful data about the maps. A map cache containing every official
  18. kRO Sakray map currently supported by eAthena is provided as a default.
  19. If you have custom maps or want to minimize the size of your map cache because your server does not load all of them
  20. (multi-map-server or light test server), you can use the map cache builder to generate a new one fitting your needs.
  21. Map cache builder manual:
  22. -------------------------------------------------------------------------------
  23. The source code for the map cache builder is located in src/tool/. It can be built using "make tools" if you use the Makefile
  24. or using the "mapcache" project under Visual Studio. Named "mapcache", the executable will be in your eAthena main folder.
  25. The map cache builder needs 3 file paths : one is a list of GRFs and/or data directory containing the maps, the second
  26. is the list of maps to add to the map cache, and the last one is the path of the map cache to generate. Default values for
  27. those paths are "tools/mapcache/grf_files.txt", "db/map_index.txt" and "db/map_cache.dat".
  28. The list of GRF and/or data directory must follow the format and indication of the default file: as many "grf:" entries as
  29. you wish and optionally one only "data_dir:" entry with trailing backslash included. // comments are supported as usual.
  30. In fact, any file with one map name per line can be used as a map list, that's why the map index list is used as a default:
  31. we are sure it contains every map supported by the server. Anything after the map name is ignored, // comments are supported
  32. and if the first word on the line is "map:" then the second word is used as the map name instead: that allows using
  33. maps_athena.conf as your map list, which is handy if you want to generate a minimal map cache for each of your multiple
  34. map-servers.
  35. The map cache file path can point to an already existing file, as the builder adds a map only if it's not already cached.
  36. This way, you can add custom maps to the base map cache without even needing kRO Sakray maps. If you wish to rebuild the
  37. entire map cache, though, you can either provide a path to a non-existing file, or force the rebuild mode.
  38. Here are the command-line arguments you can provide to the map cache builder to customize its behavior:
  39. -grf path/to/grf/list
  40. Allows to specify the file containing the list of GRFs and/or data directory
  41. -list path/to/map/list
  42. Allows to specify the file containing the list of maps to add to the map cache
  43. -cache path/to/map/cache
  44. Allows to specify the path to the generated map cache
  45. -rebuild
  46. Allows to force the rebuild mode (map cache will be overwritten even if it already exists)
  47. Map cache format reference:
  48. -------------------------------------------------------------------------------
  49. The file is written as little-endian, even on big-endian systems, for cross-compatibility reasons. Appropriate conversions
  50. are done when generating it, so don't worry about it.
  51. The first 6 bytes are a main header:
  52. <unsigned long> file size
  53. <unsigned short> number of maps
  54. Then maps are stored one right after another:
  55. <12-characters-long string> map name
  56. <short> X size
  57. <short> Y size
  58. <long> compressed cell data length
  59. <variable> compressed cell data