Page 1 of 1

Offline Bones Sharing

PostPosted: Tuesday, 29th September 2015, 18:11
by MainiacJoe
I was curious whether there is a mechanism for sharing bones files between offline players. A search revealed Geistwagen, but it appears to be defunct. A simple ftp might work, except that I don't know whether it is possible and/or necessary to inspect a bones file to see how many ghosts are in it.

Re: Offline Bones Sharing

PostPosted: Tuesday, 29th September 2015, 18:52
by Siegurt
You could probably set something up with like google drive or dropbox or copy or something.

Any general purpose file sharing mechanism would probably work fine.

Re: Offline Bones Sharing

PostPosted: Tuesday, 29th September 2015, 19:00
by MainiacJoe
If we were to do this do we need to have different folders for different versions of Crawl?

Re: Offline Bones Sharing

PostPosted: Tuesday, 29th September 2015, 19:02
by MainiacJoe
I noticed too that the bones files themselves are very small, so the information they need is in another file or files somewhere that would need to be uploaded too and kept together.

EDIT: I'm guessing it's just the morgue .txt file that has the same timestamp in the filename as the bones file's "date created" OS timestamp.

Re: Offline Bones Sharing

PostPosted: Thursday, 1st October 2015, 16:46
by neil
MainiacJoe wrote:I noticed too that the bones files themselves are very small, so the information they need is in another file or files somewhere that would need to be uploaded too and kept together.

EDIT: I'm guessing it's just the morgue .txt file that has the same timestamp in the filename as the bones file's "date created" OS timestamp.


The bones file is all you need. Remember that bones in Crawl don't include the level, only the ghost(s) itself. There's not all that much info for a ghost, and it is all encoded numerically other than the name. Some of the values are only relevant for panlords, ugly things, or dancing weapons (which use the same data structure), but they are stored anyway:
  • name (2 bytes + length of name)
  • species (2 bytes)
  • job (2 bytes)
  • religion (1 byte)
  • best skill (2 bytes)
  • level of best skill (2 bytes)
  • xl (2 bytes)
  • maxhp (2 bytes)
  • evasion (2 bytes)
  • AC (2 bytes)
  • base damage (2 bytes)
  • speed (2 bytes)
  • move energy (move speed) (2 bytes)
  • see invis (1 byte)
  • attack brand (2 bytes)
  • attack type (not used for player ghosts) (2 bytes)
  • attack flavor (not used for player ghosts) (2 bytes)
  • resistances (2-5 bytes-ish)
  • colour (not used for player ghosts) (1 byte)
  • flying (always true for player ghosts) (1 byte)
  • spells (1 byte + 5 bytes per spell)

So somewhere around 37-70 bytes per ghost, plus the length of the name, plus a little extra for file headers, number of ghosts, etc.

As for versions: Crawl can detect when the bones file is for too old or too new a version, and just refuses to load it. But you can determine that a priori by looking at the first couple of bytes and comparing those to the "Save file version" printed by crawl -version. If the first byte equals the major version (currently 34, since 0.12 or so) and the second byte is less than or equal to the minor version (currently 157 in trunk), then the bones file can be loaded.

Edit: forgot the name