RuneWiki World Map Applet

World Map Applet

From RuneWiki
Revision as of 23:06, 11 September 2021 by Pazaz (talk | contribs) (→‎labels.dat)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Applet with all the interfaces expanded
World Map export for revision 374's map

Resources

src: https://git.runewiki.org/Old_Engine/WorldMap

jar: https://runewiki.org/archive/worldmap/WorldMap-1.0.jar

data: https://runewiki.org/archive/worldmap/3xx-worldmap.jag

Functions

Click and drag the mouse to pan around the map.

Open the Overlay interface to pan around the map quicker.

Open the Key interface to show a list of icons and click on them to highlight all of those icons in the world.

Press "E" to export an image of the full worldmap. In the original source, it was saved as a raw RGB image and the image dimensions was in the file name. If you use my fork it will be exported to PNG for you.

Loading Data

Initially the client will try to read worldmap.dat from the cache directory (e.g. C:\.file_store_32). It will check the SHA signature of the file against Signature.sha saved in the applet code.

If that fails, the client attempts to load the latest worldmap.jag archive. If the applet is running as a frame it will load it locally from the working directory as "worldmap.jag." Otherwise, it will download from an HTTP server (the codebase of the applet or localhost). It will only download up to Signature.len bytes and must be changed if there is a data update.

When downloading remotely the URL it loads is "worldmap" + sha + ".jag", where sha is half of the SHA signature represented as bytes, and concatenated:

for (int i = 0; i < 10; i++) {
    sha = sha + Signature.sha[k];
}

An example of this URL may look like "http://127.0.0.1/worldmap-76-598983-53362150-12116.jag"

worldmap.jag Files

worldmap.jag is a BZip2 archive like the ones stored in main_file_cache.idx0.

The files it has inside are:

  • size.dat
  • labels.dat
  • floorcol.dat
  • underlay.dat
  • overlay.dat
  • loc.dat
  • mapscene.dat
  • mapfunction.dat
  • b12_full.dat
  • index.dat

Some of these files are already available in the game cache.

Reconstructing worldmap.jag

b12_full.dat is a font from the title archive.

mapscene.dat and mapfunction.dat are sprites from the media archive.

loc.dat, floorcol.dat, overlay.dat, underlay.dat, size.dat, and labels.dat are created specifically for this applet.

labels.dat

The file starts with a 2-byte value defining how many labels there are.

Each label entry follows this format:

Parameter Type
Name String
X Word
Y Word
Type Byte

The name may use a forward slash to insert a new line while drawing the text.

Type can be 0, 1, or 2: 0 is the smallest text (area), 1 is normal text (city), and 2 is the larger orange text (region).