C64 BT1 stats save format

Any developer realated stuff
Post Reply
User avatar
Horpner
Posts: 224
Joined: Thu Jan 08, 2009 11:53 pm
Location: New England
Contact:

C64 BT1 stats save format

Post by Horpner »

I wasn't able to find information on hacking my stats on this forum or elsewhere, so I decided to figure it out. If this info is already known and I just couldn't find it, then it can live here. For me.

The stats (and for some reason the starting HP) seem to be stored in 8 bytes, broken into five-bit bitfields, with two padding bits for filler, one after the first two bitfields, and one after the next three. The stats appear in the same order as they do on your character sheet: St, IQ, Dx, Cn, Lc, HP.

As an example, here's how to calculate the values for all 18's.

18 is 10010 in binary, so list 6 in a row, with the two padding bits set to zero and inserted in the correct locations.

10010 10010 0 10010 10010 10010 0 10010

To translate that to hex, just regroup into nibbles.

1001 0100 1001 0010 1001 0100 1001 0010

Which in hex is 94 92 94 92. If you're sick of save-scumming to get good stat increases you can just pump up all your characters to max by using those eight bytes--with the caveat that I'm not sure what becomes of the HP bitfield once you've gained a level.

Judging by the hacking document for MSDOS hosted here, It seems other ports of the game didn't bother with this obfuscating encoding. Maybe they did this on the C64 to save space.

I've tested this stat storage encoding by giving my starting characters maximum starting stats for their races, which, you have to believe me, seemed simpler than re-rolling hundreds of times until I'm happy.

Other basic info you might need before launching your sector editor: Characters are stored on the City disk starting on track 17. Each sector can store two character records. A character record can be a character, or a team. Once you find your character's name (stored in reversed PETSCII), the stats bytes start right after the character name, which is 16 bytes long. I wonder if those padding bits are used for something--they could store stoned, dead or withered in them, for example. I'll check it next time I get unlucky.

Best,

Horpner Sneed
Death and drek? WTF?
User avatar
Darendor
Posts: 1502
Joined: Wed Jan 14, 2009 1:53 am
Location: Red Deer, Alberta, Canada

Re: C64 BT1 stats save format

Post by Darendor »

Holy firehorns, it's Horpner.

I think that the padding bits after the user name are just that - FFs for padding the character names.

ZeroZero has all that jazz in his documentation I'm sure.


This reminds me, I should get back to the BT2 project. Maybe. :?
User avatar
Horpner
Posts: 224
Joined: Thu Jan 08, 2009 11:53 pm
Location: New England
Contact:

Re: C64 BT1 stats save format

Post by Horpner »

Hey, Darendor.

It turns out the last bitifled that contained initial HP is just ignored when it gets changed--I'm not sure why it got encoded there in the first place. HP and SpPt appear to be 16-bit values stared lower down.

The padding pits are the little zeros interspersed within the stat bitfields.

Where is ZeroZero's documentation to be found?
Death and drek? WTF?
User avatar
Horpner
Posts: 224
Joined: Thu Jan 08, 2009 11:53 pm
Location: New England
Contact:

Re: C64 BT1 stats save format

Post by Horpner »

Found it!
Death and drek? WTF?
Post Reply