Lich:A beginner's guide to the Lich mapdb

The official GemStone IV encyclopedia.
Revision as of 06:50, 29 April 2018 by DAID (talk | contribs) (First save. I am continuing to edit presently, so please hold off your edits. Will note when a save is my last for this afternoon.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
NEVER UPLOAD ANYTHING TO THE MAPDB WITHOUT CAREFULLY CHECKING YOUR WORK!
This article is a work in progress!

The Lich map database (mapdb) is an important part of Lich used for automated travel and other tasks related to room properties. It is independent from the go2 script, but in general both of these two require the other for normal use. This article aims to provide a general introduction to the mapdb at a level appropriate for basic usage as well as getting started wtih modifications.

Introduction

Despite their differences, updates to the mapdb are often erroneously called updates to the script go2. The mapdb provides the basic information on which go2 operates. For many players, the distinction between the two is not important; if someone updates the mapdb to include new paths and/or new rooms, go2 will know how to use them without further instruction. It is, however, important to understand the distinction for anyone wishing to work on or with the mapdb.

One is a database (mapdb) and the other is a script (go2). To exemplify their differences, consider that Prime, Platinum, and Shattered all have different mapdbs, but they can commonly share the same version of the go2 script. The databases cannot be shared across instances because the actual rooms and layouts are not 100% identical between them; they can, however, share the logic used by go2 to perform operations on the mapdb and issue instructions to the game server for movement and other tasks.

The mapdb is a file with a record for each unique room it knows about. At present, the file is about 20 MB in size containing information about nearly 30,000 rooms. These files are kept under lich/data/GSIV/map-##########.dat (for the Prime instance), where the long number is an identifying hash which is updated automatically in an incremental fashion. Although the hashes do not proceed linearly in mapdb number (e.g. 1, 2, 3, 4), a smaller hash is always an older version of the mapdb than a newer hash.

This article will focus on the mapdb from the perspective of not only its use with go2, but other scripts such as narost and ones that sort rooms by nearest location and tags (e.g., zzherb).

What is a room?

The best (and really only) way to interact with the mapdb is via the game through lich. In general, if one is in a mapped room, one can have a look at its mapdb record via the command ;e echo Room.current.inspect. Below is a fairly reasonable case to consider, as it has enough details to provide examples but is not overly complicated.

@wayto={"226"=>"south", "294"=>"southwest", "224"=>"east"}
@paths=["Obvious paths: east, south, southwest"]
@image_coords=[197, 175, 233, 211]
@terrain=nil
@description=["The road turns gradually at this point as it forms the northwest corner of the city.  The main path curves along the north and west walls, and another leads south between the buildings.  The massive oak and modwir logs of the city palisade tower overhead."]
@image="wl-wehnimers-1264234799.png"
@climate=nil
@title=["[Wehnimer's, North Ring Rd.]"]
@check_location=nil
@timeto={"226"=>0.2, "294"=>0.2, "224"=>0.2}
@id=225
@location="the town of Wehnimer's Landing"
@tags=["some sovyn clove", "some acantha leaf", "some calamia fruit", "pepperthorn root", "ironfern root", "small rose", "heath aster", "some bur-clover root", "some wingstem root", "small wild rose", "white baneberry", "small daisy"]
@links=[]
  • wayto:
  • paths:
  • image_coords:
  • terrain:
  • description:
  • image:
  • climate:
  • title:
  • check_location:
  • timeto:
  • id: The room number is a unique identifying integer, and perhaps the most common technical detail of the mapdb which is used regularly by all lich users. They are linear in the order they are added to the mapdb, although there is no implicit relation between a room number and what may be called the geographic location in the game.
  • location:
  • tags:
  • links:



Resources